When Your MCP Server Just... Doesn't Work
I still remember the first time I set up an MCP server. I followed the docs, ran the command, opened Claude, and — nothing. No tools showing up, no error message I could actually understand, just silence. I restarted everything twice before I even thought about looking at the logs.
If that sounds familiar, you're not alone. MCP (Model Context Protocol) connections fail more than you'd expect, especially when you're just getting started. The good news is that there are really only a handful of things that go wrong, and once you know what to look for, debugging becomes almost routine.
This guide walks through the most common broken MCP server scenarios and exactly how to fix them — no advanced developer knowledge required.
Step One: Confirm the Server Is Actually Running
This sounds obvious, but I can't tell you how many times I've spent twenty minutes debugging a "connection issue" only to realize the server process had just quietly crashed in the background.
If you're running an MCP server via stdio (the most common beginner setup), the server lives as a child process managed by whatever client you're using — usually Claude Desktop. If that process dies, there's nothing to connect to.
Here's the first thing I check every time:
# Check if your server script runs at all, outside of Claude
node my-mcp-server.js
# Or for Python servers:
python my_mcp_server.py
→ If it crashes immediately, that's your first bug to fixRunning the server manually in your terminal is the fastest way to surface startup errors. If it throws an error before even starting to listen, you'll see it right there — no need to dig through Claude's logs at all.
Step Two: Check Your claude_desktop_config.json
The config file is where most beginners trip up. One misplaced comma, a wrong path, or a typo in the command and Claude won't even try to start your server. It fails silently, which is infuriating.
Your config file lives here depending on your OS:
# macOS
~/Library/Application Support/Claude/claude_desktop_config.json
# Windows
%APPDATA%\Claude\claude_desktop_config.jsonOpen it and double-check these things one by one:
1. The JSON is valid. Paste the entire file into jsonlint.com — it'll tell you immediately if there's a syntax error. I do this every single time I edit the config.
2. The command path is absolute. Relative paths like ./my-server.js often don't work because Claude Desktop doesn't know what directory to resolve them from. Use the full path.
3. The command actually exists on your system. If your config says node, make sure Node is installed and in your PATH. Same for Python, npx, etc.
The "works in terminal, fails in Claude" trap
Claude Desktop launches with a minimal environment — your shell's PATH customizations from .zshrc or .bashrc aren't loaded. If you installed Node via nvm or pyenv, you may need to use the full binary path like /Users/yourname/.nvm/versions/node/v20.0.0/bin/node in the config.
Step Three: Read the MCP Logs (They're Actually Useful)
This is the part I skipped for way too long, and it cost me a lot of time. Claude Desktop writes MCP logs that are genuinely readable — not cryptic C++ stack traces, just plain messages about what went wrong.
# macOS
~/Library/Logs/Claude/mcp*.log
# Windows
%APPDATA%\Claude\logs\mcp*.log
# Tail the log in real time (macOS/Linux)
tail -f ~/Library/Logs/Claude/mcp-server-myserver.logWhen I open Claude Desktop now, I always have a terminal window running that tail -f command on the side. When something breaks, the log often tells me exactly what happened within seconds.
Common messages you'll see and what they mean:
"spawn ENOENT" — The command in your config doesn't exist. Check the path.
"Connection closed" — The server process exited unexpectedly. Run it manually to see why.
"JSON parse error" — Your server sent back something that isn't valid JSON. Usually a console.log debug statement accidentally going to stdout instead of stderr.
The stdout/stderr Trap That Gets Everyone
This one is subtle and it burned me pretty badly early on. MCP stdio servers communicate with the client over stdout. That means if anything else writes to stdout — including your own debug logs — it corrupts the communication channel.
So this innocent looking line in your server code:
// BAD — this pollutes the MCP communication channel
console.log("Server started!");
// GOOD — stderr is safe, MCP doesn't use it
console.error("Server started!");Switch every console.log in your server to console.error and you'll be surprised how many mysterious connection drops just disappear.
stderr shows up in the MCP logs
Anything you write to stderr from your server process gets captured in Claude's MCP log files. This makes console.error() perfect for debugging — you get your debug output without corrupting the channel.
Step Four: Tools Aren't Showing Up in Claude
So your server is running, the logs look clean, but when you open Claude the tools just aren't there. This is usually one of three things.
You haven't restarted Claude Desktop. I know, I know — but Claude only reads the config file on startup. Every time you change claude_desktop_config.json or modify your server, you need to fully quit and reopen Claude. Not just close the window — actually quit the app.
Your server name in the config doesn't match. The key you use in the mcpServers object is just an identifier — it doesn't have to match anything specific. But if you have a typo or duplicate key, one entry silently wins.
Your tools aren't being registered correctly. If you're building a custom server, double-check that your tool definitions are being returned properly in response to the tools/list request. The MCP SDK handles this for you if you're using it — but if you're doing things more manually, it's worth verifying.
A Quick Debugging Checklist to Keep Handy
I actually have this taped to the wall above my desk (yes, literally). When something breaks, I go through it in order and I almost always find the problem by step four or five.
# MCP Connection Debug Checklist
1. Run the server manually in terminal — does it start cleanly?
2. Validate claude_desktop_config.json at jsonlint.com
3. Check all paths in config are absolute, not relative
4. Confirm node/python/npx is in PATH (use full binary path if needed)
5. Check MCP logs: ~/Library/Logs/Claude/mcp*.log
6. Replace all console.log with console.error in server code
7. Fully quit and restart Claude Desktop
8. Check for duplicate server keys in configYou'll Get Faster at This
Debugging MCP connections felt intimidating to me at first because there were so few visible error messages. It seemed like things were just failing in the dark. But once I learned where to look — the logs, the manual startup test, the stdout trap — it became something I could usually resolve in under five minutes.
The biggest shift for me was treating MCP debugging like any other software debugging: form a hypothesis, test it, move to the next thing. The tools are there, they're just not obvious at first.
If you're still stuck after going through this checklist, the MCP Discord community and the official Anthropic docs are genuinely helpful. And honestly, pasting your log file into Claude itself and asking "what does this error mean?" works surprisingly well too.
More tutorials in this category, or explore the full field guide.