# @caho1/pi-agent-swarm [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/Caho1/codex-pi-subagents  
**GitHub Stars:** 0  
**npm Downloads (last month):** 536  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/caho1-pi-agent-swarm

## Description
Multi-model AI subagents for Codex and Pi with MCP, parallel execution, persistent sessions, and a local web panel

## Tools
Capabilities this server exposes over MCP:

- **pi_list_models** — List models available through Pi.
- **pi_spawn_agent** — Start an agent with a task and optional model, working directory, thinking level, name, and tool preset.
- **pi_wait** — Wait for all specified agents or the first to finish. The default timeout is 120 seconds, with a maximum of 240 seconds.
- **pi_get_agent** — Inspect an agent's status, latest answer, and recent log.
- **pi_send_followup** — Continue an agent with its existing session context. A message sent while it is running is queued.
- **pi_abort** — Stop a running agent.
- **pi_list_agents** — List agents belonging to the current Codex conversation or Pi session.

## 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/Caho1/codex-pi-subagents), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
pi install npm:@caho1/pi-agent-swarm
```

2. Install:

```sh
npm install -g @caho1/pi-agent-swarm
```

3. Start the server:

```sh
pi-subagents-server
```

4. Add to Codex:

```sh
codex plugin marketplace add "$(npm root -g)/@caho1/pi-agent-swarm/codex-plugin"
```

5. Add to Codex:

```sh
codex plugin add pi-subagents@pi-subagents-local
```

6. Start the server:

```sh
pi-subagents-server --port 7789 --data "$HOME/.codex-pi-subagents-demo"
```

## Documentation

## What @caho1/pi-agent-swarm does

@caho1/pi-agent-swarm adds delegated, multi-model subagents to Codex and Pi. The package contains the local service, a Pi extension, a Codex plugin, and a web panel. Agents use models available through the host's Pi configuration, including configured custom providers.

The MCP interface supports creating agents, coordinating their completion, reviewing their output, continuing existing sessions, and stopping active work. Each agent can receive its own task, model, working directory, thinking level, and tool preset. Independent tasks can run concurrently rather than being handled one after another.

## How it works

The service listens on `127.0.0.1:7788` by default and exposes the MCP endpoint at `/mcp`. Codex connects through the included plugin, while Pi can start the service automatically when its extension makes the first tool call. The service remains available after the Pi session ends.

Agent records, session data, and the panel's default model are stored beneath `~/.codex-pi-subagents`. Agent transcripts are written as JSONL files under the relevant project's `.pi-subagents/agent-transcripts` directory. Follow-ups reuse an agent's existing session context; queued messages are delivered if the agent is still running.

The `coding` preset uses Pi extensions and MCP servers according to Pi's project trust settings. The `read-only` preset exposes `read`, `grep`, `find`, and `ls` without loading extensions or MCP tools.

## Setup and configuration

The runtime requires Node.js 22.19 or later and a Pi installation with at least one configured model and its credentials. Install the Pi extension with:

```sh
pi install npm:@caho1/pi-agent-swarm
```

For Codex, install the package globally and start the service:

```sh
npm install -g @caho1/pi-agent-swarm
pi-subagents-server
```

Then add the package's Codex plugin from the global npm location and restart Codex after changing plugin configuration. The plugin may request approval for MCP calls; its approval mode can be configured in `~/.codex/config.toml`.

Pi provider credentials are supplied through Pi's configuration. For example, a DeepSeek setup can provide `DEEPSEEK_API_KEY` before starting Pi or the service. Use `pi_list_models` to discover model IDs available to the service.

The standalone service accepts options including `--port`, `--host`, `--data`, `--allow-host`, `--stdio`, and `--faux`. `PI_SUBAGENTS_PORT` and `PI_SUBAGENTS_DATA` can set the port and data directory. When using a non-default port with Codex, configure the MCP URL manually.

## Tools and capabilities

- `pi_list_models` lists models available through Pi.
- `pi_spawn_agent` starts an agent with a task and optional model, directory, thinking level, name, and tool preset.
- `pi_wait` waits for all selected agents or the first agent to finish. Its default timeout is 120 seconds, with a maximum of 240 seconds.
- `pi_get_agent` returns status, the latest answer, recent logs, and usage details.
- `pi_send_followup` continues an existing agent session and queues messages sent while the agent is active.
- `pi_abort` stops a running agent.
- `pi_list_agents` lists agents associated with the current Codex conversation or Pi session.

The local panel displays agent status, responses, and tool activity. It also allows stopping an agent and choosing the default model for new agents.

## Limitations and notes

The project has been tested with Pi SDK 1.4 on macOS. Windows and the standalone Pi binary have not been verified. A global npm installation may resolve a newer Pi SDK peer dependency.

The Codex plugin expects the service on port 7788 unless a manual MCP configuration points it elsewhere. Use a separate data directory for each service running on a different port. Agents using in-memory native sessions can retain context only while the service remains running; their transcripts remain available after a restart, but the native session cannot be resumed.

_Full upstream README: https://allmcps.com/mcp/caho1-pi-agent-swarm/readme_

