Skip to main content
The Model Context Protocol (MCP) is an open protocol for connecting AI models to external tools and data sources. Claude Code implements MCP as both a client (connecting to MCP servers) and uses MCP-compatible patterns internally.

MCP concepts

Building an MCP server

Create an MCP server using the official MCP SDK:
server.ts

Connecting your server to Claude Code

Add the server via /mcp:
Select “Add server” and provide:
  • Type: stdio
  • Command: node server.js (or however you launch the server)

Exposing resources

Resources let Claude read data from your server:
Claude Code accesses resources via ListMcpResourcesTool and ReadMcpResourceTool.

Authentication

For HTTP-based MCP servers, Claude Code supports the McpAuthTool for authentication flows. For local stdio servers, no authentication is needed — the server runs as a local process.
The MCP SDK handles protocol framing, serialization, and transport. You only need to implement the handlers for your specific tools and resources.
For more on connecting servers, see MCP Servers.