AgentLink

AgentLink

Encrypted conversation bridge between two local coding agents, enabling goal negotiation and read-only findings exchange via MCP.

Category
访问服务器

README

AgentLink

CI License: MIT

AgentLink is an encrypted persistent bridge between two local coding agents. It lets Codex and Claude sessions owned by different people request read-only findings from each other's local environments while each owner keeps control of their own machine.

AgentLink does not call a model API. Each agent continues to run through its owner's existing Codex or Claude subscription and local GUI/CLI client.

Status: experimental v0.3. Use it for trusted peer collaboration and review the security notes before exposing a relay outside a private network.

Why AgentLink

Two developers often have access to different repositories, databases, or environments. Instead of copying context manually, each local agent can inspect only the resources available on its owner's machine and send the minimum necessary natural-language result to the peer.

  • No coordinator agent and no shared machine.
  • Messages look like normal user messages to both agents.
  • A blocking request suspends the asking tool call without generating model tokens.
  • The responder leaves peer_listen, performs local read-only work, replies, and listens again.
  • A permanent MCP installation hot-reloads .agent-link/active.json; new rooms do not require a GUI restart.
  • Completing one structured goal leaves the encrypted transport connected for later questions.
  • The remote peer never receives direct access to local files, terminals, databases, or tools.

Architecture

Codex / Claude A                                       Codex / Claude B
       |                                                       |
       | stdio MCP                                      stdio MCP |
       v                                                       v
 local AgentLink bridge <--- encrypted WebSocket relay ---> local AgentLink bridge
       |                                                       |
       v                                                       v
 local read-only tools                                  local read-only tools

The relay stores ciphertext and delivery metadata. Message contents are encrypted end to end with AES-256-GCM and signed with per-agent Ed25519 identities.

The wire format and state machine are documented in Protocol.

Client behavior

Client Waiting model
Codex Desktop peer_ask remains pending while the responder handles the request; peer_listen wakes on an inbound request.
Claude Desktop Uses the same request/listen cycle. A new idle GUI chat cannot currently be awakened by standard MCP.
Claude Code Experimental channel mode can deliver an inbound event to a background session.

For GUI-to-GUI use, start one task in each application once. Keep the responder task inside peer_listen; it returns to the model only when work arrives.

Requirements

  • Node.js 20 or newer
  • Git
  • Codex Desktop, Claude Desktop, or Claude Code
  • One free ngrok account and authtoken for the temporary relay owner

Quick start: two machines, temporary link

No deployment, domain, port forwarding, VPN, or separate ngrok installation is required. The ngrok SDK is installed by npm ci and the public endpoint exists only while the host command is running.

1. Clone on both machines

git clone https://github.com/Oryntai/AgentLink.git
cd AgentLink
npm ci

2. The initiator hosts

Get a free token from the ngrok dashboard, set it only in the current terminal, and start AgentLink:

$env:NGROK_AUTHTOKEN = "your-token"
npm run host -- --agent alice-codex --name "Alice Codex" --client codex

In Windows Command Prompt use set "NGROK_AUTHTOKEN=your-token"; on macOS or Linux use export NGROK_AUTHTOKEN="your-token". AgentLink starts the local relay, opens the encrypted WebSocket tunnel, activates .agent-link/active.json, installs the permanent MCP, and prints one join command.

Keep this terminal open and send the printed command privately to the peer owner. It contains the room secret.

3. The peer joins

Run the printed command from the cloned repository. For example:

npm run join -- --url "wss://temporary.ngrok.app/ws" --code "ROOM_CODE" --agent bob-claude --name "Bob Claude" --client claude-desktop

Valid clients are codex, claude-desktop, and claude for Claude Code. The join command activates the responder config and installs MCP automatically.

4. One final restart, then hot reload

After the first AgentLink v0.3 installation, fully quit and restart each GUI once so it discovers the permanent MCP. Future host, join, and new-session commands update active.json and switch the already running MCP in place. Press Ctrl+C in the host terminal when the persistent link is no longer needed.

Optional relay modes

For an always-on public relay, deploy the included render.yaml or Dockerfile. For a private relay, use Tailscale. For a one-machine test, run:

./scripts/start-relay.ps1

Then use the advanced create-room and join-room commands with ws://127.0.0.1:8787/ws. See Remote setup for permanent and private alternatives.

For Claude Code's experimental background channel, add --channel to host or join, then launch:

claude --dangerously-load-development-channels server:agent-link

Persistent questions during normal work

Start one responder task and keep it alive with this instruction:

Use AgentLink as a persistent responder. Keep peer_listen pending. For every request, inspect only the necessary local files or database data with read-only tools, call peer_respond with the supplied request ID, then immediately call peer_listen again. Never disclose credentials or unrelated data. Do not end this task until your owner tells you to stop.

An agent doing ordinary feature work can ask the peer at any point:

Use peer_ask to ask the AgentLink peer which requirements apply to this feature. Wait for its read-only finding, then continue the implementation.

The asking MCP call stays pending without model generation. The responder's peer_listen returns the question, the responder performs local reads outside AgentLink, and peer_respond completes the original call. Request IDs prevent simultaneous questions from consuming the wrong answer.

Structured planning sessions

peer_goal, peer_exchange, and peer_complete remain available when both agents need an explicit goal and success criteria. Completing that goal returns the link to an idle persistent state instead of closing its WebSocket.

For the next temporary conversation, stop the old host with Ctrl+C, run npm run host again, and have the peer run the newly printed npm run join command.

When using an always-on relay, rotate the room without replacing the local identity. The initiator generates the code:

npm run new-session -- .agent-link\alice-codex.json

The responder privately receives that code and installs it into the existing local config:

npm run new-session -- --code "ROOM_CODE" .agent-link\bob-claude.json

The permanent MCP hot-reloads the rotated session. No GUI or task restart is required.

Prompt the initiator:

Use AgentLink. Check peer_status, propose one concrete final conversation goal through peer_goal, and wait for acceptance. Discuss the task through peer_exchange in radio style. Use local read-only operations only and disclose no secrets. Once every success criterion is satisfied, propose mutual completion through peer_complete. Do not end this task while the peer conversation is active.

Prompt the responder:

Use AgentLink as the responder. Wait for the proposed goal through peer_goal, accept or reject it explicitly, and use only local read-only operations. Reply with the minimum necessary result and never disclose credentials or unrelated data. Verify all success criteria before accepting peer_complete.

Security model

  • AES-256-GCM encrypts message contents and authenticates envelope metadata.
  • Ed25519 signs every envelope.
  • An HMAC proof binds each public identity key to the room secret.
  • Replay IDs survive local MCP process restarts.
  • Relay rooms, pending messages, and logs have quotas, TTLs, and rotation.
  • Sensitive local JSONL fields are encrypted with a key derived from the local identity key.
  • ROOM_CODE, active.json, identity keys, state, trust files, logs, and reports live under .agent-link/, which is ignored by Git.

AgentLink transports text; it cannot technically force a local agent to use read-only tools. Enforce read-only behavior with the prompt, client approvals, sandbox configuration, and least-privilege database credentials.

The relay can observe connection metadata and message sizes. AgentLink does not currently provide forward secrecy. Read SECURITY.md before production use.

Operations

npm run doctor
npm run report:all
npm run smoke
./scripts/stop-relay.ps1

Readable reports are generated only on explicit request under .agent-link/reports/. The source JSONL logs keep sensitive message fields encrypted.

Development

npm ci
npm run smoke

Coding-agent instructions are in AGENTS.md. Contributions are welcome; see CONTRIBUTING.md.

Release history is recorded in CHANGELOG.md.

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选