🧩mcpServers Option
Also known as mcpServers, mcp_servers, Agent SDK MCP, Claude Agent SDK mcpServers
The option that links MCP servers, and their tools, to a session.
Think of it like
It is like plugging new games into a game box.
Example
Leo's agent needs to read GitHub issues. He adds the GitHub MCP server to mcpServers and allows its tools.
Why it matters
It is the main way to let an agent reach other systems. You write no new tools.
Definition
Example code
typescript
mcpServers: {
github: { command: "npx", args: ["-y", "@modelcontextprotocol/server-github"] },
}Common mistake
Key takeaways
- 1Name and config. Per server.
- 2Local, remote or in-process. Three kinds.
- 3Still needs allowing. Like any tool.