agent-herder
Monitor and manage Codex CLI coding agent sessions, including listing agents, inspecting details, sending messages, resuming/stopping agents, and setting permissions.
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., "@agent-herderlist all running agents"
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.
Agent Herder
MCP server for monitoring and controlling coding agents.
One unified MCP interface to monitor and manage sessions across three coding agent harnesses:
OpenCode — via HTTP server API (
opencode serve)Claude Code — via CLI and session files
Codex CLI — via CLI
What it does
Monitoring
List all agents — which are running, idle, stopped, or need input
Inspect agent details — model, cost, duration, message count, working directory
See pending permissions — agents waiting for tool approval
Management
Send a message — sync (wait for response), queue (fire-and-forget), or steer (redirect)
Resume a stopped agent — with an optional new message
Stop an agent — abort a running session
Respond to permission requests — allow or deny tool calls (OpenCode)
Set permissions — configure allowed tools and permission modes
Related MCP server: all-agents-mcp
Prerequisites
At least one of:
opencodeinstalled andopencode serverunningclaude(Claude Code CLI) installedcodex(OpenAI Codex CLI) installed andOPENAI_API_KEYset
Install
npm install
npm run buildConfigure
Environment Variables
Variable | Default | Description |
|
| Enable OpenCode adapter |
|
| Enable Claude Code adapter |
|
| Enable Codex adapter |
|
| OpenCode server URL |
| Password for OpenCode server auth | |
|
| Username for OpenCode server auth |
|
| Path to Claude Code CLI binary |
|
| Path to Codex CLI binary |
|
| Codex data directory |
Add to your MCP client
Claude Code:
claude mcp add agent-herder -- node /path/to/agent-herder/dist/index.jsCursor / other MCP clients — add to your MCP config:
{
"mcpServers": {
"agent-herder": {
"command": "node",
"args": ["/path/to/agent-herder/dist/index.js"],
"env": {
"ENABLE_OPENCODE": "true",
"ENABLE_CLAUDE": "true",
"ENABLE_CODEX": "false"
}
}
}
}OpenCode — add to opencode.json:
{
"mcp": {
"agent-herder": {
"command": "node",
"args": ["/path/to/agent-herder/dist/index.js"]
}
}
}Available Tools
Tool | Description |
| List all sessions, filter by harness or status |
| Get detailed info about a specific session |
| Send a message (sync/queue/steer) |
| Resume a stopped session |
| Abort a running session |
| Allow/deny a pending permission request |
| Set allowed tools and permission mode |
Architecture
┌─────────────────┐
│ MCP Client │ (Claude Code, Cursor, OpenCode, etc.)
└────────┬────────┘
│ stdio (MCP protocol)
┌────────▼────────┐
│ Agent Herder │ (this server)
│ ┌───────────┐ │
│ │ MCP Tools │ │ 7 unified tools
│ └─────┬─────┘ │
│ │ │
│ ┌─────▼──────┐ │
│ │ Adapters │ │
│ ├────────────┤ │
│ │ OpenCode │──┼── HTTP → localhost:4096
│ │ Claude │──┼── CLI + ~/.claude/sessions
│ │ Codex │──┼── CLI + ~/.codex/sessions
│ └────────────┘ │
└─────────────────┘Harness-specific notes
OpenCode
Best supported — full HTTP API with session management, permissions, SSE events
Requires
opencode serverunning (auto-starts with TUI on port 4096)Supports remote permission response and real-time status
Claude Code
Sessions read from
~/.claude/projects/*/sessions/*.jsonlSending messages uses
claude -p --resume <id>Permissions must be set at launch via
--allowedToolsflagRunning process detection via
pgrep
Codex CLI
Sessions read from
~/.codex/sessions/Sending messages spawns new
codexinvocationsUses
--full-automode for unattended operationPermissions set at launch via
--full-auto,--approve-toolsflags
Development
npm run dev # TypeScript watch mode
npm run build # Compile
npm run inspect # Open MCP Inspector for interactive testingLicense
MIT
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.
Latest Blog Posts
- 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/megamen32/agent-herder'
If you have feedback or need assistance with the MCP directory API, please join our Discord server