Skip to content

MCP servers

Point the toolkit at an mcp.json — local stdio servers (command) and remote streamable-HTTP servers (url) both work, and their tools join the same tool set. A failing server is isolated (status failed); it contributes no tools and never breaks the build.

const tk = await createToolkit({
mcpConfig: "./mcp.json", // path, raw JSON string, or a parsed object
})
console.log(tk.tools().map((t) => `${t.name} (${t.source})`))

An mcp.json — both server kinds shown:

{
"mcpServers": {
"filesystem": {
"command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
},
"remote-api": {
"url": "https://example.com/mcp",
"headers": { "Authorization": "Bearer ${MCP_TOKEN}" }
}
}
}

${MCP_TOKEN} expands from the environment at call time and is never logged. The top-level key may be mcpServers, servers, or mcp. See MCP servers for the full config surface (per-server timeouts, tool allowlists, elicitation).

Next: Agent skills.