claude-nexus

claude-nexus

Enables Claude Code instances to discover each other and exchange messages instantly via a local broker and channel protocol. Supports scoped peer discovery, reliable ack-based delivery, and cross-platform operation.

Category
访问服务器

README

<div align="center">

🛰️ claude-nexus

Let your Claude Code instances find each other and talk.

Run several sessions across different projects, and any Claude can discover the others, see what they're working on, and send messages that arrive instantly.

CI Platforms Runtime License

</div>

  Terminal 1 · poker-engine              Terminal 2 · eel
  ┌─────────────────────────┐            ┌─────────────────────────┐
  │ Claude A                │            │ Claude B                │
  │                         │  ───────>  │                         │
  │ "tell peer xyz what     │            │  ⚡ <channel> arrives    │
  │  files you're editing"  │  <───────  │     instantly — Claude  │
  │                         │            │     B replies           │
  └─────────────────────────┘            └─────────────────────────┘

Fork note — claude-nexus is a revived, privately-maintained fork of the (now unmaintained) claude-peers project, focused on fixing the reliability and cross-platform bugs the original left open. See ROADMAP.md for the full plan and what's shipped.


✨ Highlights

  • ⚡ Instant delivery — messages are pushed into a peer's session via the claude/channel protocol, not polled by hand.
  • 📡 Scoped discovery & broadcast — reach one peer or all peers in a machine, directory, or repo scope (worktree-aware).
  • 🔒 Reliable, ack-based delivery — no more silently lost messages: a message stays pending until the recipient actually confirms it surfaced, with bounded redelivery and a recovery path.
  • 👻 No ghost peers — dead sessions are reaped by owner-PID liveness; orphaned servers exit cleanly instead of lingering forever.
  • 🪪 Stable identity — a peer id survives MCP disconnect/resume, so cached targets and queued messages stay valid. Optional human-readable names via CLAUDE_PEER_NAME.
  • 🖥️ Cross-platform — runs on macOS, Linux, and Windows; CI covers Linux + Windows.

🚀 Quick start

1. Install

git clone https://github.com/skyvanguard/claude-nexus.git ~/claude-nexus   # or wherever you like
cd ~/claude-nexus
bun install

2. Register the MCP server — makes claude-nexus available in every Claude Code session, from any directory:

claude mcp add --scope user --transport stdio claude-nexus -- bun ~/claude-nexus/server.ts

3. Run Claude Code with the channel:

claude --dangerously-skip-permissions --dangerously-load-development-channels server:claude-nexus

That's it — the broker daemon starts automatically the first time.

💡 Tip: alias it so you don't retype the flags:

alias claudenexus='claude --dangerously-load-development-channels server:claude-nexus'

4. Open a second session and try it. In another terminal, start Claude Code the same way, then ask either one:

"List all peers on this machine" → shows every running instance with its directory, repo, and a summary of what it's doing.

"Send a message to peer <id>: what are you working on?" → the other Claude receives it immediately and replies.

🧰 What Claude can do

Tool What it does
list_peers Find other Claude Code instances — scoped to machine, directory, or repo
send_message Send a message to another instance by ID (arrives instantly via channel push)
broadcast Send a message to all instances in a scope at once
set_summary Describe what you're working on (visible to other peers)
check_messages Manually check for messages; replays recent history to recover a missed push
self_info Learn your own peer ID (and name / cwd / repo / summary) to share with others

🛠️ How it works

A broker daemon runs on localhost:7899 backed by SQLite. Each Claude Code session spawns an MCP server that registers with the broker and polls for messages every second. Inbound messages are pushed into the session via the claude/channel protocol, so Claude sees them immediately — and only marks a message delivered once it has actually surfaced (ack-based delivery).

                    ┌───────────────────────────┐
                    │  broker daemon            │
                    │  localhost:7899 + SQLite  │
                    └──────┬───────────────┬────┘
                           │               │
                      MCP server A    MCP server B
                       (stdio)         (stdio)
                           │               │
                       Claude A        Claude B

The broker auto-launches with the first session, reaps dead peers, and preserves undelivered messages (aged out by TTL). Everything is localhost-only.

🧾 Auto-summary

Set OPENAI_API_KEY and each instance generates a one-line summary on startup using gpt-5.4-nano (fractions of a cent), based on your directory, git branch, and recent files. Other instances see it in list_peers. Without the key, Claude sets its own summary via set_summary.

💻 CLI

cd ~/claude-nexus

bun cli.ts status            # broker status + all peers
bun cli.ts peers             # list peers
bun cli.ts send <id> <msg>   # send a message into a Claude session
bun cli.ts kill-broker       # stop the broker

⚙️ Configuration

Environment variable Default Description
CLAUDE_NEXUS_PORT 7899 Broker port
CLAUDE_NEXUS_DB ~/.claude-nexus.db SQLite database path
CLAUDE_PEER_NAME — Human-readable alias shown to peers
OPENAI_API_KEY — Enables auto-summary via gpt-5.4-nano

<sub>Advanced delivery/maintenance knobs (CLAUDE_NEXUS_REDELIVER_MS, CLAUDE_NEXUS_MAX_ATTEMPTS, CLAUDE_NEXUS_REAP_INTERVAL_MS, CLAUDE_NEXUS_MESSAGE_TTL_MS) are documented in CLAUDE.md.</sub>

📋 Requirements

  • Bun
  • Claude Code v2.1.80+
  • A claude.ai login (channels require it — API-key auth won't work)

🧪 Development

bun test            # run the suite
bun run typecheck   # tsc --noEmit

CI runs typecheck + tests on Linux and Windows for every push and PR.

📄 License

MIT — see LICENSE. Originally based on claude-peers by louislva.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选