Claude Code MCP Setup: Connect MCP Servers to Claude Code
What it is
Anthropic's agentic coding tool that runs in your terminal and reads, edits, and runs code across a whole repository.
How MCP works in Claude Code
Claude Code is a first-party MCP client. It can add servers over stdio, SSE, and Streamable HTTP, at user, project, or local scope, and exposes their tools directly to the agent.
You can also add a server without editing JSON by running, for example, claude mcp add playwright -- npx @playwright/mcp@latest.
Config file location
~/.claude.json holds user-scope servers, and a project-root .mcp.json file holds shared servers under an mcpServers object; the claude mcp add command writes either for you.
Add your first server
A good first server is Playwright MCP — Microsoft's browser automation server. It runs locally over stdio via npx, needs no API key, and gives the agent a real browser to drive. Here is the verified Claude Code config:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}Restart or reload Claude Code after saving, then confirm the server's tools show up. Swap in any other server from the directory using the same structure.
Transports & platforms
| Transports | stdio, SSE, Streamable HTTP |
|---|---|
| Platforms | macOS, Linux, Windows |
| License | Proprietary |
| Vendor | Anthropic |
FAQ
Does Claude Code support MCP?
Yes. Claude Code works as an MCP client over stdio, SSE, Streamable HTTP. Claude Code is a first-party MCP client. It can add servers over stdio, SSE, and Streamable HTTP, at user, project, or local scope, and exposes their tools directly to the agent.
Where is the Claude Code MCP config?
~/.claude.json holds user-scope servers, and a project-root .mcp.json file holds shared servers under an mcpServers object; the claude mcp add command writes either for you. The verified example above shows the exact structure it expects.
Which MCP servers work with Claude Code?
Any server that speaks a transport Claude Code supports (stdio, SSE, Streamable HTTP). Browse the MCP server directory on this site to find databases, browser automation, API integrations, and dev tools, then add them using the config format above.