
magents
io.github.abnegate由 GitHub 账号 abnegate 发布v0.14.2更新于 Oct 25, 2026
Shared session bus for Claude, Codex, Copilot, Cursor, Gemini, AGY, Grok, and OpenCode.
概览
一个本地 MCP 服务器兼命令行工具,让一个编码代理读取、搜索、发消息并交接给同一台机器上其他代理的会话。
- 可以做什么
- 列出并查找各受支持编码代理的实时与近期会话,可按目录或分支筛选,读取精简转录或摘要,包括其他会话改动的文件以及当前连接身份。跨转录全文搜索,并搜索、读取和写入 Claude、Codex 或 Grok 的记忆笔记,另有按工作目录共享的草稿笔记。向已有聊天发送用户消息,把当前会话交接进另一个实时聊天,并通过邮箱收发回复、等待与确认。为独立任务启动新的无头持久会话,自带提示词和工作目录,并可停止受监管的会话。收集并跟踪学习状态。
- 适用场景
- 适合经常同时运行多个编码代理(Claude、Codex、Copilot、Cursor、Gemini、Grok、OpenCode 等)并在窗口之间丢失上下文的场景:可让一个代理接着另一个的工作,向指定实时聊天发消息,或为独立任务启动隔离会话。
- 运行要求
- 以本地进程运行,需 macOS 或 Linux(Claude 实时注入仅限 Unix);通过 Homebrew、APT、发布二进制、容器或 Cargo 安装 magents,再向各宿主注册 MCP 服务器。它读取磁盘上各代理自己的会话存储,因此这些宿主需已安装并有会话记录。未声明 API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 magents,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[magents shared session bus across Claude, Codex, Grok, and Cursor]
Claude Code, Codex, Copilot, Cursor, Gemini, AGY, Grok, and OpenCode already keep transcripts on disk. magents is the shared API over those sessions - an MCP server plus a small CLI - so one agent can pick up where another left off without you recapping, ping a specific live chat when you are not sitting in the middle, or start an independent persisted chat for a complete task.
It is not a second copy of history and not a fire-and-forget council. Existing chats stay the default unit of work; new chats are for independent work that benefits from its own session and working directory.
Install · Plugins · What you can do · Quick start · Tools · CLI · Releases
Why
You already run more than one coding agent. The pain is not "more models" - it is context trapped in another window.
What you can do
1. Handoff without a new thread
You were in Claude on the disaster-recovery branch. Now you are in Grok. Ask
Grok what they were doing; it reads the live session and continues. No paste
buffer. No "new chat, here's the context."
2. Send when you are not the messenger
Three agents running. Claude hits a wall Codex owns. Claude injects into that
Codex thread and keeps going - especially useful when the sender already has the
failing query, file, and constraint you would otherwise reconstruct.
3. Spawn independent work
When a task can proceed alone, start a new headless persisted session with a
complete prompt, an isolated working directory when files could collide, and a
request to reply through magents. Spawned agents keep their host's native
approval policy - spawning does not add an approval bypass.
Install
Homebrew (macOS / Linux)
APT (Debian / Ubuntu)
Binary
From Releases:
Assets: magents-x86_64-unknown-linux-musl, magents-aarch64-unknown-linux-musl,
magents-aarch64-apple-darwin, magents-x86_64-apple-darwin.
Container
Cargo
From source
Plugins
Host plugins package the magents skill plus an MCP entry that runs magents mcp.
Install the CLI first (brew install abnegate/tap/magents), then load the matching
folder under plugins/.
Gemini CLI installs the extension straight from this repository:
AGY CLI installs the plugin from plugins/agy (manifest, MCP, and skills):
Details and marketplace notes: plugins/README.md.
Quick start
magents install --all registers the stdio MCP server with each installed host,
skipping hosts whose required binaries are unavailable:
- Grok (
grok mcp add magents -- magents mcp) - Claude Code (
claude mcp add --scope user magents -- magents mcp) - Codex (
codex mcp add magents -- magents mcp) - Cursor (
~/.cursor/mcp.json) - OpenCode (
$XDG_CONFIG_HOME/opencode/opencode.json, default~/.config/opencode) - Gemini CLI (
gemini mcp add -s user magents magents mcp) - GitHub Copilot CLI (
copilot mcp add magents -- magents mcp) - AGY CLI (
agy mcp add magents magents mcp)
It also writes the magents and learn skills under supported hosts' skills
directories (~/.grok/skills/{magents,learn}, ~/.claude/skills/{magents,learn},
~/.cursor/skills/{magents,learn}, and the OpenCode / Gemini / AGY / Copilot
equivalents). /learn reads every local agent's sessions, not only Grok.
For Grok and Codex only, point a host at the binary yourself:
For Cline, open MCP Servers → Configure MCP Servers and add this to
cline_mcp_settings.json:
Restart the agent session (or refresh /mcps) so the tools appear.
Try:
Tools
Refs can be prefixed: claude:disaster recovery, grok:latest, codex:<uuid>,
cursor:latest, opencode:<id>, gemini:latest, agy:<id>, copilot:<id>.
CLI
Pass --output json on any command for stable machine-readable stdout.
magents with no args on a piped stdin starts the MCP server.
magents spawn reads the complete task from stdin by default (--prompt-file
supported). Prompt text is never a process argument.
How sessions talk
list_sessions / read_transcript / search_transcripts / search_memories
are the handoff. create_memory writes into another harness's first-party
memory (Claude, Codex, or Grok).
Choose the write path by where the work should happen:
spawn_session- new, headless, persisted, independent session. Complete task, verification, reply-through-magents, isolatedcwdwhen edits could collide. Success means launch accepted (accepted: true,status: "starting"), not that the task finished.send_message- existing session. Always records mailbox mail; injects a live user turn where the host supports one.handoff- compact this session into an existing live session so that session continues the same work.
Delivery routes (existing chats)
send_message always appends to the mailbox, then prefers a native live path
and otherwise starts a supervised headless resume:
Supervised routes pass the user turn through stdin and do not expose transcript
text, tokens, or raw host output in the response. Spawn never adds approval
bypasses (--dangerously-skip-permissions, --yolo, --full-auto, etc.).
Session discovery sources: Claude ~/.claude and ~/.claude-* (plus Desktop
Claude / Claude-* session dirs), Grok ~/.grok/active_sessions.json, Codex
sqlite + rollout JSONL, Cursor agent-transcripts, OpenCode SQLite
(opencode.db and channel databases, v1 session and v2 session_v2 /
session_message tables), Gemini journals, AGY CLI conversations / brain
plus Antigravity desktop conversation_summaries, Copilot session-state.
Claude sessions include a profile field when they come from a named home
(work for ~/.claude-work). Resume and live inject use that home's
CLAUDE_CONFIG_DIR.
Tests
CI runs format, clippy (-D warnings), the full test suite, and a 98% line-coverage gate.
Requirements
- Rust 1.97+
- macOS or Linux (Claude UDS inject is Unix-only)
License
MIT
来源:README.md,提交 6a9c7c6
工具
0版本历史
5- v0.14.2最新Oct 15, 2026
- v0.14.1Oct 14, 2026
- v0.13.2Oct 13, 2026
- v0.12.0Sep 22, 2026
- v0.11.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分