agent-herder

agent-herder

Unified MCP interface to monitor and control coding agents across OpenCode, Claude Code, and Codex CLI.

Category
Visit Server

README

Agent Herder

MCP server for monitoring and controlling coding agents.

One unified MCP interface to monitor and manage sessions across three coding agent harnesses:

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

Prerequisites

At least one of:

  • opencode installed and opencode serve running
  • claude (Claude Code CLI) installed
  • codex (OpenAI Codex CLI) installed and OPENAI_API_KEY set

Install

npm install
npm run build

Configure

Environment Variables

Variable Default Description
ENABLE_OPENCODE true Enable OpenCode adapter
ENABLE_CLAUDE true Enable Claude Code adapter
ENABLE_CODEX true Enable Codex adapter
OPENCODE_URL http://127.0.0.1:4096 OpenCode server URL
OPENCODE_SERVER_PASSWORD Password for OpenCode server auth
OPENCODE_SERVER_USERNAME opencode Username for OpenCode server auth
CLAUDE_BIN claude Path to Claude Code CLI binary
CODEX_BIN codex Path to Codex CLI binary
CODEX_DATA_DIR ~/.codex Codex data directory

Add to your MCP client

Claude Code:

claude mcp add agent-herder -- node /path/to/agent-herder/dist/index.js

Cursor / 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_agents List all sessions, filter by harness or status
agent_info Get detailed info about a specific session
send_message Send a message (sync/queue/steer)
resume_agent Resume a stopped session
stop_agent Abort a running session
respond_permission Allow/deny a pending permission request
set_permissions 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 serve running (auto-starts with TUI on port 4096)
  • Supports remote permission response and real-time status

Claude Code

  • Sessions read from ~/.claude/projects/*/sessions/*.jsonl
  • Sending messages uses claude -p --resume <id>
  • Permissions must be set at launch via --allowedTools flag
  • Running process detection via pgrep

Codex CLI

  • Sessions read from ~/.codex/sessions/
  • Sending messages spawns new codex invocations
  • Uses --full-auto mode for unattended operation
  • Permissions set at launch via --full-auto, --approve-tools flags

Development

npm run dev        # TypeScript watch mode
npm run build      # Compile
npm run inspect    # Open MCP Inspector for interactive testing

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured