The moment I first connected an MCP server to Claude Code, something shifted.
Until then, interacting with Claude meant sending text and receiving text. The instant I connected an MCP tool, Claude started treating my project's codebase, database, and external services as things it could directly touch — not just describe. This guide is my attempt to translate that experience into concrete steps you can follow.
What MCP Servers Actually Are
MCP (Model Context Protocol) is an open protocol from Anthropic that lets LLMs interact safely with external tools and data sources. In Claude Code, you configure MCP server connections in .claude/settings.json, and Claude immediately gains the ability to call those tools as part of its reasoning.
The key insight is that Claude decides when to call tools based on context. You don't need to say "read that file" — Claude infers it needs to and does so. This is fundamentally different from the "instruct Claude step by step" workflow.
One thing the official docs don't mention: MCP tool call logs give you a real-time window into Claude's reasoning process. Watching which tools it calls, in which order, is invaluable when debugging complex tasks.
Choosing the Right MCP Servers
Dozens of official MCP servers are already available, but more isn't always better. Here are the four I use consistently:
filesystem — Direct local file access. Lets Claude review the actual state of your project before suggesting changes. Limiting allowed paths also keeps the security surface area small.
github — Repository operations: reading PR comments, searching issues, managing branches. "Find all issues related to this PR" becomes a single-step task.
sqlite — Interactive database queries. Claude can inspect your schema and iteratively refine queries in the same conversation.
fetch — Web content retrieval. Claude can reference official docs or API specs directly while writing code alongside them.
A word of caution: loading too many servers at once can dilute Claude's attention. Managing which servers are active per project — rather than enabling everything globally — tends to produce better results.
Writing .claude/settings.json
The basic structure is straightforward:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/yourname/projects/myapp"
]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_TOKEN"
}
},
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
}
}
}On token handling: The env block above works, but for any real project, store secrets in a .env file or OS keychain and add settings.json to .gitignore. Accidentally pushed tokens are revoked immediately — use placeholders like YOUR_GITHUB_TOKEN in version-controlled files.
After saving the config, launch Claude Code and run /mcp to see which servers connected successfully. Green checkmarks mean you're ready.
Common Errors and How to Fix Them
Error: spawn npx ENOENT
Node.js isn't in PATH or is below version 18. Run node --version to check. If you use nvm or fnm, make sure your shell profile sets PATH correctly before Claude Code launches.
Permission denied (filesystem)
Claude tried to access a path outside your allowed directories. The error itself is expected behavior, but if it keeps repeating, adjust your allowed paths in the config.
Tools appear but never execute
Usually means the MCP server crashed at startup. Run claude --mcp-debug to surface the server's stdout/stderr directly — problem identification goes from minutes to seconds.
A Real Project Configuration
Here's the setup I use for a Next.js + Cloudflare Workers personal app:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/masaki/projects/myapp/src",
"/Users/masaki/projects/myapp/content"
]
},
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
},
"sqlite": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sqlite",
"--db-path",
"/Users/masaki/projects/myapp/local.db"
]
}
}
}The combination of filesystem + sqlite is particularly powerful. A prompt like "check whether this article slug exists in the DB, and if not, suggest which content/ subfolder it belongs in" — something that would normally take 3–4 manual steps — resolves in a single exchange.
Where to Start
Start with just the filesystem server, scoped to a single project folder. Ask Claude: "Get familiar with this project's structure and tell me what you'd improve." The difference in answer quality compared to a context-free chat will be immediately obvious.
The MCP ecosystem is maturing fast. The official server registry is worth browsing periodically — the tool you didn't know you needed might already exist.