/** * mcp/server.ts — Claude Code MCP server exposing Bizar tools. * * Claude Code loads these third-party tools through the Model Context * Protocol (MCP). This file * exports a single `createBizarMcpServer()` factory that wraps every * Bizar tool (plans, loops, graph, and learning) as an * MCP `tool()` definition, bundled into an SDK MCP server via the * `@anthropic-ai/claude-agent-sdk` `createSdkMcpServer()`. * * Usage from the SDK: * * import { createBizarMcpServer } from "@polderlabs/bizar-sdk/mcp"; * import { query } from "@anthropic-ai/claude-agent-sdk"; * * for await (const msg of query({ * prompt: "Find the graph path to the sandbox command", * options: { * mcpServers: { bizar: createBizarMcpServer() }, * allowedTools: ["mcp__bizar__*"], * }, * })) { * handleAgentMessage(msg); * } * * The MCP server can also be registered in `~/.claude/settings.json` * (via `mcpServers` key) or `.mcp.json` so every Claude Code session * picks it up automatically. * * The retained registry covers planning, bounded loops, graph queries, * and compact learning summaries. */ export interface SdkMcpToolDef { name: string; description: string; inputSchema: unknown; handler: (args: Args, extra?: unknown) => Promise<{ content: Array<{ type: "text"; text: string; }>; isError?: boolean; structuredContent?: unknown; }>; annotations?: Record; } export interface SdkMcpServerConfig { name: string; version: string; tools: SdkMcpToolDef[]; [k: string]: unknown; } /** * Build a single MCP tool definition with a zod-less validator. This * avoids taking a hard dep on zod at SDK-level; the installer wraps this with real zod validation when wiring into * `tool()`. */ export declare function defineTool(name: string, description: string, inputSchema: Record, handler: (args: Args) => Promise<{ content: Array<{ type: "text"; text: string; }>; isError?: boolean; structuredContent?: unknown; }>, annotations?: Record): SdkMcpToolDef; export declare const BIZAR_TOOLS: SdkMcpToolDef[]; /** * Build the Bizar MCP server config. Pass this into Claude Code's * `mcpServers` option or `.mcp.json`. * * { * "mcpServers": { * "bizar": { "command": "npx", "args": ["-y", "@polderlabs/bizar", "mcp"] } * } * } * * The standalone `bin.ts` CLI wrapper (in this package) does the * real wiring against `@anthropic-ai/claude-agent-sdk`'s * `createSdkMcpServer()` so that the MCP server can also be run as a * stdio process and picked up by `claude mcp add`. */ export declare function createBizarMcpServerConfig(opts?: { name?: string; version?: string; }): SdkMcpServerConfig; /** * Build and return an `McpSdkServerConfigWithInstance` from the real * SDK. This is the runtime path used by `bin.ts`. * * Pass `sdk` (the result of `await import("@anthropic-ai/claude-agent-sdk")`) * to avoid taking a hard dependency on the SDK from this package. */ export declare function createBizarMcpServer(sdk: { tool: (...args: unknown[]) => unknown; createSdkMcpServer: (cfg: Record) => unknown; }, opts?: { name?: string; version?: string; }): unknown; export declare function getBizarMcpToolSummary(): Array<{ name: string; description: string; }>; //# sourceMappingURL=server.d.ts.map