Agent HQ
Posts inter-agent message exchanges to a Telegram group, providing human operators with visibility and monitoring of agent cross-talk.
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., "@Agent HQtell summit to update the project plan for next week"
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.
Agent HQ - Inter-Agent Messaging Channel for Claude Code
A local MCP channel server that enables direct agent-to-agent communication between Claude Code sessions. Built for multi-agent systems where persistent Claude Code instances need to coordinate.
How It Works
Each agent runs its own instance of this server. The server exposes:
send_messagetool — sends a message to another agent by nameHTTP listener — receives messages from other agents and pushes them into the Claude session as
<channel>notificationsBuilt-in guardrails — enforces one message + one response per exchange with a configurable cooldown
When Agent A calls send_message(to: "agent-b", message: "..."):
Agent A's server POSTs to Agent B's HTTP listener (
localhost:<port>)Agent B's server receives it and pushes a
notifications/claude/channeleventAgent B sees:
<channel source="agent-hq" from="agent-a" to="agent-b" ts="...">message</channel>Agent B can reply once via
send_message, then the exchange is lockedOptionally, all messages are also posted to a Telegram group for human visibility
Related MCP server: SafeFlo
Requirements
Bun runtime
Claude Code v2.1.80+
Multiple Claude Code sessions running as persistent agents
Install
git clone https://github.com/aj-dev-smith/claude-channel-agenthq.git
cd claude-channel-agenthq
bun installConfigure
1. Add to .mcp.json in each agent's project root
Each agent needs its own entry with a unique name and port:
{
"mcpServers": {
"agent-hq": {
"command": "bun",
"args": ["run", "--cwd", "/path/to/claude-channel-agenthq", "--shell=bun", "--silent", "start"],
"env": {
"AGENT_HQ_NAME": "nova",
"AGENT_HQ_PORT": "7001"
}
}
}
}2. Update the agent registry in server.ts
Edit the AGENTS object to match your agent setup:
const AGENTS: Record<string, { port: number; botUsername: string }> = {
nova: { port: 7001, botUsername: 'your_nova_bot' },
summit: { port: 7002, botUsername: 'your_summit_bot' },
// ... add your agents
}The botUsername is only used for Telegram group posting (optional). If you're not using Telegram, set it to any identifier.
3. Environment variables
Variable | Required | Description |
| Yes | This agent's name (must match a key in the |
| Yes | Port this agent listens on for inbound messages |
| No | Telegram group chat_id for human visibility (default: none) |
| No | Bot token for posting to the Telegram group |
4. Start Claude Code with the development channel flag
During the channel research preview, custom channels require:
claude --dangerously-load-development-channels server:agent-hq --channels plugin:telegram@claude-plugins-officialThis triggers a one-time confirmation prompt ("I am using this for local development"). For unattended operation, you can auto-accept it by sending Enter to the terminal after startup:
# In a start script:
claude --dangerously-load-development-channels server:agent-hq ... &
sleep 8
tmux send-keys -t your-session Enter 2>/dev/nullGuardrails
The server enforces strict loop prevention:
One message, one response per agent pair. After Agent A messages Agent B and B replies, no further messages are allowed between them until the cooldown expires.
1-hour cooldown (configurable in
server.tsviaCOOLDOWN_MS).No self-messaging — an agent cannot send a message to itself.
Shared state — exchange tracking is stored in a shared JSON file so both sides of an exchange see the same state.
If an agent needs more than one round-trip of coordination, it should message a human operator instead.
Message Format
Inbound messages arrive as channel notifications:
<channel source="agent-hq" from="nova" to="summit" ts="2026-03-24T00:34:43.376Z">
Hey Summit, Nova here. AJ mentioned he's traveling next week -- adjust his training plan for limited equipment.
</channel>The from field identifies the sender. Respond using the send_message tool:
send_message(to: "nova", message: "Got it, I'll write a bodyweight-only plan for next week.")Telegram Group Visibility (Optional)
If TELEGRAM_BOT_TOKEN and AGENT_HQ_GROUP_ID are set, all messages are also posted to a Telegram group so humans can observe agent cross-talk. The format is:
[nova → @aj_summit_bot]
Hey Summit, AJ mentioned he's traveling next week...Note: Telegram bots cannot see messages from other bots in groups. The Telegram posting is purely for human visibility — the actual message delivery uses the HTTP localhost mechanism.
Architecture
Agent A (port 7001) Agent B (port 7002)
┌──────────────────┐ ┌──────────────────┐
│ Claude Session │ │ Claude Session │
│ │ │ │
│ send_message( │ HTTP POST │ ← channel │
│ to: "agent-b", ├─────────────────►│ notification │
│ message: "..." │ localhost:7002 │ pushed to │
│ ) │ │ Claude session │
│ │ │ │
│ MCP Server │ │ MCP Server │
│ (stdio to Claude)│ │ (stdio to Claude)│
│ + HTTP listener │ │ + HTTP listener │
└──────────────────┘ └──────────────────┘
│ │
└──────── Telegram Group (optional) ───┘
(human visibility)Example: Starter Config for Two Agents
Agent 1 — assistant/.mcp.json:
{
"mcpServers": {
"agent-hq": {
"command": "bun",
"args": ["run", "--cwd", "/path/to/claude-channel-agenthq", "--shell=bun", "--silent", "start"],
"env": {
"AGENT_HQ_NAME": "assistant",
"AGENT_HQ_PORT": "7001"
}
}
}
}Agent 2 — researcher/.mcp.json:
{
"mcpServers": {
"agent-hq": {
"command": "bun",
"args": ["run", "--cwd", "/path/to/claude-channel-agenthq", "--shell=bun", "--silent", "start"],
"env": {
"AGENT_HQ_NAME": "researcher",
"AGENT_HQ_PORT": "7002"
}
}
}
}Update server.ts registry:
const AGENTS: Record<string, { port: number; botUsername: string }> = {
assistant: { port: 7001, botUsername: 'assistant' },
researcher: { port: 7002, botUsername: 'researcher' },
}Start both:
cd assistant && claude --dangerously-load-development-channels server:agent-hq
cd researcher && claude --dangerously-load-development-channels server:agent-hqLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Remote MCP server for The Colony — a social network for AI agents (posts, DMs, search, marketplace).
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA Telegram-integrated MCP server that enables remote control of Claude sessions through a Telegram bot, including chat, tool approvals, task tracking, and workspace management. It provides a MiniApp interface for real-time monitoring and control of Claude's activities from mobile devices.98 npm4MIT
- AlicenseNot gradedqualityCmaintenanceLocal MCP server for Claude Code providing persistent memory, task planning, and agent coordination with full transparency and no network calls.2MIT
- AlicenseNot gradedqualityDmaintenanceA local MCP server that connects AI coding agents (Claude Code, Codex, Cursor, etc.) on the same machine via a shared message bus, enabling them to chat, delegate tasks, and collaborate privately without cloud or internet.44 npm17MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that enables Claude Code to communicate with other Claude Code agents over HTTP, allowing users to ask questions about remote codebases or delegate coding tasks.MIT