subagent-mcp
Manages detached tmux windows and panes where subagents run, including pane creation, output capture, liveness checks, and sending Ctrl-C.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@subagent-mcpLaunch claude in ~/myapp to add user authentication"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
subagent-mcp
An MCP server that collapses "launch a coding assistant in a tmux window" into one tool call.
Driving a TUI coding CLI from another agent is normally a ceremony: open a
window, send the command, wait for the TUI to boot, load a paste buffer, paste,
wait again, press Enter, then poll capture-pane to see what happened. Most of
that is unnecessary — both claude and opencode accept the prompt on the
command line — and the rest is bookkeeping a server should be doing for you.
launch_subagent does the whole thing and hands back a handle.
Requires tmux and at least one of claude / opencode on PATH.
Tools
launch_subagent— startclaudeoropencodein a detached tmux windowcheck_subagent— capture the last N lines of output from a running subagentlist_subagents— list all launched subagents and whether their panes are alivesend_to_subagent— paste a follow-up message into a live subagentstop_subagent— sendCtrl-C(or kill the tmux window)
launch_subagent takes prompt (or prompt_file), cwd, cli, and optional
session / window / task / model / agent / extra_args. Every launch
gets a directory under runs/ holding prompt.md, meta.json, and the
generated run.sh — so any subagent can be re-run by hand, and the prompt is
never lost to a scrollback buffer.
Handles are interchangeable: a run_id, a tmux pane id (%12), or a
session:window target all resolve to the same run.
Blocked detection
A launched CLI can sit waiting on a human instead of working — the folder-trust
prompt on a directory claude hasn't seen before, a login screen, or a
mid-run permission modal. A pane in that state still looks alive, so
launch_subagent and check_subagent both report blocked and
blocked_reason.
The detector matches verbatim CLI chrome, line by line, and skips lines that came from the submitted prompt — the TUI echoes it back, so without that a prompt like "fix the authentication bug" would report itself as blocked.
Note that --dangerously-skip-permissions does not bypass the folder-trust
prompt. Trust the directory once by hand, or expect blocked: true.
Related MCP server: mcp-tmux
Running
uv sync
# stdio (for an MCP client)
.venv/bin/subagent-mcp --stdio --runs-root ./runs
# HTTP for poking
.venv/bin/subagent-mcp --http --port 8100Options
Every flag has a matching environment variable.
Flag | Env | Default | Meaning |
|
|
| Parent dirs a subagent |
| — | off | Disable the |
|
|
| CLIs the server will invoke |
|
|
| Cap on live launched panes |
|
|
| Where per-run artefacts go |
|
|
| Keep at most this many run dirs ( |
|
|
| Delete run dirs older than this ( |
|
| default socket | Use a private tmux server |
|
|
| HTTP transport only |
Retention runs on launch — the only operation that grows runs/. Both limits
count every run on disk, but a run whose pane is still alive is never deleted.
Client registration
"subagent": {
"command": [
"/path/to/subagent-mcp/.venv/bin/subagent-mcp",
"--stdio",
"--runs-root", "/path/to/subagent-mcp/runs"
],
"cwd": "/path/to/subagent-mcp",
"transport": "stdio",
"description": "Launch and supervise coding-CLI subagents (claude, opencode) in detached tmux windows."
}Safety
This is intentionally an unsandboxed, permission-checks-off subagent launcher.
It runs coding agents with --dangerously-skip-permissions / --auto by
default, which means anything it launches can modify your files and run
arbitrary commands. It only belongs on a single-user trusted dev box. The
guards are mistake-catchers, not a security boundary:
--allowed-rootsrestricts wherecwdcan point.--max-concurrentlimits live launched panes.Only CLIs listed in
--cli-allowlistcan be invoked.
Pass dangerous=false per launch if you want the CLI's own permission prompts
back — check_subagent will surface the resulting modals as blocked.
Layout
src/subagent_mcp/
__main__.py CLI entrypoint (stdio | HTTP)
config.py ServerConfig
server.py FastMCP tool definitions
runners.py claude/opencode argv and wrapper generation
tmuxio.py thin wrapper around the tmux binary
runs.py per-run directory bookkeeping and retentionplan.md carries the design notes and the review findings behind each phase.
Tests
uv sync --extra dev
uv run pytestTests spin a private tmux socket (-L subagent-test-*) and a fake claude /
opencode on PATH, so they do not touch your real tmux sessions.
License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceTerminal multiplexer MCP server for orchestrating parallel AI agents. Manages workspaces, panes, surfaces with send_input/read_screen/spawn_agent/stop_agent tools. Supports Claude Code, Codex, Gemini, Cursor CLI agents with lifecycle management, browser automation, and agent status push via Claude --channels.2019Apache 2.0
- AlicenseBqualityAmaintenanceA comprehensive MCP server for driving tmux sessions, windows, panes, sending keystrokes, and reading pane output locally or over SSH, enabling real-time collaborative pairing with AI.711MIT
- AlicenseAqualityBmaintenanceAn MCP server that gives orchestrator agents fine-grained control over interactive Claude Code sessions running inside tmux, enabling mid-session steering, interruption, and token-efficient result extraction.15MIT
- Alicense-qualityDmaintenanceMCP server for orchestrating multiple Claude Code instances via tmux, enabling spawning, reading, sending, listing, and killing sessions.122MIT
Related MCP Connectors
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/garland3/subagent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server