TL;DR: I had 18 MCP servers loading every Claude Code session. Eight were broken. I built mcp-doctor — a free, open-source CLI that audits your MCP configuration, detects broken servers, finds duplicates, and recommends the right setup for your workflow. Run npx mcp-doctor audit and fix your setup in seconds.
MCP (Model Context Protocol) is the extensibility layer that makes Claude Code powerful. Install a Playwright MCP and Claude can test your web app. Add a memory server and it remembers context across sessions. Connect Slack and it can post updates for you.
The problem? MCP servers accumulate silently.
You install a few manually. Plugins auto-install others. Claude.ai connectors add more without asking. Your colleague shares a .mcp.json with five servers you don't need. Before long, your ~/.claude.json is a 1,000-line config file with servers scattered across four different scopes.
Here's what my setup looked like before I cleaned it up:
Every broken server added seconds to my startup time. Every misconfigured one wasted tokens when Claude tried and failed to use it. And there was zero tooling to tell me what was wrong.
After spending 30 minutes manually auditing my config, I identified several patterns that trip up every Claude Code user:
MCP servers can live in four different places:
~/.claude.json → mcpServers (user scope — loads everywhere)
~/.claude.json → projects["/path"].mcpServers (project-local)
/project/.mcp.json (shared project scope)
claude.ai connectors (platform-managed)
When you run claude mcp add, which scope does it go to? Most users don't know. This leads to the same server registered multiple times across scopes — each one spawning a separate process on startup.
When an MCP server fails to connect, Claude Code shows a brief warning and moves on. Your session continues, but you've lost access to those tools. If you don't check claude mcp list regularly, you won't even know servers are broken.
Common failure modes:
npx fails silently with module-not-found errorsYOUR_API_KEY_HERENot every MCP server needs to run every session. Playwright? Probably always. A lyric-genius server for music production? Only when you're making music. But Claude Code has no concept of "always-on" vs. "on-demand" — everything in your config loads at startup, every time.
I wanted a tool that could do in 10 seconds what took me 30 minutes manually. The requirements were simple:
The result is mcp-doctor — a TypeScript CLI tool that does exactly that.
npx mcp-doctor audit --quick
This reads your ~/.claude.json, validates all server configs, checks for missing environment variables and duplicates, and produces a health report — instantly, no process spawning.
npx mcp-doctor audit
The full audit actually spawns each stdio server, sends an MCP initialize handshake, and verifies the server responds. This catches npm cache corruptions, missing dependencies, and runtime errors that config-only checks miss.
npx mcp-doctor recommend
Not sure which MCPs you need? Choose from 10 curated preset packs based on your workflow:
| Pack | Best For |
|---|---|
web-developer | Next.js, Vercel, full-stack |
content-creator | Blogging, images, email |
ai-architect | Agents, multi-model systems |
data-engineer | Databases, pipelines |
devops | CI/CD, infrastructure |
security | Auditing, pen testing |
minimal | Start clean, add what you need |
Each pack specifies which servers should be always-on (load every session) vs. on-demand (add when needed), with the exact install commands.
The most impactful optimization isn't removing broken servers — it's moving occasional servers to on-demand. Here's the framework:
Servers you need in nearly every session. Load cost is justified by constant use.
Servers you need sometimes. Add them at the start of relevant sessions, remove after.
Servers that are broken, misconfigured, or redundant. They add startup latency with zero benefit.
The on-demand add commands are simple:
claude mcp add sequential-thinking -- npx -y @modelcontextprotocol/server-sequential-thinking
And removal is just:
claude mcp remove sequential-thinking
After running mcp-doctor on my own setup:
| Before | After |
|---|---|
| 18 servers loading | 5 always-on |
| 8 broken | 0 broken |
| 4 duplicates | 0 duplicates |
| Health score: 50/100 | Health score: 100/100 |
Session startup is noticeably faster. No more silent tool failures. And I have documented on-demand commands for the servers I need occasionally.
npx mcp-doctor audit
It's free, open source (MIT), and takes 10 seconds to run.
If you find it useful, star the repo. If you have a workflow that needs a preset pack, open an issue.
MCP (Model Context Protocol) servers are external tools that extend Claude Code's capabilities. They run as separate processes and provide tools like browser automation (Playwright), image generation (Nanobanana), or database access. Claude Code communicates with them over stdio or HTTP using the MCP protocol standard.
Run claude mcp list to see connection status, or use npx mcp-doctor audit for a comprehensive health check that tests each server's actual connectivity, not just its configuration.
User-scope servers (in ~/.claude.json top-level mcpServers) load in every Claude Code session regardless of which project you're in. Project-local servers only load when you open Claude Code in that specific directory. Use user scope for universal tools like Playwright; use project-local for project-specific tools.
There's no hard limit, but each server spawns a process and adds to startup time. A lean setup of 3-5 always-on servers with additional on-demand servers is the sweet spot for most developers. Use npx mcp-doctor recommend minimal to start with just the essentials.
No. The current version is read-only — it scans and reports but doesn't change anything. The suggested fix commands are printed for you to review and run manually. A --fix flag for automatic remediation is planned for a future release.
Yes. Presets are defined in src/analyzer/presets.ts. Fork the repo, add your pack, and submit a PR. Community presets for niche workflows are welcome.
Read on FrankX.AI — AI Architecture, Music & Creator Intelligence
Join 1,000+ creators and architects receiving weekly field notes on AI systems, production patterns, and builder strategy.
No spam. Unsubscribe anytime.