Skip to main content
Glama
AgentRadio MCP

AgentRadio MCP

AgentRadio MCP (Python)

一个 Python MCP 服务器,为 Cursor 代理提供 AgentRadio 原语 — create_thread、send_message、wait_for_mention — 让不同工作区中的代理能够通过共享的无线电信道处理同一个问题。

这是 Coral-Protocol/AgentRadio(论文)通信层的 Python 移植版。它不运行 Java coral-server.jar 或 Harbor 实验框架。它在每个 Cursor 工作区都能看到的共享 SQLite 存储上实现了同样的三个原语,外加 join/list/read。

为什么存在

AgentRadio 的核心理念是:代理应该在监听的同时继续工作。原论文使用的是后台 wait_for_mention 进程。Cursor 无法以相同方式暴露该监视器,因此该服务器:

  1. 将这些原语公开为 Cursor 代理可以调用的 MCP 工具。

  2. 跨工作区共享状态(一个 SQLite 文件,或一个 HTTP hub)。

  3. 通过 MCP 指令告诉每个代理在工作步骤之间轮询 wait_for_mention。

两个 Cursor 窗口 — 例如 frontend 和 backend — 加入同一频道,打开一个规划线程,并在继续编码的同时传递发现。

Related MCP server: swarm-mcp

安装

cd agentradio-mcp
python3 -m pip install -e .

需要 Python 3.10+ 和 mcp 1.21–1.x。

共享频道的两种方式

A. 同一台机器,多个工作区(最简单)

每个工作区运行自己的 stdio MCP 进程。它们都打开 ~/.agentradio/radio.db,因此能看到相同的线程。

在每个工作区的 .cursor/mcp.json 中放入不同的 AGENTRADIO_AGENT_ID:

{
  "mcpServers": {
    "agentradio": {
      "command": "python3",
      "args": ["-m", "agentradio_mcp"],
      "env": {
        "AGENTRADIO_AGENT_ID": "frontend",
        "AGENTRADIO_CHANNEL": "my-app",
        "AGENTRADIO_WORKSPACE": "web"
      }
    }
  }
}

在另一个工作区中,使用 "backend" / "api"。保持 AGENTRADIO_CHANNEL 相同。

将 cursor-rules/agentradio.mdc 复制到每个工作区,命名为 .cursor/rules/agentradio.mdc,这样代理才会真正使用无线电。

B. 一个 HTTP hub(当多个工作区共享一个配置时最佳)

启动单个进程:

python3 -m agentradio_mcp --http --host 127.0.0.1 --port 8765

或 examples/start-hub.sh。

然后每个工作区(或你的用户级 ~/.cursor/mcp.json)都可以使用相同的配置:

{
  "mcpServers": {
    "agentradio": {
      "url": "http://127.0.0.1:8765/mcp"
    }
  }
}

每个代理使用自己的 agent_id 调用 join_radio。这就是一个共享的 MCP URL 仍然具有不同身份的方式。

Cursor 设置 → MCP → 添加服务器,然后重新加载 MCP。

工具

工具

功能

join_radio(agent_id, workspace?)

在频道上注册此工作区。如果未设置 AGENTRADIO_AGENT_ID,请先调用此工具。

list_agents

谁在频道上(以及谁已过期)。

create_thread(name, participants?)

打开一个命名的会话。参与者为空 = 当前已加入的所有人。

send_message(thread_id, content, mentions?)

附加一条消息并立即返回。文本中的 @handles 算作提及。提及某人会将其加入线程。

wait_for_mention(timeout_ms=15000)

阻塞直到你被提及、出现任何新的可见消息或超时。始终返回完整的状态转储。

read_state

你可以看到的代理、线程和消息的快照。

leave_radio

将此代理标记为已断开连接。历史记录保留。

资源:agentradio://state、agentradio://protocol。

代理应如何工作

  1. 以 frontend / backend / agent-1 / … 身份调用 join_radio。

  2. list_agents — 等待同伴,或启动一个他们会加入的线程。

  3. 继续工作。在步骤之间,调用 wait_for_mention(8–15 秒)或 timeout_ms=0。

  4. 随时分享。以 FYI:(无需回复)、URGENT:(立即处理)开头。

  5. 在长上下文之后,使用 read_state 并从真实消息中复制证据。

