# subturn [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/eshatalov/subturn  
**GitHub Stars:** 0  
**npm Downloads (last month):** 63  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/subturn

## Description
Run subagents in any coding agent you have installed, from any MCP client. You pick the harness and model, it handles the rest.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "subturn": {
    "command": "npx",
    "args": ["-y","subturn"]
  }
}
```

## Documentation

## What subturn does

subturn exposes installed coding agents through an MCP stdio server. An orchestrator can launch a turn by providing a harness, model identifier, reasoning effort, prompt, and absolute working directory. Codex, Claude Code, Grok, and OpenCode are supported harnesses.

The initial call returns the native session ID after the harness starts. The caller can then collect the result separately, allowing the MCP request and the agent's work to be decoupled. Successful results include the final text, usage information, and the model and effort acknowledged by the harness. Failed or cancelled turns return their corresponding status.

## How it works

The MCP server starts through the `subturn serve` command and communicates over stdio. Its MCP-facing process keeps no session state in memory; the core stores session records under `~/.local/state/subturn/sessions/<session-id>/` by default. Records include prompts, launch commands, event streams, stderr, acknowledged configuration, and final output, so inspection is available while a turn is running.

Each turn has its own detached supervisor. This keeps a run alive across an MCP server restart or the exit of a one-shot CLI command. Supervisors enforce deadlines, terminate the harness and its child processes on cancellation, and preserve the old session ID if a harness changes its native ID during resume.

Harness plugins handle detection, authentication checks, model advertisement, launch details, resume behavior, and cleanup. Per-session shadow state prevents concurrent sessions using the same harness from colliding. Model identifiers pass through to the harness rather than being validated by subturn, so invalid models fail within the underlying agent and remain available as diagnostic evidence.

## Setup and configuration

The server requires Node.js 22.13 or newer. Install it on demand with:

```sh
npx -y subturn serve
```

MCP hosts that use a configuration file can use `npx` as the command with `-y`, `subturn`, and `serve` as arguments. Installing the package globally avoids the first-use download and can help hosts with short MCP startup timeouts:

```sh
npm install -g subturn
subturn serve
```

The package can also be run from the GitHub repository with `npx github:eshatalov/subturn`. A checkout can be built with `npm install`; the resulting server entry point is `node dist/faces/mcp.js`. OpenCode requires version 2.0.25 or newer.

`SUBTURN_STATE_DIR` changes the session directory, `SUBTURN_RETENTION_DAYS` changes how long completed sessions remain available, and `SUBTURN_DEADLINE_S` changes the default turn deadline. The default deadline is 3600 seconds, with a maximum of six hours; retention defaults to seven days after the last turn.

## Tools and capabilities

The MCP surface contains five operations:

- `spawn` starts a harness turn and returns its session ID.
- `await` waits for a result, with a configurable timeout up to 300 seconds per wait; `0` takes a snapshot.
- `resume` sends a new prompt to a completed turn while retaining its harness, model, effort, working directory, and session ID.
- `cancel` stops a running turn while keeping the session record.
- `inspect` returns raw session evidence, including information useful for diagnosing a run in progress.

A turn itself can continue until its deadline even when an `await` call times out. This supports fire-and-forget execution and fan-out by starting multiple sessions. The command-line interface provides the same core verbs, along with `status`, `prune`, and `serve`.

## Limitations and notes

Subagents cannot delegate to other subagents through subturn. Reviews, retries, and fallbacks must be implemented by the calling orchestrator. The prompt is the complete context seen by the subagent, so required instructions and project details must be included there.

The supported harnesses run with permissive approval or sandbox settings, including the equivalent of bypassing approvals and allowing tool execution. Use a disposable working directory or worktree when isolation from the main checkout matters, then review the resulting diff. Authentication is checked before quota is spent, using each harness's local credential mechanism; the harnesses must already be installed and logged in.

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

