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:
- Type: stdio
- Command:
node server.js(or however you launch the server)
Exposing resources
Resources let Claude read data from your server:ListMcpResourcesTool and ReadMcpResourceTool.
Authentication
For HTTP-based MCP servers, Claude Code supports theMcpAuthTool 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.