Contextgraph
Shared memory bus for MCP-compatible agents with permissions, subscriptions, and optional payments.
What is Contextgraph?
Contextgraph is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to shared memory bus for mcp-compatible agents with permissions, subscriptions, and optional payments.
Shared memory bus for MCP-compatible agents with permissions, subscriptions, and optional payments.
This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Shared memory bus for MCP-compatible agents with permissions
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx contextgraphConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Contextgraph
ContextGraph is a governed shared memory backend and MCP server designed for coding agents and multi-agent teams that need durable, structured context across sessions and context-window compaction events. Instead of losing state to a vague summary, ContextGraph records structured events (decisions, constraints, open tasks, failures, file changes) and compiles token-budgeted delta packs that allow agents to resume from an exact structured state. It also provides governed retrieval with provenance, freshness tracking, and ACL-based access control, making it suitable for teams that need auditable, shared memory across multiple AI agents.
Prerequisites
- Python 3.11 or higher installed
- Git to clone the repository
- Optional: Neo4j database for persistent storage (in-memory local mode works without it)
- An MCP-compatible client such as Claude Code or Claude Desktop
- pip or uv package manager
Clone the repository and install
Clone the ContextGraph repository and install it with the server, MCP, and development extras.
git clone https://github.com/AllenMaxi/ContextGraph.git
cd ContextGraph
pip install -e ".[server,mcp,dev]"Install the SDK separately (for client usage)
If you only need the thin client SDK without running the server locally, install just the SDK package. Use the [local] extra to enable the LocalTransport for in-process testing.
pip install contextgraph-sdk
# Or with local transport:
pip install contextgraph-sdk[local]Run the quickstart example
Verify the installation by running the beta quickstart, which stores a governed memory, adds a trust signal, and recalls it from another agent.
python3 examples/beta_quickstart.pyStart the server
Start the ContextGraph HTTP server to enable the dashboard and HTTP API in addition to MCP access. The server starts on port 8000 by default.
python -m contextgraph.serverConfigure the MCP server in your client
Register the ContextGraph MCP server with your MCP-compatible client. The server exposes tools such as contextgraph_compile_context for building governed context packs.
Contextgraph Examples
Client configuration
Add this block to your claude_desktop_config.json to connect Claude to a locally running ContextGraph MCP server.
{
"mcpServers": {
"contextgraph": {
"command": "python",
"args": ["-m", "contextgraph.mcp_server"],
"env": {
"CONTEXTGRAPH_API_KEY": "cgk_your_api_key_here"
}
}
}
}Prompts to try
Once connected, use these prompts to manage agent memory through Claude.
- "Store a memory that the payment service REST API must remain backward compatible"
- "Recall any memories related to latency issues in the EU region"
- "Checkpoint the current session state before we lose context"
- "Compile a context pack with the top 5 most trusted recent decisions"
- "Show me all open tasks from the last coding session checkpoint"Troubleshooting Contextgraph
Import errors when running server or examples
Ensure you installed with the correct extras: pip install -e ".[server,mcp,dev]". The bare pip install -e . does not include the server or MCP dependencies.
MCP tools not appearing in Claude or recall returning empty results
Confirm the ContextGraph server process is running before starting Claude. Check the server logs for startup errors, particularly around Neo4j connectivity if you configured an external backend.
Context packs are too large or hit token budget limits
Use the token_budget parameter when calling the compile_context tool to cap the pack size. ContextGraph will prioritize the most trusted and freshest claims within the budget.
Frequently Asked Questions about Contextgraph
What is Contextgraph?
Contextgraph is a Model Context Protocol (MCP) server that shared memory bus for mcp-compatible agents with permissions, subscriptions, and optional payments. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Contextgraph?
Follow the installation instructions on the Contextgraph GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Contextgraph?
Contextgraph works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Contextgraph free to use?
Yes, Contextgraph is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Contextgraph Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to Contextgraph? Here are other popular knowledge & memory servers you can use with Claude, Cursor, and VS Code.
MemPalace
★ 52.6kA local AI memory system that stores all conversations verbatim and organizes them into navigable structures. It provides 19 MCP tools for AI assistants to search and retrieve past decisions, debugging sessions, and architecture debates automatically
Kratos
★ 25.7k🏛️ Memory System for AI Coding Tools - Never explain your codebase again. MCP server with perfect project isolation, 95.8% context accuracy, and the Four Pillars Framework.
Context Mode
★ 15.4kAn MCP server that preserves LLM context by intercepting large data outputs and returning only concise summaries or relevant sections. It enables efficient sandboxed code execution, file processing, and documentation indexing across multiple programm
Memu
★ 13.7kMemory for 24/7 proactive agents like OpenClaw.
MemOS
★ 9.3kMemOS (Memory Operating System) is a memory management operating system designed for AI applications. Its goal is: to enable your AI system to have long-term memory like a human, not only remembering what users have said but also actively invoking, u
Everos
★ 5.4kBuild, evaluate, and integrate long-term memory for self-evolving agents.
Browse More Knowledge & Memory MCP Servers
Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Contextgraph in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Contextgraph?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.