🧩createSdkMcpServer() Function
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
Example code
typescript
const orders = createSdkMcpServer({
name: "orders",
version: "1.0.0",
tools: [getOrder],
});Common mistake
Key takeaways
- 1Name, version, tools. Its inputs.
- 2Goes in mcpServers. Like any server.
- 3Name joins the tool name. mcp__server__tool.