Skip to content
BENIBIX Learn

createSdkMcpServer() Function

AI🧩 Claude Agent SDKCustom Tools

Also known as create_sdk_mcp_server, createSdkMcpServer, Claude Agent SDK createSdkMcpServer()

The function that puts your tools on one server for the agent.

Think of it like

It is like a panel that holds your new buttons.

Example

Mia puts two order tools in one server called orders. Claude then sees each tool with the server name in front.

Why it matters

Custom tools reach Claude only through an MCP server, and this makes one in a single call.

Definition

createSdkMcpServer() is the Agent SDK function that wraps your custom tools in an MCP server. In Python it is create_sdk_mcp_server. You give it a name, a version and the list of tools. You then pass the server in the mcpServers option. The server name becomes part of each tool's name, such as mcp__orders__get_order.

Example code

typescript
const orders = createSdkMcpServer({
  name: "orders",
  version: "1.0.0",
  tools: [getOrder],
});
Wrap one tool in a server called orders.

Common mistake

Allowing a tool by its short name. In allowedTools, use the full name that starts with mcp.

Key takeaways

  1. 1
    Name, version, tools. Its inputs.
  2. 2
    Goes in mcpServers. Like any server.
  3. 3
    Name joins the tool name. mcp__server__tool.