AgentMailbox
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AgentMailboxretrieve my context from last session"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AgentMailbox
Cut your AI agent's context tokens by 90%. One command to set up. Zero config files to edit.
π Website Β· βοΈ Cloud API Β· π Docs
The Problem
Every time an AI agent starts a task, it re-reads your entire codebase to understand where to make changes. For a 10,000-file repo, that's 200,000+ tokens per session β just to figure out the architecture.
Multiply that by 50 developers, each running multiple agents daily:
Without AgentMailbox | With AgentMailbox | |
Tokens per session start | ~200,000 | ~5,000β15,000 |
Daily cost (50 devs) | ~$47/day | ~$3.50/day |
Session start latency | 30β60 seconds | 2β5 seconds |
Context across restarts | β Lost | β Persistent |
Agent-to-agent messaging | β Custom plumbing | β Built-in |
Related MCP server: CacheTank MCP Server
How It Works
AgentMailbox is a context-sync protocol for AI agents. It sits beneath your agent framework and provides:
Codebase Indexing β A CI bot statically analyzes your code (zero LLM cost) and pushes ~40-token summaries per file to the server. Agents read summaries instead of raw source.
Knowledge Graph β Agents persist relationships (files β symbols β decisions) that survive restarts and are searchable by any agent.
Smart Briefings β When an agent starts a task, it calls
session_start("Add OAuth")and gets back a targeted JSON briefing with relevant files, stale-file warnings, and architecture context.Async Messaging β Agents leave messages for each other in threads (TO/CC/BCC), enabling parallel multi-agent workflows without blocking.
Quick Start β One Command
npx agentsmcp initThat's it. The wizard:
Detects your MCP clients (Claude Desktop, Cursor, Continue)
Opens GitHub login in your browser β one click to authorize
Writes the config to each client (backs up existing configs first)
Done. Restart your MCP client.
Scripted / CI-friendly:
# Fully unattended β GitHub OAuth
npx agentsmcp init --yes --github --all
# Use an existing API key
npx agentsmcp init --api-key sk_live_xxx --all
# Just one client
npx agentsmcp init --api-key sk_live_xxx --client cursorAfter restart, your agent has all 24 MCP tools available β persistent memory, async messaging, codebase search, and more.
Platform Integration Guides
Add to Settings β MCP β Add (or let npx agentsmcp init do it):
{
"mcpServers": {
"agentsmcp": {
"command": "npx",
"args": ["-y", "agentsmcp"],
"env": {
"AGENTSMCP_AGENT_ID": "cursor@local",
"AGENTSMCP_SERVER": "https://hdnxa5c8yr.us-east-1.awsapprunner.com",
"AGENTSMCP_API_KEY": "sk_live_YOUR_KEY"
}
}
}
}Add to ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"agentsmcp": {
"command": "npx",
"args": ["-y", "agentsmcp"],
"env": {
"AGENTSMCP_AGENT_ID": "claude@desktop",
"AGENTSMCP_SERVER": "https://hdnxa5c8yr.us-east-1.awsapprunner.com",
"AGENTSMCP_API_KEY": "sk_live_YOUR_KEY"
}
}
}
}claude mcp add agentsmcp -- npx -y agentsmcpSet environment variables:
AGENTSMCP_AGENT_ID=claude-code@local
AGENTSMCP_SERVER=https://hdnxa5c8yr.us-east-1.awsapprunner.com
AGENTSMCP_API_KEY=sk_live_YOUR_KEYnpx skills add RagavRida/agentsmcpSame config shape: command: npx, args: ["-y", "agentsmcp"] with the three env vars: AGENTSMCP_AGENT_ID, AGENTSMCP_SERVER, AGENTSMCP_API_KEY.
Python
pip install agentsmcpfrom agentmailbox import AgentMailbox
agent = AgentMailbox(
agent_id="my-agent@app",
server="https://hdnxa5c8yr.us-east-1.awsapprunner.com",
api_key="sk_live_YOUR_KEY",
)
# Send & receive
await agent.send("other-agent@app", {"task": "analyze data"})
messages = await agent.receive()
# Context graph
await agent.upsert_node(id="file:main.py", type="file", name="main.py",
description="Entrypoint")
result = await agent.query_graph("main")
# Codebase index
await agent.upsert_index(key="file:main.py", category="file",
summary="FastAPI entrypoint with lifespan handlers")
hits = await agent.search_index("FastAPI", category="file")JavaScript / TypeScript
npm install agentsmcpimport { AgentMailbox } from "agentsmcp";
const agent = new AgentMailbox({
agentId: "my-agent@app",
server: "https://hdnxa5c8yr.us-east-1.awsapprunner.com",
apiKey: "sk_live_YOUR_KEY",
});
await agent.send("other@app", { task: "done", result: data });
const { messages } = await agent.receive();
// Context graph
await agent.upsertNode({ id: "file:server.ts", type: "file", name: "server.ts" });
const { nodes, edges } = await agent.queryGraph("server");
// Codebase index
await agent.upsertIndex({ key: "api:POST /invoke", category: "api",
summary: "Invokes the compiled graph" });
const hits = await agent.searchIndex("invoke", "api");LangGraph
npm install agentsmcp-langgraph @langchain/langgraphimport { AgentsmcpSaver } from "agentsmcp-langgraph";
const checkpointer = new AgentsmcpSaver({
server: "https://hdnxa5c8yr.us-east-1.awsapprunner.com",
agentId: "langgraph@my-app",
apiKey: "sk_live_YOUR_KEY",
});
await checkpointer.connect();
const graph = workflow.compile({ checkpointer });
await graph.invoke(input, { configurable: { thread_id: "session-abc" } });Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Agents β
β Claude Desktop β Cursor β Python Script β LangGraph β
ββββββββββ¬ββββββββββ΄βββββ¬ββββββ΄ββββββββ¬ββββββββββ΄ββββββββ¬βββββββββ
β MCP β MCP β SDK β Saver
βΌ βΌ βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AgentMailbox Server β
β ββββββββββββ βββββββββββββ ββββββββββββ ββββββββββββββββ β
β β Messagingβ β Knowledge β β Codebase β β Context β β
β β Threads β β Graph β β Index β β Compression β β
β ββββββββββββ βββββββββββββ ββββββββββββ ββββββββββββββββ β
β ββββββββββββ βββββββββββββ βββββββββββββββββββββββββββββββββ
β βRate Limitβ β GitHub β β Multi-tenant Scoped Storage ββ
β β& Auth β β OAuth β β SQLite (local) β Postgres ββ
β ββββββββββββ βββββββββββββ βββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
ββββββΌβββββ ββββββΌβββββ
β SQLite β (single dev, zero config) βPostgres β (cloud, multi-tenant)
βββββββββββ βββββββββββMCP Tools (24 tools)
Category | Tool | What it does |
Session |
| Smart context briefing β graph + index + stale detection |
| Targeted briefing for a specific task | |
Messaging |
| Send a message to another agent |
| Get unread messages with full thread context | |
| Reply to all participants on a thread | |
| Mark a thread as read | |
| List all threads | |
| Sync full context for a thread | |
| Peek at unread without consuming | |
| Get participants and roles | |
Graph |
| Persist a knowledge graph node |
| Connect two nodes with a typed edge | |
| Keyword search + N-hop traversal | |
Index |
| Register/update a codebase summary |
| Exact-key lookup | |
| Keyword search with category filter | |
| Batch hash check for stale files | |
| Aggregate file summaries into modules | |
Git |
| Create a commit |
| View staged/unstaged changes | |
| View commit history | |
| Branch operations | |
Annotations |
| Add inline code annotations |
| Read annotations for a file |
Self-Hosted
Free, unlimited, MIT-licensed. SQLite by default, Postgres when you need it.
# SQLite (zero config)
npx agentsmcp-server
# Postgres
AGENTSMCP_DB=postgresql://user:pass@localhost:5432/agentsmcp \
npx agentsmcp-server
# With auth
AGENTSMCP_API_KEY=your-secret npx agentsmcp-server
# With LLM compression
ANTHROPIC_API_KEY=sk-ant-xxx npx agentsmcp-serverSee deploy/AWS.md for a Docker + App Runner walkthrough.
Free Tier (Cloud)
Resource | Limit |
Agents | 10 |
Messages / day | 500 |
Threads | 100 |
Retention | 7 days |
API keys | 2 |
Need more? Self-host for unlimited β same code, MIT licensed.
API Reference
Method | Endpoint | Description |
POST |
| Sign up, get API key |
POST |
| GitHub OAuth login |
GET |
| Your account + usage |
GET |
| List active API keys |
POST |
| Mint an additional key |
DELETE |
| Revoke a key |
POST |
| Register an agent |
POST |
| Send message (TO/CC/BCC) |
POST |
| Reply to all participants |
GET |
| List threads |
GET |
| Unread messages + context |
POST |
| Mark thread as read |
GET |
| Thread detail |
GET |
| Assembled context frame |
GET |
| Health check |
Method | Endpoint | Description |
POST |
| Upsert a node |
DELETE |
| Delete a node + edges |
POST |
| Add a directed edge |
DELETE |
| Remove an edge |
GET |
| Search + traversal |
Method | Endpoint | Description |
POST |
| Upsert an entry |
GET |
| Keyword search |
GET |
| Exact-key lookup |
DELETE |
| Delete an entry |
POST |
| Batch hash check |
POST |
| Aggregate file summaries |
Development
# Install + type-check + test
npm ci && npx tsc --noEmit && npm test
# End-to-end smoke test
npm run smoke:e2e
# LangGraph adapter
cd langgraph && npm install && npm run build && npm test
# Python SDK
cd sdk-py && pip install -e ".[dev]" && pytest -q163 tests across 16 test files. Full matrix (JS + LangGraph + Python 3.10/3.11/3.12) runs in CI on every push.
Contributing
Contributions welcome! Particularly wanted:
Framework adapters β CrewAI, OpenAI Agents SDK, AutoGen, Vercel AI SDK
Compressor adapters β Gemini, Bedrock, Ollama (Claude and OpenAI already ship)
Storage adapters β Redis, DynamoDB (SQLite and Postgres are done)
Demos β Multi-day workflows, cross-language pipelines, agent-in-the-loop patterns
See the Contributing Guide for process details.
License
MIT β see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory for AI agents β log and recall conversation context over MCP.
Cross-tool persistent memory and context for AI assistants over MCP.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Person-owned AI memory that learns, not just stores β portable context for any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to maintain persistent memory across sessions by capturing conversations, extracting durable knowledge, and injecting relevant context, supporting various MCP-compatible platforms.12MIT
- AlicenseAqualityFmaintenanceProvides persistent personal context (identity, projects, decisions, knowledge) to MCP-compatible AI tools, eliminating the need to re-explain yourself across sessions.251 npm1MIT
- AlicenseBqualityDmaintenanceProvides persistent memory, reasoning engine, agent-to-agent sharing, and immutable audit trail for AI agents via the Model Context Protocol.12MIT
- AlicenseNot gradedqualityBmaintenancePersistent memory for AI agents over the Model Context Protocol (MCP).MIT