Skip to main content

MCP Integration

The Model Context Protocol (MCP) standardizes how agents talk to tools. StateBase can be used two ways with MCP:
  1. StateBase as a tool server — expose session state, memory, and traces to any MCP client (Claude, Cursor, custom agents).
  2. StateBase as the memory layer for MCP-based agents — your MCP tools write checkpoints and read context through StateBase, so every tool interaction is durable.

StateBase as an MCP Tool Server

Expose StateBase primitives over MCP so any capable agent can persist and recall state:
Run it with any MCP client:

Using StateBase as Memory for MCP Agents

Standard MCP pattern, hardened with durable state:
Every tool call the agent makes becomes recoverable — roll back a bad tool sequence instead of restarting the whole conversation.

Tutorial

For a full step-by-step MCP server build, see the Agentic RAG pattern for retrieval agents, or the Long-Running pattern for agents that wait on MCP tools.

Next Steps