Skip to content
BENIBIX Learn

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

mcpServers is the Agent SDK option that connects MCP servers to a session. In Python it is mcp_servers. Each entry has a name and a config: a command to start a local server, a URL for a remote one, or an in-process server made in your own code. Their tools reach Claude with names like mcp__github__list_issues. You still need to allow them, like any tool.

Example code

typescript
mcpServers: {
  github: { command: "npx", args: ["-y", "@modelcontextprotocol/server-github"] },
}
Start the GitHub server for this session.

Common mistake

Adding a server but not allowing its tools. They then wait for approval every time.

Key takeaways

  1. 1
    Name and config. Per server.
  2. 2
    Local, remote or in-process. Three kinds.
  3. 3
    Still needs allowing. Like any tool.