可选的五阶段协议(来自论文)包含在 MCP 指令中:探索 → 分工直至 APPROVE → 使用工作日志执行 → 审查 → 汇编者仅在一致 APPROVE 后提交。

CLI

python3 -m agentradio_mcp                  # stdio (what Cursor launches)
python3 -m agentradio_mcp --http           # hub at http://127.0.0.1:8765/mcp
python3 -m agentradio_mcp --dump-state frontend

环境变量 / 标志

默认值

含义

AGENTRADIO_DB_PATH / --db

~/.agentradio/radio.db

共享的 SQLite 文件

AGENTRADIO_CHANNEL / --channel

default

房间名称(隔离团队)

AGENTRADIO_AGENT_ID

未设置

在首次调用工具时自动加入此 id

AGENTRADIO_WORKSPACE

cwd 基名

显示在 list_agents 中的标签

AGENTRADIO_HOST / --host

127.0.0.1

HTTP 绑定地址

AGENTRADIO_PORT / --port

8765

HTTP 端口

测试

python3 -m pip install -e ".[dev]"
python3 -m pytest

这不是什么

  • 不是 SWE-Atlas / Harbor 四代理实验运行器。

  • 不是 Coral Code(该产品)。

  • 不是让隔离的云 VM 相互通信的方式,除非它们能访问同一个 HTTP hub 或 SQLite 路径。对于云代理,请在一个它们都能访问的主机上运行 hub,并将每个代理的 MCP url 指向它。

许可证

Apache-2.0。参见 LICENSE 和 NOTICE。

Available Tools

7 tools
create_threadC

Open a named conversation. Empty participants includes everyone currently joined.

Inputs: name (required), participants.

join_radioA

Register this Cursor workspace on the shared AgentRadio channel.

Use a stable agent_id per workspace (frontend, backend, mobile, agent-1). Other workspaces see you via list_agents after this call.

Inputs: agent_id (required), workspace.

leave_radioA

Mark this agent disconnected. Messages and threads stay on the channel.

Inputs: no named parameters.

list_agentsA

List every agent that has joined this channel, including offline ones.

Inputs: no named parameters.

read_stateA

Full snapshot of agents, threads, and messages this agent can see.

Inputs: no named parameters.

send_messageA

Append a message and return immediately. Mentions wake those agents' wait_for_mention.

Inputs: content (required), thread_id (required), mentions.

wait_for_mentionA

Wait until you are mentioned, a new visible message arrives, or timeout_ms elapses.

The payload always includes the full channel state. After it returns, keep working and call again between steps (Cursor has no background watcher).

Inputs: timeout_ms, wake_on_any_new_message.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 7 tools

    Disambiguation4/5

    Each tool targets a distinct action (join, leave, list, create, send, wait, read_state). Minor overlap exists between read_state and wait_for_mention since both expose channel state, but one is a blocking wait and the other is an immediate snapshot. create_thread and send_message could be confused regarding whether creating a thread implies an initial message.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern: join_radio, leave_radio, list_agents, create_thread, send_message, wait_for_mention, read_state. No mixed conventions or vague verbs.

    Tool Count5/5

    Seven tools is well-scoped for an agent radio channel: lifecycle (join/leave), discovery (list_agents), conversation (create_thread/send_message), reactive waiting (wait_for_mention), and state inspection (read_state). Each tool earns its place without redundancy.

    Completeness4/5

    The core channel workflow is covered: join, leave, list participants, create threads, send messages, wait for mentions, and read state. Minor gaps include no explicit way to leave a thread or retrieve only a specific thread's messages, but read_state provides full visibility so agents can work around these.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server that lets multiple coding-agent sessions on the same machine discover each other and collaborate through a shared SQLite database.
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for inter-agent communication. Gives multiple Claude Code sessions a shared message board, agent registry, and orchestration layer — backed by a cloud relay so agents can coordinate across machines, repos, and teams.
      8
      51 npm
      1
      MIT