Connecting tools with MCP
Give Claude Code access to GitHub, a database, or your filesystem. The three scopes, the transports that matter, and one working config.
- MCP (Model Context Protocol) connects Claude Code to an external tool: a database, an API, your filesystem.
- Project-scoped servers live in
.mcp.jsonat your repo root, committed to git. - Prefer
httpfor a remote server.ssestill works but is deprecated. - Watch this one: an entry with a
urlbut notypefield. Claude Code treats that as an error, not a default.
What it is
An MCP server exposes a set of tools, read a file, query a database, search an API, that Claude Code can call the same way it calls its own built-in tools. It is how you connect Claude to something specific to your stack without waiting for Anthropic to build it in.
The smallest working example
{
"mcpServers": {
"github": {
"type": "http",
"url": "https://mcp.github.com",
"headers": { "Authorization": "Bearer ${GITHUB_TOKEN}" }
}
}
}.mcp.jsonat your repo root is committed to git. Everyone on the team gets the same server, and Claude Code asks for approval the first time each person uses it.type: "http"is the current standard transport for a remote server. In JSON,"streamable-http"is accepted as an alias for"http".- Environment variable syntax like
${GITHUB_TOKEN}keeps the actual secret out of the committed file.
Restart Claude Code in the project. On first use, it prompts you to approve the github server before any tool call goes through.
The three scopes
| Scope | Where | Shared? |
|---|---|---|
| Local | ~/.claude.json, tied to this project | Just you |
| User | ~/.claude.json | Just you, every project |
| Project | .mcp.json at the repo root | Your whole team, via git |
Add a server with claude mcp add rather than editing the file by hand. It writes to the correct scope for you.
Transports
stdio: a local child process. The default, and the simplest for a server that runs on your own machine.http: streamable HTTP. The current standard for anything remote.sse: deprecated. Migrate tohttpwhen a server offers both.ws: WebSocket, configured only via the file, not the CLI.
If an entry has a url field but no type field, Claude Code treats it as a configuration error rather than guessing a transport. Always set type explicitly.
How it behaves
- MCP tools are permissionable the same way built-in tools are, using rules like
mcp__github__*. - MCP resources and prompts a server exposes surface as slash commands automatically.
- Import servers you already configured in Claude Desktop with
claude mcp add-from-claude-desktop, instead of retyping them. - When a project has enough tools that they start crowding your context, Claude Code can defer tool definitions and load them on demand. This activates automatically once tools cross a size threshold.
When not to use it
MCP connects Claude to a tool. If what you actually need is a reusable procedure, a set of steps rather than a live data source, that is a skill instead.