Skip to content
All posts

Agent Rack: one MCP interface for all your AI coding agents

· 3 min read

When you are working in Claude Code, have you ever wanted to hand a task to Codex, get an alternative solution from Antigravity, or ask opencode to review your code? Usually that means opening several tools and copying context between them. That is why I built Agent Rack.

Agent Rack is an MCP server that wraps command-line coding agents. Claude Code, OpenAI Codex, opencode and Antigravity are built in, and any other CLI agent can be added with a small adapter. Point any MCP client at it, and your main agent can work with the others without leaving your workflow.

What you can do

  • Delegate quick tasks and get results straight back.
  • Run long tasks as background sessions, and watch progress and live logs.
  • Send follow-up instructions while an agent is running, or cancel it.
  • Connect several profiles of the same agent as separate agents.

The real benefit is another agent’s context, not just another tool call. A sub-agent reads files, runs commands and reasons on its own budget, then hands back a result, so the work never fills your main conversation’s context window.

Structured code review

Agent Rack also does structured code reviews. Its adversarial review mode looks for hidden bugs, security issues, edge cases and release risks, and returns validated JSON instead of free text. The reviewing agent never changes your code; the final decision stays with you.

Built for Claude Code

In Claude Code it installs as a plugin, which adds the MCP server, tools and skills. You don’t need to remember tool names: describe what you want, and Claude Code delegates to the right agent, knowing when to run a quick task, when to start a background session and how to present review results. A terminal dashboard and a guided setup that detects installed agents come with it.

How it works under the hood

Agent Rack never calls a model or asks for an API key. It runs the agent CLIs already on your $PATH, with the logins you already have, and translates between them and MCP. It's written in TypeScript on the official MCP SDK, and its layers depend in one direction only: config, security, adapters, engine, tools, server, CLI.

Every agent speaks a different protocol, so each one gets its own adapter:

  • Claude Code streams newline-delimited JSON events, and follow-ups resume the same conversation with claude --resume.
  • Codex runs through codex exec with JSON output and resumes by thread id.
  • OpenCode only works interactively, so Agent Rack drives it through a real pseudo-terminal with node-pty.
  • Antigravity has its own stream format.

Conversation ids are read from each CLI’s own output instead of being made up front, so a wrapper script configured in place of the real CLI keeps working.

Background sessions write to a ring buffer of 512 events with a byte budget. Clients read logs with a cursor that only moves forward, so they can tell when they missed something. Cancelling a session signals the whole process group, first with SIGINT and then SIGKILL (taskkill /T on Windows). A separate cancelling state keeps the concurrency limit honest while a process shuts down.

Security, stated plainly

Handing your terminal to another agent needs guard rails, and Agent Rack is explicit about which ones it has:

  • Workspaces are checked by their real path, and a single call can’t raise the execution policy above what the config allows (read-only, workspace-write or full access).
  • Each agent gets an environment allow-list, and variables that look like secrets are stripped.
  • Reviews always run read-only: Codex in its read-only sandbox, Claude Code in plan mode.
  • The optional SSE endpoint, which the dashboard uses, needs a bearer token, accepts only loopback hosts and rejects requests with an Origin header, which blocks DNS-rebinding attacks from a browser.

It also says what it doesn’t do: a workspace allow-list isn’t a sandbox, only Codex enforces one at the OS level, and prompt injection isn’t solved.

Try it

sh
# guided setup: detects your agents and MCP clients
npx agent-rack setup

# or, inside Claude Code
/plugin marketplace add lakpriya1s/agent-rack

# watch every sub-agent live
agent-rack dashboard

It registers with Claude Code, Codex, Claude Desktop, Cursor, Antigravity and OpenCode, and prints a snippet for VS Code.

Agent Rack is open source on GitHub and on npm, where it has passed 8,000 downloads in its first year.

Written by Lakpriya Senevirathna

Mobile tech lead who builds fintech apps. Work with me

Keep reading