StateWeave MCP Server

git for agent brains.

README.md

๐Ÿงถ StateWeave

git for agent brains. When your agent goes wrong, see exactly where and why. Then rewind.

StateWeave is git for agent brains โ€” debug, time-travel, and migrate agent state across 10 frameworks. When a 20-step autonomous workflow derails at step 15, see exactly what changed, rewind to step 14, and replay. Export from LangGraph, import into CrewAI with zero data loss. Checkpoint, rollback, diff, encrypt, sign โ€” all through a single Universal Schema.

When your agent hallucinates, crashes, or drifts โ€” stateweave why shows you the exact state transition that went wrong. When your enterprise needs to audit agent behavior, every state change is versioned, signed, and encrypted.

Why StateWeave?

StateWeave solves three critical problems in the AI agent ecosystem:

๐Ÿ” Debugging โ€” Agent workflows are non-deterministic. When they go wrong, you need to pause, rewind, inspect, and replay โ€” not restart. stateweave why shows you the exact state transition that caused the failure. Version control for agent cognition.

๐Ÿ”’ Security โ€” Agent state contains the agent's entire cognitive history. StateWeave encrypts at rest (AES-256-GCM), signs payloads (Ed25519), strips credentials on export, and enforces compliance policies.

๐Ÿ”„ Portability โ€” Every framework has persistence, none have portability. StateWeave's Universal Schema โ€” a canonical representation of agent cognitive state โ€” lets you move state between any of 10 frameworks. One schema, N adapters, zero data loss (with explicit warnings for anything non-portable).

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  LangGraph  โ”‚     โ”‚    MCP      โ”‚     โ”‚   CrewAI    โ”‚     โ”‚   AutoGen   โ”‚
โ”‚   Adapter   โ”‚     โ”‚   Adapter   โ”‚     โ”‚   Adapter   โ”‚     โ”‚   Adapter   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚                   โ”‚                   โ”‚                   โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ”‚
                   โ”‚                   โ”‚                           โ”‚
                   โ–ผ                   โ–ผ                           โ–ผ
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
            โ”‚              ๐Ÿงถ  Universal Schema v1                     โ”‚
            โ”‚                                                          โ”‚
            โ”‚  conversation_history  ยท  working_memory  ยท  goal_tree   โ”‚
            โ”‚  tool_results_cache  ยท  trust_parameters  ยท  audit_trail โ”‚
            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Star topology, not mesh. N adapters, not Nยฒ translation pairs. Adding a new framework = one adapter, instant compatibility with everything else.

See it working

$ pip install stateweave
$ python examples/full_demo.py

โ”โ” 1. Export from LangGraph โ”โ”
  โœ“ Exported 4 messages
  โœ“ Source framework: langgraph

โ”โ” 2. Import into MCP โ”โ”
  โœ“ Imported into mcp
  โœ“ Messages preserved: 4

โ”โ” 3. Verify Round-Trip โ”โ”
  โœ“ Zero data loss: YES

โ”โ” 4. Diff Agent States โ”โ”
  Summary: 7 added, 4 removed, 7 modified

โ”โ” 5. Time Travel โ”โ”
  โœ“ Checkpoint v1 (initial-research)
  โœ“ Checkpoint v2 (after-drug-discovery)
  โœ“ Rolled back โ†’ 4 msgs

โ”โ” 6. Encryption (AES-256-GCM) โ”โ”
  โœ“ 1,733 bytes โ†’ 1,749 bytes encrypted
  โœ“ Decrypted: 4 messages intact

โ”โ” 7. Non-Portable Warnings โ”โ”
  โœ“ No non-portable warnings (clean export)

7/7 steps passed. Everything runs from PyPI.

Try it now: pip install stateweave && stateweave quickstart โ€” zero-code demo in 10 seconds.

Or run the full 7-step demo: python examples/full_demo.py

One-Command Migration

$ stateweave migrate --from langgraph --to crewai --agent my-agent

  ๐Ÿงถ StateWeave Migrate: langgraph โ†’ crewai
  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

  โ”โ” Step 1: Export from langgraph โ”โ”
    โœ“ Exported 12 messages, 5 memory keys (0.01s)

  โ”โ” Step 2: Validate payload โ”โ”
    โœ“ Payload valid โ€” all schema checks passed

  โ”โ” Step 3: Import into crewa

Tools 4

checkpointCreate a versioned snapshot of the current agent state.
rollbackRevert the agent state to a previous checkpoint.
migrateTransfer agent state between different frameworks.
diffCompare two agent states to identify changes.

Environment Variables

STATEWEAVE_ENCRYPTION_KEYKey used for AES-256-GCM encryption of agent state at rest.

Try it

โ†’Create a checkpoint for my current LangGraph agent state labeled 'pre-refactor'.
โ†’Roll back my agent to the 'initial-research' checkpoint because the last step failed.
โ†’Migrate my current agent state from LangGraph to CrewAI.
โ†’Show me the diff between my current agent state and the last saved checkpoint.

Frequently Asked Questions

What are the key features of StateWeave?

Universal Schema for agent cognitive state across 10+ frameworks. Time-travel debugging with checkpoint and rollback capabilities. Secure state handling with AES-256-GCM encryption and Ed25519 signing. Zero-data-loss migration between different agent frameworks. State diffing to identify exact transitions causing failures.

What can I use StateWeave for?

Debugging non-deterministic agent workflows by rewinding to specific failure points. Auditing enterprise agent behavior with versioned, signed, and encrypted state logs. Porting complex agent logic from one framework to another without losing memory or context. Creating safe restore points before running experimental agent tasks.

How do I install StateWeave?

Install StateWeave by running: pip install stateweave

What MCP clients work with StateWeave?

StateWeave works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep StateWeave docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare