Subturn logo

Subturn

Delegates coding tasks to Claude Code, Codex, Grok, or OpenCode through asynchronous MCP tools.

Install Subturn

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "subturn": {
      "command": "npx",
      "args": [
        "-y",
        "subturn"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y subturn

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

subturn MCP server lets an MCP client start coding-agent sessions in Claude Code, Codex, Grok, or OpenCode, selecting the harness, model, effort, prompt, and working directory. It returns the harness session ID immediately, then provides tools to await, resume, cancel, or inspect the run. Each turn runs under a detached supervisor with persisted session evidence, deadlines, and a seven-day resume window. Reach for subturn when an orchestrator needs asynchronous delegation, parallel agent runs, or a consistent interface across installed coding-agent harnesses.

Use cases

  • Delegate implementation tasks to a selected coding-agent harness
  • Fan out independent coding investigations across multiple sessions
  • Resume a completed agent conversation with a follow-up prompt
  • Inspect failed or running sessions for raw diagnostic evidence

Key features

  • Supports Claude Code, Codex, Grok, and OpenCode harnesses
  • Runs asynchronous turns under detached supervisors
  • Persists session output, events, stderr, and launch evidence
  • Resumes sessions for up to seven days after the last turn
  • Provides MCP stdio and CLI interfaces
  • Supports per-session working directories and harness shadow state

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

7/7 checks healthy over the last 25d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev · subturn (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads63Package downloads in the last 30 days.
Last commit8d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Subturn works

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:

Terminal
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:

Terminal
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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Subturn

subturn is an MCP server that connects MCP clients to installed coding-agent harnesses, including Claude Code, Codex, Grok, and OpenCode. Its main tools spawn, await, resume, cancel, and inspect asynchronous agent sessions while passing through a chosen model, reasoning effort, prompt, and working directory.

Install it with `npx -y subturn serve` in an MCP host, or install it globally with `npm install -g subturn` and run `subturn serve`. The server requires Node.js 22.13 or newer; a GitHub-based `npx` command is also available before package publication.

subturn supports Claude Code, Codex, Grok, and OpenCode. Each harness is selected when spawning a session, and the requested model and effort are passed to that harness.

Yes, it can run in an MCP client that supports stdio servers, including Cursor. Configure the client to launch `npx -y subturn serve`, or point it at the globally installed `subturn serve` binary.

Call the `resume` tool with the session ID and a new prompt after the previous turn is no longer running. The harness, model, effort, working directory, and session ID carry over, and the conversation remains resumable for seven days after its last turn.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSubturn AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/subturn?style=directory)](https://allmcps.com/mcp/subturn)
HTML Embed
<a href="https://allmcps.com/mcp/subturn"><img src="https://allmcps.com/api/badge/subturn?style=directory" alt="Subturn on AllMCPs" /></a>