subagents-mcp
Allows sending prompts to Gemini models through the locally signed-in Antigravity CLI (agy) using a Google AI subscription, with multi-turn conversation resume and tool actions denied.
Allows sending prompts to Codex through the locally signed-in OpenAI Codex CLI (codex) using a ChatGPT subscription, with a read-only sandbox and multi-turn conversation resume.
Click on "Deploy 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., "@subagents-mcp Ask Gemini to review this function for bugs"
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.
subagents-mcp
Use your existing Google (Gemini), ChatGPT (Codex), and Claude subscriptions as selectable agents inside Claude Code and claude.ai — with $0 API billing and zero API proxying.
Pay-per-token API proxies get expensive fast when you already pay for monthly AI subscriptions. From the author of deepclaude (★2,200+), subagents-mcp exposes your locally signed-in subscription CLIs (agy, codex, claude) over the standard Model Context Protocol (MCP) so you can select and message Gemini, Codex, and Claude side by side with multi-turn session resume.
deepclaude vs subagents-mcp
subagents-mcp | ||
Billing | Pay-per-token API keys (DeepSeek / OpenRouter) | $0 API billing — uses your existing Google, ChatGPT, and Claude subscriptions |
Models | Anthropic-compatible API backends | Gemini ( |
Works in | No (CLI proxy) | Yes — built-in single-owner OAuth 2.1 MCP Custom Connector |
Works in Claude Code? | Yes ( | Yes — stdio MCP + |
API key leak protection | Needs API key | Hard-strips every |
How It Works
Claude Code / Cursor / Antigravity / claude.ai (MCP client)
│ MCP (stdio or Streamable HTTP)
▼
subagents-mcp (list_agents / send_to_agent / get_reply)
│ strips EVERY *_API_KEY & GOOGLE_APPLICATION_CREDENTIALS
│ runs inside an isolated empty 0700 directory
├──► agy (Google AI subscription — Gemini models, all tool actions denied)
├──► codex (ChatGPT subscription — read-only sandbox)
└──► claude (Claude subscription — read-only plan mode)Hard Safety & Cost Guarantees
$0 API billing by construction: every
*_API_KEYenvironment variable (GEMINI_API_KEY,GOOGLE_API_KEY,OPENAI_API_KEY,ANTHROPIC_API_KEY,OPENROUTER_API_KEY, etc.) andGOOGLE_APPLICATION_CREDENTIALSare stripped before spawning any CLI. If you aren't signed in to a subscription, the CLI reports it instead of silently billing an API key.No workspace mutation: all runners execute in an isolated empty
0700directory (~/.local/state/subagents-mcp/sandbox-cwd) and fail loudly on startup if it is non-empty.Hard tool lockout:
agyruns with session-only--settingspinningtoolPermission: "request-review"and denying all 7 wildcard permission categories (command(*),write_file(*),read_file(*),mcp(*),execute_url(*),download_url(*),read_url(*)).codexruns with--sandbox read-only(and-c sandbox_mode="read-only"on resume).clauderuns with--permission-mode plan.
Multi-turn context: passing
conversation_idback tosend_to_agentresumes the underlying CLI conversation (--conversation,codex exec resume,--resume).
Related MCP server: AgentGo
Prerequisites
Install and sign in (via subscription login, no API keys) to whichever CLIs you want available — any missing CLI is skipped cleanly at startup:
Gemini (Google AI subscription): Antigravity CLI (
agy) — runagyonce to sign in, verify withagy models.Codex (ChatGPT subscription): OpenAI Codex CLI (
codex) — runcodex login.Claude (Claude subscription): Claude Code CLI (
claude) — runclaude auth login.
Quick Start
git clone https://github.com/aattaran/subagents-mcp.git
cd subagents-mcp
npm install
# Check which subscription agents are detected on this machine
node src/cli.js --list1. Use in Claude Code (stdio MCP + /agents)
Register the MCP server once:
claude mcp add subagents -- node /absolute/path/to/subagents-mcp/src/cli.jsOptional — copy the bundled subagent presets so gemini and codex show up directly in Claude Code's /agents picker:
mkdir -p ~/.claude/agents
cp claude-agents/*.md ~/.claude/agents/2. Connect directly to claude.ai (Web, Desktop & Mobile — built-in OAuth 2.1)
claude.ai Custom Connectors require OAuth 2.1 over HTTPS. subagents-mcp includes a built-in single-owner OAuth 2.1 server (Dynamic Client Registration, PKCE, scrypt owner passphrase consent, refresh token rotation, and brute-force lockout).
Step 1 — Set your owner passphrase once:
node src/cli.js --set-passphraseStep 2 — Expose localhost over HTTPS (e.g. Cloudflare Tunnel):
cloudflared tunnel --url http://127.0.0.1:3456
# Copy the https://<your-tunnel-url> printed by cloudflared(For a permanent hostname, use a named Cloudflare Tunnel pointing to http://127.0.0.1:3456.)
Step 3 — Start subagents-mcp in OAuth 2.1 mode:
node src/cli.js --http --port 3456 --public-url https://<your-tunnel-url>Step 4 — Add the Custom Connector in claude.ai:
In
claude.ai, go to Settings → Connectors → Add custom connector.Enter your MCP URL:
https://<your-tunnel-url>/mcp.Click Connect → enter your owner passphrase on the consent page → click Allow.
In any
claude.aichat (web, desktop, or mobile), enable the connector and say "List my agents" or "Askgemini-4-neon-highto ...".
3. Local Claude Code CLI Slot Proxy (--proxy)
Want to route unused legacy slots (Opus 5, Sonnet 5, Haiku 4.5) in local Claude Code CLI (/model or --model) to subscription-backed Gemini 4 Neon, Gemini 4 Carbon, or Codex at $0 API billing while keeping Opus 5.5 / Sonnet 5.5 / Haiku 5.5 untouched on Anthropic?
Step 1 — Start the local subscription-CLI proxy:
npm run proxy
# Listening on http://127.0.0.1:3457:
# Opus 5 / Opus 4.7 -> gemini:gemini-4-neon-high (Gemini 4 Neon)
# Sonnet 5 -> gemini:gemini-4-carbon-high (Gemini 4 Carbon)
# Haiku 4.5 -> codex:codex (Codex)
# All other models -> https://api.anthropic.com (pass-through)Step 2 — Launch local Claude Code pointed at the proxy:
ANTHROPIC_BASE_URL=http://127.0.0.1:3457 claude --model claude-opus-5Measured limitation on
claude.ai/code(claude remote-control): Claude Code2.1.331+explicitly refusesclaude remote-controlwheneverANTHROPIC_BASE_URLdoes not point atapi.anthropic.com("Remote Control is only available when using Claude via api.anthropic.com"). So the--proxypath works for local Claude Code CLI / terminal sessions, whileclaude.aiweb/mobile should use Section 2 (built-in OAuth 2.1 MCP Custom Connector).Note: Mapped slots stream text/reasoning replies live from
agy/codex(read-only/tool-locked, $0 API cost); switch back toOpus 5.5/Sonnet 5.5whenever you want native Claude Code file/shell tool execution. An optional companion userscript (browser/claude-ai-relabel.user.js) is included for reference.
4. Static Bearer Token HTTP Mode (non-OAuth MCP clients)
export SUBAGENTS_TOKEN="$(openssl rand -hex 32)"
node src/cli.js --http --port 3456Binds to 127.0.0.1:3456 by default and requires Authorization: Bearer <token> on /mcp (constant-time verified).
MCP Tools
Tool | Description |
| Lists every discovered subscription agent ( |
| Starts or continues a conversation ( |
| Long-polls (up to 25s per call) for replies newer than |
Development & Tests
# Fast host test suite (fake CLIs, no network)
npm test
# Full isolated Docker test run (--network=none, non-root user, live proxy/OAuth CLI smoke)
npm run test:isolatedRuns Node's built-in test runner (node --test) across environment sanitization, subprocess runners (verifying env stripping, argv lockouts, split multibyte UTF-8 streaming, denied tools, and multi-turn resume), single-owner OAuth 2.1 + PKCE, local /v1/messages proxy streaming + pass-through, and end-to-end stdio + Streamable HTTP MCP flows.
Subscription terms note: Before driving any subscription CLI from a custom setup or UI, verify that your usage complies with the provider's current subscription Terms of Service. Never put a paid API key into this tool's environment.
License
MIT
Available Tools
3 toolsget_replyA
Retrieve replies for a conversation. Long-polls up to wait_seconds (max 25) for a reply newer than after.
Inputs: conversation_id (required), after, wait_seconds.
list_agentsA
List available local subscription-backed agents (Gemini via agy, Codex via codex, Claude via claude). All run with *_API_KEY stripped ($0 API billing) in an isolated empty directory.
Inputs: no named parameters.
send_to_agentA
Send a prompt to a subscription-backed agent from list_agents. Returns a conversation_id immediately; call get_reply to receive the answer. Pass conversation_id to continue the same multi-turn session.
Inputs: message (required), agent, conversation_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool maps to a distinct step in a single workflow: list_agents discovers agents, send_to_agent starts a turn, get_reply fetches the answer. The descriptions make the resource boundaries and the async handoff explicit, so no two tools could be confused.
All three names are snake_case verb_noun (list_agents, send_to_agent, get_reply) with a consistent action-first convention. The verbs are standard CRUD-ish primitives that match their actual behavior.
Three tools is thin but exactly right for a focused dispatch-and-reply loop, so nothing feels padded. It sits at the low edge, though, and one or two more lifecycle tools would not be bloat.
The core async loop (discover → send → poll) is covered, but there is no cancel/abort for a runaway agent, no way to list existing conversations, and no status or health check. Agents can work around these, but long-running calls become dead ends.
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables claude.ai, including free users, to act as a coding agent on your own machine, allowing file edits, shell commands, and git operations within explicitly chosen project folders. It provides a secure local MCP server exposed as a custom connector with OAuth-based consent.GPL 3.0
- AlicenseNot gradedqualityBmaintenanceEnables an AI assistant to delegate coding tasks to local Codex or Claude Code CLIs, monitor their progress, read results, continue sessions, and browse the files in user-approved project workspaces. It exposes these capabilities over Streamable HTTP through a Cloudflare tunnel or locally over stdio, so a remote or cloud client can drive agents running on the user's own machine.47 npm1MIT
- FlicenseNot gradedqualityAmaintenanceConnects web-based AI chat clients such as Claude, ChatGPT, and Grok to a local machine through a single OAuth-gated MCP endpoint so they can browse, read, write, and edit files, run whitelisted shell commands, search content, use Git, query SQLite, drive browsers and DevTools, and manage background tasks, ports, and clipboard. It also exposes localhost and LAN services via a protected HTTP client, letting remote or mobile clients debug and operate local projects without granting unrestricted shell access.-
- AlicenseNot gradedqualityAmaintenanceConnects web-based AI chat clients such as Claude, ChatGPT, Grok, and Postman to a local machine through a single OAuth-gated MCP endpoint, so they can build and edit projects, run whitelisted shell commands, search files, inspect databases and local APIs, drive browsers and DevTools, manage background jobs, and control Postman without granting unrestricted shell access. It also supports local IDEs and offline use by connecting directly over localhost.MIT