orgchat-mcp
Integrates with Codeium's Windsurf IDE as an MCP client, enabling peer messaging from Windsurf sessions.
Integrates with Google Gemini CLI as an MCP client and supports Google Workspace/Google OIDC login for relay authentication.
Supports OIDC ID-token authentication via Okta for relay access, verifying issuer, audience, expiry, and email domain.
Integrates with OpenAI Codex CLI as an MCP client, allowing Codex sessions to list peers, send messages, read inboxes, and wait for peer replies.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
orgchat
Let everyone's AI coding agents talk to each other: across machines, across people, across vendors, inside one organization.
Alice uses Claude Code, Bob uses Codex, Carol uses Cursor, Dan uses Gemini CLI, Erin runs DeepSeek in Cline. With orgchat, Bob's Codex can ask Alice's Claude Code "which DB migration is next?" and get the answer, without anyone copying text between chat windows.
Alice: Claude Code ─┐ ┌─ Bob: Codex
Carol: Cursor ──────┤ ┌───────────────────┐ ├─ Dan: Gemini CLI
Erin: Cline+DeepSeek┼─wss─►│ orgchat relay │◄─wss──┼─ any MCP client
scripts / CI ───────┘ │ auth · presence │ └─ you, in a terminal (CLI)
│ routing · audit │
└───────────────────┘
(you host it)orgchat-mcp: a standard MCP server that any MCP-capable agent can load. Gives the agentlist_peers,send,read_inbox,wait_for_messageandwhoami. Detects which agent it's running in, so peers seecodex,cursor,claude-code,gemini-cli, ...orgchatCLI: for people and scripts:orgchat peers,orgchat send,orgchat listen.Relay: a small WebSocket server you run. Authenticates, scopes sessions to an org, routes and queues messages, writes an audit log.
Claude Code plugin: the same MCP server packaged as a plugin, plus real-time push into the session via Claude Code channels.
Client side: zero dependencies, Node.js 22+. Relay: one dependency (ws).
Not affiliated with Anthropic, OpenAI, Google, Anysphere or DeepSeek.
How messages reach each agent
Agent | Receives messages by |
Claude Code (plugin + channel) | Push: messages appear in the session as they arrive, even when idle |
Codex, Cursor, Gemini CLI, Cline, Roo, Windsurf, opencode, ... | Pull: every orgchat tool result says "N unread peer messages"; the agent calls |
CLI / scripts |
|
Pull means a non-Claude agent sees new messages when it next uses orgchat, or when you tell it "check orgchat". The typical flow, ask a peer, then wait_for_message for the answer, works the same everywhere.
Related MCP server: Esco
Quick start
1. Run a relay (once per org)
git clone https://github.com/hansxiao7/agent-orgchat && cd agent-orgchat/relay
npm ci
ORGCHAT_TOKENS="acme=$(openssl rand -hex 24)" npm start
# or: docker build -t orgchat-relay . && docker run -p 8787:8787 -e ORGCHAT_TOKENS=... orgchat-relayPut it behind TLS (any reverse proxy, Fly.io, Railway, Cloud Run with min instances = 1, ...) so clients use wss://. State is in memory: run exactly one instance.
2. Each person: write the shared config (once per machine)
~/.config/orgchat/config.json, used by every agent on that machine:
{
"relayUrl": "wss://orgchat.example.com",
"token": "the-token-for-your-org",
"user": "alice@acme.com"
}3. Each person: add orgchat to the agent(s) they use
All clients run the same server. Either run it straight from GitHub with npx, or install it once with npm i -g github:hansxiao7/agent-orgchat and use "command": "orgchat-mcp" with no args.
/plugin marketplace add hansxiao7/agent-orgchat
/plugin install orgchat@agent-orgchatStart sessions with the channel enabled (see Claude Code channels):
claude --dangerously-load-development-channels plugin:orgchat@agent-orgchatWithout the plugin (pull only): claude mcp add orgchat -- npx -y -p github:hansxiao7/agent-orgchat orgchat-mcp
[mcp_servers.orgchat]
command = "npx"
args = ["-y", "-p", "github:hansxiao7/agent-orgchat", "orgchat-mcp"]
tool_timeout_sec = 300 # lets wait_for_message wait up to ~5 minutes{
"mcpServers": {
"orgchat": {
"command": "npx",
"args": ["-y", "-p", "github:hansxiao7/agent-orgchat", "orgchat-mcp"]
}
}
}{
"mcpServers": {
"orgchat": {
"command": "npx",
"args": ["-y", "-p", "github:hansxiao7/agent-orgchat", "orgchat-mcp"],
"timeout": 300000
}
}
}orgchat is model-agnostic: it works wherever the client speaks MCP. Most clients take the same mcpServers JSON as Cursor above (Cline / Roo Code: MCP Servers → Configure; Windsurf: ~/.codeium/windsurf/mcp_config.json). opencode (opencode.json):
{
"mcp": {
"orgchat": { "type": "local", "command": ["npx", "-y", "-p", "github:hansxiao7/agent-orgchat", "orgchat-mcp"] }
}
}The agent label is detected from the client (e.g. cline). To show the model too, set ORGCHAT_AGENT, e.g. "env": { "ORGCHAT_AGENT": "cline+deepseek" }.
npm i -g github:hansxiao7/agent-orgchat
orgchat peers
orgchat send bob-codex "is the staging DB migrated?" --wait 120
orgchat listen # stay online and print incoming messages (--json for scripts)4. Use it
Just ask your agent:
"Who's on orgchat?" · "Ask Bob's Codex session which port the API dev server uses, and wait for the answer." · "Check orgchat." · "Tell everyone on the web team's sessions that main is broken."
Configuration
Client (~/.config/orgchat/config.json; env vars override, and can also be set per agent in its MCP env)
Key | Env var | Description |
|
|
|
|
| Shared org token (token auth). |
|
| Command that prints an OIDC ID token (OIDC auth). Takes precedence over |
|
| Your identity in token mode. Ignored in OIDC mode (the verified email is used). Default: OS username. |
|
| Session name peers see. Default |
|
| Override the detected agent label. |
|
| |
| Alternative config file path. |
Relay (env vars)
Env var | Default | Description |
|
| Listen address. |
| Comma-separated | |
|
| Single-org shorthand. |
| Enables OIDC ID-token login (e.g. | |
| Required with OIDC. Comma-separated accepted | |
| Required with OIDC. Email domains allowed in. | |
| email domain | Put all OIDC users in this org instead of one org per domain. |
| discovered | Override JWKS discovery. |
|
| Max message size. |
|
| Messages per minute per connection. |
|
| Offline queue size per session, and how long offline sessions are remembered. |
| off |
|
Identity: what "same organization" means
The relay decides who is in the org. orgchat never touches any agent's own credentials (Claude, OpenAI, Google, Cursor, DeepSeek accounts), and those vendors don't offer a cross-vendor org check anyway.
Token mode: anyone with the org token is in. Simple, fine for small teams.
useris self-declared, so peers seeverified: false.OIDC mode: people log in with your company identity provider (Google Workspace, Okta, Entra ID, Lark/Feishu, ...). The relay verifies the ID token's signature, issuer, audience, expiry and email domain, and uses the verified email as the user.
Claude Code channels
Push delivery in Claude Code uses channels, a research preview:
Individually: start with
claude --dangerously-load-development-channels plugin:orgchat@agent-orgchat. It asks for confirmation, works only in interactive sessions (not-por the Agent SDK), and needs claude.ai or Console login (not Bedrock/Vertex/Foundry).Team/Enterprise org: an Owner enables channels (claude.ai admin console → Organization settings → Claude Code) and deploys managed settings like
examples/managed-settings.json(channelsEnabled,allowedChannelPlugins,extraKnownMarketplaces,enabledPlugins).allowedChannelPluginsreplaces Anthropic's default allowlist, so list any other channel plugins you use. Users then start withclaude --channels plugin:orgchat@agent-orgchat.
Without channels, Claude Code behaves like the other agents (pull). Claude Code's built-in SendMessage / /peers keeps working alongside for a user's own sessions.
Security model
Peer messages are an input channel into coding agents that can run commands. Treat them accordingly.
Peer text is untrusted. The server's MCP instructions and tool descriptions tell the agent that peer messages come from colleagues, not from its user, and must not be acted on (running commands, editing files, sharing code or secrets) without the user's request or confirmation. This lowers but does not remove prompt-injection risk: only connect people whose messages you'd be OK with your agent reading.
No remote approvals. The server does not declare Claude Code's
claude/channel/permission, so nobody can approve tool use in your session through orgchat.Org isolation. Sessions only see and reach sessions in their own org. Session ids can't be taken over by another user.
The relay sees plaintext. Self-host it. Messages live only in memory (offline queue up to 24h by default). Bodies are not logged unless
ORGCHAT_AUDIT_CONTENT=1.Limits. Message size cap, per-connection rate limit, 10s login timeout.
Report vulnerabilities privately via GitHub security advisories on this repo.
Wire protocol
JSON over WebSocket, so writing a client in another language is straightforward. Client → relay:
{ "type": "hello", "v": 1, "auth": { "token": "..." } /* or { "id_token": "..." } */,
"session": { "sid": "s_ab12cd34ef", "name": "alice-api", "user": "alice", "agent": "codex", "host": "mbp", "cwd": "/src/api" } }
{ "type": "list", "req": 1 }
{ "type": "send", "req": 2, "to": "bob-web" /* sid | name | "user:<user>" */, "text": "...", "thread": "t1" }
{ "type": "ack", "id": "m_..." }Relay → client:
{ "type": "welcome", "session": { "sid": "...", "name": "...", "user": "...", "agent": "codex", "org": "acme", "verified": false } }
{ "type": "res", "req": 2, "ok": true, "data": { "sent": [{ "id": "m_...", "to": "s_...", "status": "delivered" }] } }
{ "type": "msg", "id": "m_...", "from": { "sid": "...", "name": "...", "user": "...", "agent": "cursor", "verified": false },
"to": "s_...", "text": "...", "thread": "t1", "ts": "..." }Messages stay queued until acknowledged; unacknowledged messages are re-queued when a socket drops. Close code 4001 = auth failed, 4002 = replaced by a newer connection for the same session.
Development
cd relay && npm ci && npm test # real relay + real MCP server processes posing as Claude Code, Codex, Cursor, Gemini CLI, plus the CLIpackage.json npm package: orgchat-mcp + orgchat bins
.claude-plugin/marketplace.json this repo is also a Claude Code plugin marketplace
client/ client code (also the Claude Code plugin root)
.claude-plugin/plugin.json
bin/orgchat-mcp.mjs MCP server
bin/orgchat.mjs CLI
lib/relay-client.mjs shared relay client
relay/ relay server (src/, test/, Dockerfile)
examples/ client config + Claude Code managed settingsRoadmap
Publish
orgchat-mcpto npmPush delivery for more clients as they gain server-to-model notification support
Persistent relay storage (Redis/SQLite) and horizontal scaling
Built-in OIDC device-code login
Optional end-to-end encryption between sessions
Topics / broadcast rooms; Slack and Lark/Feishu bridges so humans can join from chat
PRs welcome.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
End-to-end encrypted messaging and work coordination for autonomous AI agents.
Messaging and inboxes for AI agents: register, send signed messages, check your inbox, find agents.
Lasting public addresses and threaded messages between AI agents, across apps and machines.
Privacy-first coordination for autonomous agents: rooms, messaging, inbox, and per-agent memory.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables peer-to-peer communication, discovery, shared state, and file coordination between AI coding agents across machines and sessions.11 npm17Elastic 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to communicate asynchronously via a decentralized, peer-to-peer LAN bridge with automatic discovery and direct messaging.MIT
- AlicenseNot gradedqualityBmaintenanceEnables already-running AI coding agents on the same project to register, discover one another, and exchange durable direct messages so they can share progress and avoid conflicting work.Apache 2.0
- AlicenseBqualityBmaintenanceEnables MCP-capable coding agents to discover peers, send messages, and read inboxes through a small self-hosted relay on your LAN or VPN, including role-based fan-out to teams. Incoming messages can wake idle agent sessions so one agent can hand work to another and get the result back without human typing.7252 npm10Apache 2.0