devtools.codes

MCP server not connecting: what to check

Your tool input is processed locally in your browser and is not intentionally uploaded to our servers. Advertising and analytics providers may still process normal page, device, cookie and network information.

An MCP server that will not connect is nearly always a configuration problem rather than a protocol one, and the configuration is usually valid JSON. That combination is why the failure is confusing: nothing reports an error, and no server appears.

The first thing to check is the command path. A relative path such as ./scripts/server.js resolves against the working directory the client launched from, which is rarely the directory you were thinking of. Use an absolute path, or a command that is genuinely on PATH.

The second is whether the command exists in the environment the client uses. A GUI application does not inherit the shell environment you see in a terminal, so a version manager that works in your shell may be invisible to the client. This is the usual explanation for a server that runs perfectly when you invoke it by hand.

The third is environment variables. Writing a value as ${MY_TOKEN} looks like shell syntax, but most clients pass env values through literally rather than expanding them. The server then receives the literal string and fails to authenticate, which typically surfaces as a connection that opens and immediately closes.

The fourth is the top-level key. Most clients expect mcpServers. A configuration using a different key is still valid JSON, and the client simply finds no servers and reports nothing — silence rather than an error.

The fifth is transport confusion. A stdio server needs a command; an HTTP or SSE server needs a url. Declaring both, or neither, produces a configuration that reads sensibly and does not work.

Check these five before reaching for logs. Between them they account for the large majority of MCP connection failures, and all five are visible in the configuration file itself without launching anything.

More on mCP server not connecting: what to check

Where does the MCP config file live?

It depends on the client, and that is worth confirming before debugging anything else. Desktop applications keep it in their own application support directory; editor integrations often keep a project-local file as well. Editing the wrong one of two files that both exist produces exactly the silent no-op this page describes.

Why does my server work in the terminal but not in the client?

Because the client does not inherit your shell environment. Anything set up by your shell profile — a version manager, a PATH addition, an exported variable — is invisible to an application launched from a desktop icon. Use absolute paths to the interpreter and the script, and pass variables explicitly in the env block.

Can I use ${VAR} in the env block?

Usually not. Most clients pass env values through literally rather than expanding them, so the server receives the four characters and a variable name instead of a token. The symptom is a connection that opens and closes immediately, which reads as a crash rather than as an authentication failure.

How do I tell a config error from a server crash?

By whether anything happens at all. A configuration the client cannot match — a wrong top-level key, a missing transport field — produces silence: no server listed, no error. A server that launches and then fails produces an entry that appears and disappears, or a client-side error. Silence points at the file; noise points at the server.

The tool behind this, and related guides