Overview
Model Context Protocol (MCP) servers extend Claude Code with custom tools and capabilities. MCPs can run as external processes, connect via HTTP/SSE, or execute directly within your SDK application.Configuration
Basic Configuration
Configure MCP servers in.mcp.json
at your project root:
Using MCP Servers in SDK
Transport Types
stdio Servers
External processes communicating via stdin/stdout:HTTP/SSE Servers
Remote servers with network communication:SDK MCP Servers
In-process servers running within your application. For detailed information on creating custom tools, see the Custom Tools guide:Resource Management
MCP servers can expose resources that Claude can list and read:Authentication
Environment Variables
OAuth2 Authentication
OAuth2 MCP authentication in-client is not currently supported.Error Handling
Handle MCP connection failures gracefully:Related Resources
- Custom Tools Guide - Detailed guide on creating SDK MCP servers
- TypeScript SDK Reference
- Python SDK Reference
- SDK Permissions
- Common Workflows