MCP Integration Roadmap
Not a released package
@invariant-tech/mcp is reserved for a future release. It is not part of the current repository or Beta package set. Do not install or import it today.
Applications can build their own bridge with @modelcontextprotocol/sdk and @invariant-tech/sdk. That bridge is application code, not an Invariant-provided recovery or transport guarantee.
Recommended Custom Bridge
Expose a small stable tool surface and route every request through a durable Session:
| Tool | SDK operation |
|---|---|
get_state | An application projection |
start_workflow | agent.handleAction(session, invocation) |
submit_input | agent.handleAction(session, invocation) |
cancel_workflow | agent.handleAction(session, invocation) |
ts
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
const server = new Server(
{ name: "invariant-application-bridge", version: "1.0.0" },
{ capabilities: { tools: {} } },
);
server.setRequestHandler(ListToolsRequestSchema, async () => ({
tools: [
{
name: "start_workflow",
description: "Start one application-approved workflow",
inputSchema: {
type: "object",
properties: {
workflowId: { type: "string" },
input: { type: "object" },
},
required: ["workflowId"],
},
},
{
name: "submit_input",
description: "Submit input to the active wait boundary",
inputSchema: {
type: "object",
properties: { payload: { type: "object" } },
required: ["payload"],
},
},
],
}));The request handler must authenticate the caller, resolve an allowed Session, normalize the tool call to an AgentActionInvocation, and return the resulting AgentActionResult. Do not execute the action and then call session.snapshot() to describe its consequence: another action could advance the Session first.
Accepted results include the exact SettledExecution caused by the tool call plus boundaryView (revision, presentation, application projection, and current action surface) from the same committed frame. Rejected results omit execution and return the unchanged current boundaryView. MCP serialization preserves equal values, not JavaScript object identity.
Store/network/Host exceptions remain MCP operational errors; they must not be converted into a synthetic { status: "accepted", execution: { status: "failed" } } response.
Planned Package Scope
A future @invariant-tech/mcp package may standardize:
- stable tool declarations,
- Session lookup and action normalization,
- projection-shaped tool results,
- transport-level error mapping,
- trace integration.
These items are roadmap, not current guarantees.
Next Steps
- Agents & Action Authority — Validate proposals against fresh runtime state.
- Projections — Return consumer-specific read models.
- Sessions — Load durable continuity before handling a tool call.