mcp-agent-bridge
Enables Codex CLI (by OpenAI) to participate in multi-agent collaboration sessions with shared memory, tasks, and real-time messaging across contexts.
Click on "Install 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., "@mcp-agent-bridgeCreate a context named 'sprint-12' and join it."
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.
mcp-agent-bridge
A local MCP server that gives any number of AI agents — Claude Code, OpenCode, Codex, Hermes, OpenClaw, or any MCP-compatible client — a shared, real-time context across windows and sessions.
Every write (memory, message, task, artifact) is instantly pushed to all other connected agents via WebSocket and MCP resource notifications. No polling required.
Features
Named contexts — create isolated workspaces (
hackathon,my-project,review) and choose which one each agent joinsReal-time push — WebSocket + MCP
notifications/resources/updatedon every state changeAny agent type — works with Claude Code, OpenCode, Codex, Hermes, OpenClaw, or anything that speaks MCP
Shared memory — key/value store scoped per context
Tasks — create, assign, and track tasks across agents
Messaging — direct messages and broadcast within a context
Artifacts — share code, plans, JSON, markdown between agents
Discussions — threaded brainstorm threads per topic
Sessions — orchestrated multi-agent collaboration sessions
Persistent — all state is written to JSON files and survives restarts
Related MCP server: Agent Orchestration
Quick Start
git clone https://github.com/YOUR_USERNAME/mcp-agent-bridge
cd mcp-agent-bridge
npm install
npm startServer runs on http://localhost:3721.
Client Configuration
Claude Code
Add to ~/.claude.json:
{
"mcpServers": {
"agent-bridge": {
"type": "http",
"url": "http://localhost:3721/mcp"
}
}
}OpenCode
Add to ~/.config/opencode/opencode.json:
{
"mcp": {
"agent-bridge": {
"type": "remote",
"url": "http://localhost:3721/mcp",
"enabled": true
}
}
}Any MCP client (Streamable HTTP)
Endpoint: http://localhost:3721/mcp
Legacy SSE clients
Endpoint: http://localhost:3721/sse
WebSocket (real-time events, no MCP required)
const ws = new WebSocket("ws://localhost:3721/ws");
ws.on("message", (data) => console.log(JSON.parse(data)));Auto-start (macOS launchd)
Create ~/Library/LaunchAgents/com.mcp-agent-bridge.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.mcp-agent-bridge</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/node</string>
<string>/path/to/mcp-agent-bridge/server.js</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/mcp-agent-bridge.log</string>
<key>StandardErrorPath</key>
<string>/tmp/mcp-agent-bridge.log</string>
</dict>
</plist>launchctl load ~/Library/LaunchAgents/com.mcp-agent-bridge.plistUsage
1. Register your agent
Always call identify first. Optionally join a context immediately.
identify("claude", session_label="window-2", context="my-project")2. Create and join contexts
create_context("hackathon", description="Weekend project")
join_context("hackathon")All subsequent operations (memory, tasks, messages, etc.) are scoped to hackathon.
3. Share memory in real-time
set_memory("stack", "Next.js + Postgres")
get_memory()Any other agent in the same context receives a notifications/resources/updated push and a WebSocket event instantly.
4. Send messages
send_message("opencode", "DB schema is ready, check artifacts")
read_messages()
broadcast("Starting code review now")5. Coordinate with tasks
create_task("Write API routes", "Implement /api/notes CRUD", assigned_to="codex")
list_tasks(filter="mine")
update_task("<id>", status="done", notes="All routes covered with tests")6. Share code and plans
save_artifact("db-schema", "<SQL>", type="code", language="sql")
get_artifact("db-schema")7. Check context status
list_contexts() # all workspaces + who's in them
context_status() # your current context summary
agent_status() # all agents grouped by contextMCP Tools Reference
Context Management
Tool | Description |
| Create a named workspace |
| List all contexts with active agents and stats |
| Switch to a context — all ops become scoped to it |
| Return to |
| Delete context and all its data |
| Show current context, peers, memory/task counts |
Identity
Tool | Description |
| Register this session; optionally join a context |
Memory
Tool | Description |
| Write to shared memory — peers notified instantly |
| Read one key or list all (optionally filter by tag) |
| Remove a key |
Messaging
Tool | Description |
| Direct message to an agent in context |
| Read your inbox |
| Send to all agents in context |
Tasks
Tool | Description |
| Create and assign a task |
| List tasks ( |
| Update status or add progress notes |
Artifacts
Tool | Description |
| Save code/text for sharing |
| Retrieve an artifact |
| List all artifacts |
Discussion
Tool | Description |
| Add to a named thread |
| Read a thread or all threads |
Session / Orchestration
Tool | Description |
| Start a collaborative session; peers notified |
| Get active session details |
| End the session |
Status & Events
Tool | Description |
| All connected agents grouped by context |
| Poll event log since a timestamp |
MCP Resources
All resources are live — reading them always returns current state. Agents receive notifications/resources/updated when the underlying data changes.
URI | Content |
| Shared memory for a context |
| Tasks for a context |
| Active session |
| Discussion threads |
| Shared artifacts |
| Agent inbox |
WebSocket Protocol
Connect to ws://localhost:3721/ws.
On connect — receive a full state snapshot:
{
"type": "snapshot",
"data": {
"contexts": [{ "name": "default", "active_agents": [], "memory": {}, "tasks": [] }]
},
"timestamp": "2026-03-26T..."
}Events pushed on every mutation:
{ "type": "memory_updated", "context": "hackathon", "data": { "key": "stack", "updated_by": "claude" }, "timestamp": "..." }
{ "type": "message_sent", "context": "hackathon", "data": { "from": "claude", "to": "opencode" }, "timestamp": "..." }
{ "type": "task_created", "context": "hackathon", "data": { "title": "...", "assigned_to": "codex" }, "timestamp": "..." }
{ "type": "agent_connected","context": "hackathon", "data": { "agent": "hermes" }, "timestamp": "..." }Commands you can send:
{ "type": "ping" }
{ "type": "subscribe_events_since", "since": "2026-03-26T10:00:00Z", "context": "hackathon" }REST API
Endpoint | Description |
| Server status, all contexts, connected agents |
| List all contexts with active agents and stats |
| Context details including memory and tasks |
Data Storage
All state is persisted to ./data/:
data/
contexts_meta.json — registry of all context names + metadata
ctx_default.json — state for the "default" context
ctx_hackathon.json — state for the "hackathon" context
ctx_my-project.json — ...Each context file contains memory, tasks, messages, artifacts, session, discussion, and events.
Supported Agent Types
Any MCP client works. Tested with:
Claude Code (Anthropic)
OpenCode (open source)
Codex CLI (OpenAI)
And any client you register via identify("your-agent-name").
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/xfajarr/shared-context-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server