Claude Code MCP Setup Guide
The Model Context Protocol (MCP) is what lets Claude Code reach beyond your codebase — connecting to databases, issue trackers, documentation, and other services so it can act on real data and tools. This guide covers what MCP is and how to set it up.
What is MCP?
MCP is an open standard for connecting AI assistants to external tools and data sources through a common interface. Instead of hard-coding integrations, an “MCP server” exposes tools (and data) that Claude Code can call. For background on the protocol, see our Model Context Protocol overview.
Why use MCP with Claude Code?
- Act on real data — query your database or read live issues instead of pasting context.
- Automate across tools — connect GitHub, docs, monitoring, and project trackers.
- Reuse standard servers — many ready-made MCP servers exist for common tools.
How to add an MCP server
The quickest way is the built-in command. From your project, run:
claude mcp add <name> <command-or-url>
You can also manage servers from inside a session with the /mcp command, which lists connected servers and their available tools. Once a server is connected, its tools appear to Claude Code automatically and it can call them as part of a task.
Connection types
- Local (stdio) — runs a server process on your machine (great for filesystem, local databases, or CLI-based tools).
- Remote (HTTP/SSE) — connects to a hosted MCP server over the network (great for shared, cloud-based services).
Configuration scopes
MCP servers can be configured at different scopes so the right people get the right tools:
- Local/user — available only to you, across your projects.
- Project — checked into the repo so your whole team shares the same servers.
Common MCP servers to start with
- Filesystem — controlled access to files and folders.
- GitHub / issue trackers — read and act on issues and pull requests.
- Databases (e.g. Postgres) — query schemas and data safely.
- Documentation — let Claude Code search your internal or product docs.
Security tips
- Only add MCP servers you trust, since they grant real capabilities and data access.
- Prefer least-privilege access (read-only where possible) for databases and production systems.
- Keep secrets in environment variables rather than committing them with project-scoped configs.
Frequently Asked Questions
What is MCP in Claude Code?
MCP (Model Context Protocol) is an open standard that connects Claude Code to external tools and data sources — like databases, GitHub, and docs — through a common interface, so it can act on real data instead of pasted context.
How do I add an MCP server to Claude Code?
Use the command "claude mcp add
Are MCP servers safe?
MCP servers grant real capabilities and data access, so only add ones you trust, use least-privilege (read-only where possible), and keep secrets in environment variables rather than committing them.
What can I connect to Claude Code with MCP?
Common MCP servers include filesystem access, GitHub and issue trackers, databases like Postgres, and documentation search — plus many community and official servers for other tools.