mcp server doctor
Diagnose and fix broken MCP server connections, transport errors, and configuration gaps in AI clients.
$11
Works with the AI Agents you already use
mcp server doctor
Example session with this skill installed
My MCP server works in the terminal but Claude Desktop shows 'Server transport closed unexpectedly'. Here is my config: {"mcpServers": {"my-server": {"command": "node", "args": ["server.js"]}}}
- Read your context and instructions
- Compiled the mcp server doctor
The server is failing because the client cannot find the node executable or the server file due to a relative path and missing environment context. This matches pattern F-02 (Command not found) or F-04 (Path resolution failure).
1. Diagnosis
Your server is failing because the client process does not inherit your shell's PATH or working directory, preventing it from locating node or server.js.
2. Evidence
- Config:
"command": "node"relies on the systemPATH, which is often restricted in GUI applications.
Config: "args": ["server.js"] uses a relative path. Clients spawn processes without knowledge of your project root.
- Handshake: Reached
No protocol traffic at all, confirming the process never successfully spawned.
3. The fix
Update your claude_desktop_config.json to use absolute paths for both the executable and the script.
{
"mcpServers": {
"my-server": {
"command": "/usr/local/bin/node",
"args": ["/absolute/path/to/server.js"],
"env": {
"PATH": "/usr/local/bin:/usr/bin:/bin"
}
}
}
}
Using absolute paths removes the dependency on the host's shell environment.
4. Verification
- Isolate: Run
npx @modelcontextprotocol/inspector /usr/local/bin/node /absolute/path/to/server.js. - Observe: Confirm the inspector opens a browser window and lists your tools.
- Client Check: Fully quit Claude Desktop (Cmd+Q) and restart.
- Log Check: Verify the client log shows
connectedformy-server.
5. If that was not it
F-01 (Stdout Pollution): The server might be printing non-JSON text on startup. Run node server.js 1>stdout.log and check if stdout.log contains anything other than JSON.
F-05 (Permission Denied): Ensure the node binary and the script have read/execute permissions for the user running the IDE.
Next steps
- Run
which nodein your terminal to get the absolute path for the config. - Replace
/absolute/path/to/server.jswith the full path from your home directory.
Connects securely to your tools. The creator never sees your data.
About this skill
Debug MCP servers without the guesswork. This skill stops you from wasting hours on server code when the real culprit is a missing environment variable or a polluted stdout stream. It provides a technical audit of your Model Context Protocol setup by analyzing logs and configs against a library of documented failure patterns.
What it does
- Diagnose connection failures by identifying why servers won't start, time out, or close unexpectedly.
- Trace handshake breaks to pinpoint exactly where the protocol negotiation failed between the client and server.
- Detect stdout pollution which is the primary cause of JSON-RPC parse errors in stdio transports.
- Validate client configurations for common syntax errors, path issues, and environment gaps across major IDEs.
- Isolate server logic from client-specific behavior using protocol inspector commands.
How it works
- Analyze symptoms by comparing error codes and log fragments against the
failure-patterns.mdreference. - Reconstruct the handshake using the
parse_mcp_log.pyscript to find the exact protocol break point. - Audit the environment to find discrepancies between your terminal and the IDE's spawned process.
- Generate the fix including corrected JSON configs or code changes to move diagnostics to stderr.
- Verify with commands that prove the server works in isolation before reconnecting to the client.
Frameworks & tools
Works with TypeScript and Python MCP SDKs. Supports Claude Desktop, Cursor, VS Code, Zed, and Windsurf. Uses npx @modelcontextprotocol/inspector for isolation testing.
Why this beats prompting it yourself
Generic LLMs often mistake environment-level spawn errors for internal logic bugs. This skill uses a specific diagnostic ladder and specialized regex scripts to identify the "silent" failures that standard prompts miss.
Use cases
- Fix "Connection closed" or error
-32000messages in Claude Desktop. - Debug why a server works in the terminal but shows no tools in Cursor.
- Resolve JSON-RPC parse errors caused by library banners or logging statements.
- Correct
mcpServersconfiguration blocks for Windows path escaping or env expansion.
Known limitations
Cannot inspect your local filesystem or run servers directly. Relies entirely on pasted logs and configs. Does not perform design reviews of tool schemas unless they cause protocol failures.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.
Requires logs for confident diagnosis. Cannot access local files or network. Does not recommend 3rd-party servers. Focuses on connectivity over business logic.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
- Software
- @modelcontextprotocol/inspector
Node.js