MCP Server¶
caliper-mcp is a stdio Model Context Protocol server that gives an outside agent one tool per command of the command layer, with read-only resources, and carries each call out through Caliper API.
| Field | Value |
|---|---|
| ID | AGT-02 |
| Status | Shipped |
| Scope | Core |
| Pillar | Agents and Automation |
| Sprint | None |
| Depends On | Caliper API v0 (AGT-01) |
| Unblocks | Side Chat (AGT-03)Agent Packaging with a Bundled Python ( AGT-10)MCP Resources ( AGT-13)One Undo Step per Agent Turn ( AGT-20)Live Stream for MCP Agents ( AGT-21)Event Wait ( AGT-32)Instrument Tools ( AGT-33)Agent-Written View Demo ( SPC-25)Piece Commands ( SPC-51) |
| Docs | MCP Server |
| Branches | None |
| Design | MCP server |
Coverage Ledger¶
- Branch
sprint3-mcp, 0 commits that main lacks (63 ahead of the merge base). Work on caliper-mcp and its acceptance test, which reached main through a pull request (patch ids and subjects match). - design/acp-integration.md, under MCP servers in session/new. How an MCP server is handed to an agent in session/new, which the side chat uses to give the agent caliper-mcp.
- design/acp-integration.md, under Approvals and diffs for every agent. The origin comes from the token: api.json holds the mcp token and each agent session gets its own agent token, with stream access limited to watching.
- design/acp-integration.md, under Notes on the contracts. Notes: an agent's MCP call should wait for the user's answer with a time limit, and Codex also speaks ACP through an adapter.
- design/applet-builder.md, under Proposed design. Architecture diagram: builder pane, agent loop, command layer, MCP, spec files, spec runtime and data services.
- design/applet-builder.md, under What would need to change. 6. The agent: command layer over MCP first, then ACP, then a built-in agent only if needed.
- design/applet-builder.md, under A first slice. Command layer and catalog, a spec runtime with four primitives (series, heatmap, scatter, table), bindings to data.v1 and live views, the capture service, all over MCP.
- design/applet-builder.md, under Agent integration. MCP, ACP and BYOK answer three questions; the builder needs MCP in every case.
- design/applet-builder.md, under The options. Comparison table: MCP only, ACP client in Caliper, built-in agent (BYOK).
- design/applet-builder.md, under Order. Order: MCP first, ACP second as the main in-app path, a built-in BYOK agent only if needed.
- design/builder-overview.md, under Builder overview. The map of the builder: drop data, make loaders, build visuals by hand, with the side chat, the widget agent or an outside agent; everything built is data.
- design/builder-overview.md, under The parts. Parts diagram and table: spec format, loaders, catalog, command layer, session, caliper-mcp, side chat, widget agent, caliper-agent.
- design/builder-overview.md, under What is built. caliper-mcp against Caliper API v0 and the command endpoints.
- design/builder-pane.md, under Decisions. An agent never ends the person's running applet: an agent's spec.new, spec.open or applet.open opens the spec in the session, and F6 Dashboard on the landing returns to it.
- design/command-layer.md, under caliper-mcp and the Python sidecar. The descriptor table is the one source of tool definitions for caliper-mcp and for the widget agent's sidecar, with tool names that replace the dot by an underscore.
- design/gpu-programs.md, under Commands. Program and intervention commands use the command layer and the MCP tool table.
- design/hosted-runs.md, under Commands. Five run commands join the command layer and the MCP tool table.
- design/instrument-interface.md, under Commands. Eighteen commands for state, controls, selections, entities, annotations, the cursor and the camera join the command layer.
- design/instruments.md, under Commands. Eight new commands join the command layer and the MCP tool table.
- design/instruments.md, under Run Commands. The run commands set parameters and drive the run of a script that streams to the app.
- design/instruments.md, under Long Poll. The command events.wait holds a call until new events arrive.
- design/instruments.md, under Event Feeds. The ring feeds the journal and the MCP agents.
- design/instruments.md, under Acceptance Test. A test drives caliper-mcp against a hidden app and a script that calls caliper.watch.
- design/mcp-server.md, under What is built and what is planned. caliper-mcp, the stdio MCP server, with its protocol engine, tools derived from the command table, resources, loopback HTTP client and tests.
- design/mcp-server.md, under What is built and what is planned. The example client outside_agent.py lists the tools, reads the catalog and the open spec and adds a panel that waits on an approval card.
- design/mcp-server.md, under How it runs. caliper-mcp runs per agent session, speaks MCP on stdin and stdout, reads api.json, calls the API over loopback, and finishes running calls for 2 seconds when input ends.
- design/mcp-server.md, under Command line. Command line options --api-file, --docs, --sdk, --origin mcp|agent and --command-timeout, with exit code 2 for a missing folder or bad usage.
- design/mcp-server.md, under Configuring an agent. Setting up an outside agent needs a path, arguments and optional variables, and no token; the api.json token runs as the mcp origin so edits wait for review.
- design/mcp-server.md, under Claude Code. Configuration for Claude Code in .mcp.json, with resources referred to as @caliper:caliper://docs/...
- design/mcp-server.md, under Codex. Configuration for Codex in config.toml with tool_timeout_sec 140 so approvals do not time out.
- design/mcp-server.md, under The app's side chat. The side chat hands caliper-mcp to its agent in session/new with the agent origin and the session's own API file and token.
- design/mcp-server.md, under The protocol. Section heading for the protocol: dual-era MCP serving, JSON-RPC handling and subscriptions.
- design/mcp-server.md, under Revisions. caliper-mcp serves MCP revision 2026-07-28 and the earlier 2025-11-25 and 2025-06-18 on one connection, with server/discover.
- design/mcp-server.md, under JSON-RPC handling. Hostile-input handling of each stdin line, with bounds on size, nesting and requests in flight, and cancellation within 100 ms.
- design/mcp-server.md, under Subscriptions and list changes. Tool list change notifications for legacy and subscribing clients.
- design/mcp-server.md, under Tools. Section heading for the tools of caliper-mcp: derived from the command table.
- design/mcp-server.md, under From the command table to tools. One tool per agent-allowed command, derived at run time, with a reversible name, schemas, and read-only and destructive hints; history.undo and history.redo are left out.
- design/mcp-server.md, under Which table. The app's command table wins, falling back to the compiled-in table; a bad command is left out alone.
- design/mcp-server.md, under Calling a tool. Section heading for calling a tool.
- design/mcp-server.md, under Before anything is sent. Arguments are checked against the command's schema before sending, as command.invalid_args with where.
- design/mcp-server.md, under Where a call goes. Routing of the four v0 tools to their v0 endpoints and of every other tool to POST /v0/commands/{name}.
- design/mcp-server.md, under Results. Results come back as structured content plus text, PNGs as image blocks, app_launch relaying PENDING_APPROVAL, and output checked against the schema.
- design/mcp-server.md, under Results. The held launch answer: a launch that would replace unsaved changes answers PENDING_APPROVAL with a note so the agent checks rather than believes.
- design/mcp-server.md, under Errors. Every failure is a tool error carrying a JSON object with code, message and where.
- design/mcp-server.md, under Approval. A destructive command or a reviewed spec edit waits in the app for up to 120 seconds; there is no tool that approves; modes Ask, Accept edits and Read only apply to the mcp origin.
- design/mcp-server.md, under Reaching the app. Section heading for how caliper-mcp reaches the app: the API file and the HTTP client.
- design/mcp-server.md, under The API file. api.json holds the outside-agent token, is read strictly at every call, and is read again after a 401 or refused connection so a restarted app works.
- design/mcp-server.md, under The HTTP client. A strict HTTP/1.1 client for 127.0.0.1 only, with connect, endpoint and command time limits.
- design/mcp-server.md, under What works against API v0. What works against API v0 on sprint2: the four v0 tools only, with other tools answering mcp.no_command_layer.
- design/mcp-server.md, under Security. Security rules: token only in the Authorization header and scrubbed, loopback only, confined read-only folders, checked arguments, bounded hostile input, approval stays in the app.
- design/mcp-server.md, under Limits. Limits of caliper-mcp: 8 MiB messages, 128 nesting levels, 32 concurrent requests, 16 subscriptions, 1 MiB arguments, 130 second commands, 1024 commands.
- design/mcp-server.md, under Tests. Tests: builder_mcp unit and child-process tests, builder_mcp_acceptance against the stand-in host, and builder_mcp_app against the real app.
- design/mcp-server.md, under Results on this branch. The end-to-end test and the MCP Inspector were run on 15 November 2026 against a sprint2 app; Inspector warned about 71 type-list schemas.
- design/mcp-server.md, under Changes to the contracts. The origin agent via --origin agent, the MCP revisions served, and the capture.unavailable code.
- design/mcp-server.md, under Decisions. Decisions of the MCP server: dual-era, tool errors for model-actionable failures, JSON error text, the app's table wins, no half-close, compiled-in schema, no new dependency.
- design/mcp-server.md, under Open questions. Open: whether the command table should write nullable values with anyOf instead of a type list, for single-type dialects.
- design/roadmap.md, under Phase 3: agent-built panels. Drop data in, make loaders, build visuals by hand in a builder pane, with the side chat, the widget agent, or an outside agent over MCP; everything built is data.
- design/roadmap.md, under Phase 3: agent-built panels. The parts: command layer, loaders, catalog, spec format with seven primitives, spec applet kind, caliper-mcp, side chat, widget agent.
- design/roadmap.md, under MCP. An MCP server comes in Phase 3 beside the command layer and uses the capture service that Phase 2 adds.
- design/roadmap.md, under MCP. Use: visualising the work of any agent.
- design/roadmap.md, under MCP. Use: watching training runs.
- design/roadmap.md, under MCP. Use: running interpretability experiments automatically through the inspector's intervention API.
- design/roadmap.md, under MCP. Use: answering questions about data through caliper.data.v1.
- design/roadmap.md, under MCP. Use: making figures and screenshots for the documentation.
- design/roadmap.md, under MCP. Use: driving applets in tests.
- design/roadmap.md, under MCP. Use: explaining what is on the screen from the tour data.
design/windows-parity.mdon the branchsprint4-pr1-main2, under 8. Signing, packaging and distribution. Sign and package caliper-mcp and the agent sidecar with the app (0.5 days).- design/windows-parity.md, under 9. The builder's agents. caliper-mcp's HTTP client on Winsock, on 127.0.0.1 only.
- MCP Server, Requirements. caliper-mcp needs the app running with Caliper API on.
- MCP Server, Command Line. The command line of caliper-mcp.
- MCP Server, Agent Configuration. How to configure an outside agent to start caliper-mcp.
- MCP Server, Tools. One tool per agent-permitted command, with schema checks and permission modes.
- MCP Server, Resources. Read-only resources beside the tools.
- Pieces, Piece Commands. The piece commands and the program commands as MCP tools.
- Pieces, Piece Commands. Seven commands list, show, check, save, copy, update and remove pieces.
- Pieces, Piece Commands. program.create and program.patch take instances, and program.read reads resources.
- Pull request #17. Pull request 17 (merged) delivers sprint 3: the builder libraries, spec format, loaders, catalog, command layer and session, caliper-mcp, the side chat, the widget agent, command endpoints of Caliper API, the spec runtime and applets, the builder pane, drag and drop, approval cards and the first slice of the browser spec page.
- Orchestrators' notes,
_notes/HANDOFF-sprint3.md. Pull request 1 of sprint 3 (the builder libraries, caliper-mcp, the side chat, the widget agent, the builder pane) was pushed as PR 17 and merged into main. - Orchestrators' notes,
_notes/HANDOFF-sprint3.md. Packaging of caliper-mcp and caliper-agent with a bundled Python was deferred out of sprint 3. - Orchestrators' notes,
sprint3-integration/PR.md. caliper-mcp, a stdio MCP server whose tools mirror the commands. - Orchestrators' notes,
sprint3-integration/PR.md. Known gap: packaging of caliper-mcp and caliper-agent.