claude-intercom

claude-intercom

Enables real-time messaging between Claude Code instances, allowing agents to send, receive, and reply to messages instantly via file-based communication with auto-notification.

Category
Visit Server

README

πŸ“‘ claude-intercom

Real-time messaging between Claude Code instances. When one agent sends a message, the others get it instantly β€” no polling, no manual checks.

Built as an MCP server + filesystem watcher that wakes idle agents automatically via asyncRewake.

How it works

Terminal 1                          Terminal 2
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ claude (agent sgup)  β”‚            β”‚ claude (agent 4jov)  β”‚
β”‚                      β”‚            β”‚                      β”‚
β”‚ > send("4jov",       β”‚ ──JSON──▢ β”‚ πŸ“¬ sgup: tu touches  β”‚
β”‚   "tu touches        β”‚   file    β”‚    auth.ts ?          β”‚
β”‚    auth.ts ?")       β”‚            β”‚                      β”‚
β”‚                      β”‚ ◀──JSON── β”‚ > reply("Non,        β”‚
β”‚ πŸ“¬ 4jov: Non,        β”‚   file    β”‚   je suis sur        β”‚
β”‚   je suis sur billingβ”‚            β”‚   billing")          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Each instance gets a unique 4-char code (e.g. x7k2) on startup
  • Messages are JSON files in a shared store/ directory
  • A fs.watch watcher detects new files instantly and wakes the receiving agent
  • Dead agents are auto-cleaned via PID checking

Install

# Clone
git clone https://github.com/sanztheo/claude-intercom.git ~/.claude/mcp-intercom

# Install deps
cd ~/.claude/mcp-intercom && bun install

1. Register the MCP server

Add to ~/.mcp.json:

{
  "mcpServers": {
    "intercom": {
      "type": "stdio",
      "command": "bun",
      "args": ["~/.claude/mcp-intercom/src/server.ts"]
    }
  }
}

2. Add the auto-notification hooks

Add to ~/.claude/settings.json under "hooks":

{
  "hooks": {
    "PreToolUse": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bun ~/.claude/mcp-intercom/src/hook.ts",
            "timeout": 3000
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bun ~/.claude/mcp-intercom/src/watcher.ts",
            "asyncRewake": true,
            "timeout": 300000
          }
        ]
      }
    ],
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bun ~/.claude/mcp-intercom/src/watcher.ts",
            "asyncRewake": true,
            "timeout": 300000
          }
        ]
      }
    ]
  }
}

3. (Optional) Add the skill

Copy skill/SKILL.md to ~/.claude/skills/intercom/SKILL.md so agents proactively coordinate.

MCP Tools

Tool Description
who List active agents (filtered by project by default)
send Send a message to an agent or broadcast to "all"
reply Reply to a message (auto-acks the original)
peek Check inbox for unread messages
ack Acknowledge and delete a message
ack_all Clear entire inbox

Auto-notification

Three layers ensure agents never miss a message:

Layer When How
Watcher (SessionStart + Stop) Agent is idle fs.watch on inbox dir β†’ exit(2) β†’ asyncRewake wakes the model
Hook (PreToolUse) Agent is working Checks inbox before every tool call
Skill (always active) Agent makes decisions Guides agent to announce work and check messages

Architecture

~/.claude/mcp-intercom/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ server.ts    # MCP server β€” 6 tools, auto-generated agent codes
β”‚   β”œβ”€β”€ store.ts     # Filesystem store β€” presence, messages, sessions
β”‚   β”œβ”€β”€ hook.ts      # PreToolUse hook β€” checks inbox on every tool call
β”‚   └── watcher.ts   # fs.watch β€” instant detection, asyncRewake push
β”œβ”€β”€ skill/
β”‚   └── SKILL.md     # Always-active skill for proactive coordination
└── store/           # Runtime data (gitignored)
    β”œβ”€β”€ presence/    # {code}.json β€” agent registration + PID
    β”œβ”€β”€ messages/    # {code}/*.json β€” per-agent inboxes
    └── sessions/    # {pid}.code β€” PID-to-agent-code mapping

Session linking (how the hook finds "its" agent)

The MCP server and hooks both run as children of the same Claude Code process. On startup, the server writes its agent code to sessions/{pid}.code for each PID in its ancestor chain. The hook walks up its own ancestor chain and matches against these files β€” the common ancestor (Claude Code) is the link.

Requirements

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured