DEV Community

Cover image for The best MCP servers for Claude Code (and the config that actually works)
AI Prime Tech
AI Prime Tech

Posted on

The best MCP servers for Claude Code (and the config that actually works)

Model Context Protocol turns Claude Code from a code generator into something that can read your repo,
query a database, drive a browser and file a PR. The catch is that most "MCP setup" posts stop at
filesystem and never mention the traps. Here's a config I actually run, plus the gotchas.

A .mcp.json that earns its place

Drop this in your repo root; Claude Code auto-detects it and asks you to trust it once.

{
  "mcpServers": {
    "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "${workspaceFolder}"] },
    "github":     { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_TOKEN": "..." } },
    "git":        { "command": "uvx", "args": ["mcp-server-git", "--repository", "${workspaceFolder}"] },
    "fetch":      { "command": "uvx", "args": ["mcp-server-fetch"] },
    "playwright": { "command": "npx", "args": ["-y", "@playwright/mcp@latest"] }
  }
}
Enter fullscreen mode Exit fullscreen mode

(Full pack with a postgres server and per-tool notes:
https://github.com/iskandaryv/anthropic-gateway-examples/tree/main/mcp)

The gotchas that cost real time

  • The trust prompt is a feature. Claude Code refuses to load project MCP servers until you approve them — per project. That's the security boundary, not a bug.
  • Give postgres a read-only role. An MCP server runs whatever SQL the model emits. A read-only role makes a hallucinated DROP physically impossible.
  • Scope the GitHub token. repo + read:org is enough. Don't hand it an all-scopes classic PAT.
  • MCP output is context. A 200-row query result or a full page fetch gets re-sent on the next turn. Big tool outputs inflate token usage fast — the thing that makes agentic sessions expensive.

It works the same through a gateway

MCP wiring is independent of where model calls go. Whether Claude Code talks to the official API or an
Anthropic-compatible gateway, the servers
are configured identically — the gateway only changes ANTHROPIC_BASE_URL, not .mcp.json.

Takeaways

  • Start with filesystem + git + github; add browser/db only when a task needs them.
  • Treat every server as an untrusted executor — least-privilege tokens, read-only DB roles.
  • Watch token usage: tool results are the hidden cost of an agentic loop.

Disclosure: I run ClaudeAPIKey.dev, an Anthropic-compatible API
gateway — mentioned above only because MCP config is unaffected by it. "Claude" is a trademark of
Anthropic; we are not affiliated with Anthropic.

Top comments (0)