# agent-ex-mcp [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/wuruofan/agent-ex  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/agent-ex-mcp

## Description
Schedule AI coding agents (Claude Code / OpenCode) as background tasks via MCP: detached runners, SQLite state machine, needs_input resume, Feishu notifications.

## Tools
Capabilities this server exposes over MCP:

- **agent_ex_submit** — { task_id, status, rounds }
- **agent_ex_status** — task fields; `question` when `needs_input
- **agent_ex_cancel** — current state (idempotent on terminal tasks)
- **agent_ex_version** — { version, gitSha, buildTime }
- **agent_ex_doctor** — findings with severity / detail / fix
- **agent_ex_restart** — the server exits; the host respawns it

## 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/wuruofan/agent-ex), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
npm i -g agent-ex-mcp
```

2. Install:

```sh
npx -y agent-ex-mcp@latest init
```

3. Run:

```sh
agent-ex init
```

## Documentation

## What agent-ex-mcp does

agent-ex-mcp treats local AI coding agents as external workers. A submitted ticket runs in a detached process tree rather than occupying the foreground conversation, and the worker writes its outcome to a SQLite-backed task store. The supported built-in executors are Claude Code and OpenCode, with separate profiles for settings such as environment variables, model selection, and additional PATH entries.

The same dispatch mechanism supports implementation work, independent design drafts, and reviews. The distinction comes from the task prompt: for example, a worker can implement a self-contained ticket, write a plan into a repository, or inspect an existing plan for feasibility gaps and contradictions.

## How it works

Tasks move through states including `queued`, `running`, `needs_input`, `completed`, `failed`, and `cancelled`. A worker can pause in `needs_input`; the answer is sent by submitting a continuation that refers to the original task. Continuation is limited to five rounds.

Use status polling to inspect task fields and retrieve a worker question, and use cancellation to stop work. Cancellation is idempotent for tasks that have already reached a terminal state. Selected transient failures—such as rate limits, service errors, and connection resets—are retried up to three times with increasing delays. Timeouts and hard failures are not retried.

The MCP server communicates through a standard process configuration. Its `restart` operation exits the server so the MCP host can start it again, while existing workers continue running. The `version` operation reports the build version, Git SHA, and build time.

## Setup and configuration

Install the npm package globally with `npm i -g agent-ex-mcp`, or run its latest package through `npx`. The installed command is `agent-ex`. Node.js 22.5 or newer is required because both the server and runner use `node:sqlite`; a local `claude` or `opencode` command is also required.

Run `agent-ex init` for interactive setup. It detects available agent CLIs, collects provider and key settings, writes configuration under `~/.agent-ex`, and prints an MCP registration snippet. Set `AGENT_EX_HOME` to use another data directory. The generated MCP configuration should use the absolute Node.js and server paths printed by `init`, because MCP hosts may launch processes without the shell's PATH.

Configuration secrets are kept in the data directory's `.env` file, while `config.json` uses environment-variable placeholders. Use `agent-ex config set` or `agent-ex profile set` for individual changes; rerunning `init` rewrites the configuration file after showing the proposed changes and creating a backup.

The optional dispatch skill can be installed with `agent-ex skill install`. It adds conventions for writing self-contained tickets, choosing delegation, continuing paused tasks, and avoiding conflicting write tasks in one directory. `agent-ex doctor` checks notification setup and worker PATH issues, and can apply deterministic fixes with `--fix`.

## Tools and capabilities

- `agent_ex_submit` starts a task or continues a task paused for input.
- `agent_ex_status` returns task information and exposes the worker's question during `needs_input`.
- `agent_ex_cancel` requests cancellation and safely handles already-terminal tasks.
- `agent_ex_version` reports version and build metadata.
- `agent_ex_doctor` returns diagnostic findings with severity, details, and fixes.
- `agent_ex_restart` exits the server so the host can respawn it.

Feishu notifications can send a card when a task reaches a terminal state. A dry-run mode supports notification testing without sending the card.

## Limitations and notes

Workers run Claude Code with permission prompts skipped or OpenCode with automatic permissions enabled. There is no additional confirmation layer, so use the tool only on machines and directories where those worker permissions are acceptable.

The MCP tools are low-level dispatch primitives; the optional skill provides the workflow guidance around them. Two write tasks should not run in the same directory. The server also depends on the local agent CLI, its profile configuration, and the MCP host's ability to launch the configured absolute paths.

_Full upstream README: https://allmcps.com/mcp/agent-ex-mcp/readme_

