# magents [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/abnegate/magents  
**GitHub Stars:** 16  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/magents

## Description
Shared session bus MCP+CLI for Claude/Codex/Cursor/Grok: list, read, handoff, send, spawn.

## Tools
Capabilities this server exposes over MCP:

- **list_sessions** — Live and recent sessions; filter by `cwd` / `branch
- **get_session** — Lookup by id, title, live name, pid, or `agent:ref
- **read_transcript** — Compact inert handoff (last request, last action, recent turns)
- **search_transcripts** — Full-text search across those transcripts
- **search_memories** — Phrase search over Claude / Codex / Grok memory markdown
- **create_memory** — Write a note into Claude / Codex / Grok first-party memory
- **spawn_session** — Start a new headless persisted session for independent work
- **send_message** — Deliver a user turn to an existing chat
- **handoff** — Compact this session and inject it into another live chat
- **inbox** — Mailbox for cross-session replies
- **session_digest** — Compact last request / action / cwd / branch / clipped turns
- **files_touched** — Paths another session edited
- **stop_session** — Stop a magents-supervised spawn or resume
- **read_memory** — Read one Claude / Codex / Grok memory markdown file
- **get_note** — Magents-owned shared scratch for a working directory
- **whoami** — Detect this connection; resolve session via env, socket, or unique cwd
- **learn_collect** — Collect compact records from every local agent's full history for `/learn`, or estimate a run
- **learn_state** — Read or update `/learn` state, decisions, and trash

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/abnegate/magents), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
brew install abnegate/tap/magents
```

2. Install:

```sh
magents install --all
```

3. Install:

```sh
curl -fsSL https://abnegate.github.io/apt-repo/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/abnegate.gpg
```

4. Install:

```sh
sudo apt update && sudo apt install magents
```

5. Install:

```sh
curl -LSsf -o magents \
  "https://github.com/abnegate/magents/releases/latest/download/magents-$(uname -m | sed 's/arm64/aarch64/')-$(uname -s | tr 'A-Z' 'a-z' | sed 's/darwin/apple-darwin/;s/linux/unknown-linux-musl/')"
```

6. Run:

```sh
chmod +x magents
```

## Documentation

## What magents MCP server does

The magents MCP server exposes a shared API over local agent sessions that already store transcripts on disk. It helps one agent inspect work performed in another session, continue a live conversation, send a message to a specific chat, or start a separate persisted task. Supported session references can identify hosts such as Claude, Codex, Grok, Cursor, OpenCode, Gemini, and Copilot, depending on the host and local installation.

The server is designed around existing chats rather than duplicating conversation history. It can produce compact handoff context containing recent requests, actions, turns, working directory, and branch information. It also provides transcript and memory search, shared notes, mailbox operations, and learning-state operations.

## How it works

The magents MCP server runs through the `magents mcp` command and communicates with MCP clients over stdio. Its session discovery can use connection environment, a local socket, or a unique working directory to resolve the current session. Session records can be filtered by working directory or branch and looked up by identifiers such as title, process ID, live name, or an `agent:ref` value.

For existing chats, `send_message` records mailbox mail and prefers a native live delivery route when the host supports one. If a live route is unavailable, it can use a supervised resume path. `handoff` compacts the current context and injects it into another live session. `spawn_session` starts a new headless persisted session; an accepted spawn means launch has started, not that the task has completed.

## Setup and configuration

Install the CLI with Homebrew, APT, a release binary, a container, or Cargo. Running `magents install --all` registers the stdio MCP server with detected hosts and installs supported magents and learn skills. The documented host registrations include Grok, Claude Code, Codex, Cursor, OpenCode, Gemini CLI, and GitHub Copilot CLI.

For manual setup, configure an MCP server named `magents` with the executable path as `command` and `mcp` as its argument. Restart the agent session or refresh its MCP connections after registration. Container usage mounts the home directory and passes `HOME` so the process can access local agent data.

## Tools and capabilities

Available operations include:

- Discover, inspect, digest, and filter live or recent sessions.
- Read, search, and summarize stored transcripts.
- Search Claude, Codex, and Grok memory Markdown files, and write supported first-party memory notes.
- Send messages, perform handoffs, use the cross-session inbox, and inspect files touched by another session.
- Spawn or stop magents-supervised sessions.
- Store working-directory notes and resolve the current connection.
- Collect and update `/learn` records, decisions, state, and trash.

The CLI also supports JSON output for machine-readable results. Spawn prompts can come from standard input or a file rather than a process argument.

## Limitations and notes

The magents MCP server depends on local transcripts, host binaries, sockets, and session formats. Host-specific delivery behavior differs, and automatic installation skips hosts whose required binaries are unavailable. A spawned session inherits its host's approval policy; creating it does not bypass approvals. Existing sessions remain the default unit of work, while spawning is intended for tasks that can proceed independently.

_Full upstream README: https://allmcps.com/mcp/magents/readme_

