MCP Support in Claude Code
Claude Code is a cli built by Anthropic. It acts as an MCP host, embedding an MCP client that can connect to any MCP-compatible server. It supports stdio and streamable-http transport.
tools
resources
prompts
Prerequisites
- Claude Code installed (download)
- Node.js 18+ or the runtime required by your target MCP server
- An MCP server package or source code to configure
- API credentials for your target integration
Configuration
{
"mcpServers": {
"example-server": {
"command": "npx",
"args": ["-y", "@mcp/example-server"],
"env": {
"API_KEY": "your-key-here"
}
}
}
}command— the executable (npx, node, python, uvx)args— arguments passed to the server processenv— environment variables injected at startup
Verifying the Connection
- Save the config file and fully restart Claude Code.
- Look for the MCP server indicator — a hammer icon or server status badge in Claude Code.
- Send a message asking the model to list available tools.
- Confirm all expected tools appear and a test call returns a valid response.
Troubleshooting
- Server not visible → check logs, confirm the package name, restart Claude Code.
- Tools missing → verify capability negotiation; the server must expose a
tools/listhandler. - Auth failures → check env var names match exactly.