For agents
@agentskit/mcp — for agents
Expose AgentsKit tools as an MCP server over stdio for Claude Desktop, Cursor, Windsurf.
#Purpose
Serve AgentsKit tools to any MCP host. A thin bridge over @agentskit/tools/mcp
(createMcpServer + createStdioTransport).
#Install
npm install @agentskit/mcp#Primary exports
createAgentsKitMcpServer({ tools, serverInfo?, onEvent?, transport? })— exposeToolDefinition[]as an MCP server. Defaults to stdio over the current process; passtransportto override (tests / custom hosts).processStdio()— adapt the Node process into theStdioLikeProcessthe transport expects (server receives on stdin, sends on stdout).createAgentTool({ id, description, systemPrompt, adapter, maxSteps? })— wrap a whole agent as one MCP tool. The host calls it with atask; the agent runs server-side on the given adapter and returns the result ("agents as MCP tools").fetchAgentSkill(id, fetchImpl?)— fetch a registry agent's runnable skill (hosted index, raw-GitHub fallback);nullfor tool-composing agents. An optional third argument controls abort, timeout, and response-byte limits.
#Bin
agentskit-mcp — npx @agentskit/mcp --tools fetch,search. Expose whole agents
with --agents <ids> --provider <p> (any of ~20 providers + catalog OpenAI-compatible). Flags: --tools,
--fs-root, --sqlite, --allow-shell, --model, --max-steps, --api-key,
--base-url. Unknown, duplicate, or valueless flags fail closed. stdout is the
JSON-RPC channel; diagnostics and help go to stderr.
#Beta boundaries
- Tool names are unique and follow the current MCP 1–128 character interoperability grammar.
- Server configuration and agent-tool configuration fail with typed AgentsKit diagnostics.
- Published tool definitions are snapshotted; observer failures cannot alter protocol behavior.
- Agent tasks, step counts, prompts, descriptions, registry IDs, request time, and response bytes are bounded.
- Registry source is treated as data and never executed.
- The built-in surface is the MCP tools subset over stdio or an injected transport. HTTP/WebSocket, resources, prompts, sampling, auth, rate limiting, and persistence are host responsibilities.
#Minimal example
import { createAgentsKitMcpServer } from '@agentskit/mcp'
import { fetchUrl } from '@agentskit/tools'
createAgentsKitMcpServer({ tools: [fetchUrl()] })#Related packages
- @agentskit/tools — the tools you expose + the MCP primitives.
- @agentskit/core — the
ToolDefinitioncontract.