About
Local stdio MCP server for the Herdr terminal multiplexer CLI
README
A local stdio MCP server that wraps the Herdr CLI, so Claude Desktop can inspect and drive the Herdr session running on the same machine.
Tested with herdr 0.9.5, mcp 2.3.0, and Claude Desktop on macOS.
Security
pane_run, agent_prompt, and agent_start execute commands on this machine.
That is the point of the tool, and it is acceptable only because the transport
is local stdio started by Claude Desktop. There is no HTTP transport; do not put
this server behind HTTP or a tunnel. In Claude Desktop, keep these tools on
"ask every time".
pane_close and tab_close terminate the processes inside and cannot be
undone; see the ownership guard below.
agent_start args are not the only thing that decides an agent's permissions.
Your shell aliases and agent config apply too: in practice, claude --model opusplan started through agent_start ran with --dangerously-skip-permissions
(its resume command showed the flag) because of a shell alias. Check what your
shell turns the agent command into before letting Claude start agents.
Tools
| Tool | What it does |
|---|---|
snapshot() |
Live state as JSON: workspaces, tabs, panes, agents |
pane_read(pane_id, lines=120) |
Recent terminal output of a pane |
pane_run(pane_id, command) |
Types a command into a pane and presses Enter |
agent_read(target, lines=120) |
Recent output of an agent |
agent_prompt(target, text, timeout_ms=120000) |
Sends a prompt to an agent and waits for it to settle |
tab_create(workspace_id, cwd="", label="") |
Creates a tab; returns its tab ID and root pane ID |
pane_split(pane_id, direction, cwd="") |
Splits a pane right or down; returns the new pane ID |
pane_close(pane_id) |
Closes a pane this server created |
tab_close(tab_id) |
Closes a tab this server created |
agent_start(name, kind, pane_id, args=None) |
Starts a coding agent in a pane at its shell prompt |
New tabs and panes never take focus.
pane_id looks like w1:p2. target is a pane ID or an agent name. Get both
from snapshot; the server does not run inside a pane, so there is no "current"
pane.
Install
Requires uv and a running Herdr server.
Clone the repo, then add the server to
~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"herdr": {
"command": "/opt/homebrew/bin/uv",
"args": ["run", "/path/to/herdr-mcp/server.py"]
}
}
}
Use absolute paths: Claude Desktop starts servers with a minimal PATH. Quit
and reopen Claude Desktop. uv installs the one dependency on first run.
The server calls /opt/homebrew/bin/herdr by default. Set HERDR_BIN to use
another location:
"env": { "HERDR_BIN": "/usr/local/bin/herdr" }
Use in a Claude Project
The server is registered with the Claude Desktop app, not with a single Project, so its tools are available in Project chats opened in the desktop app. Projects opened on claude.ai in a browser cannot reach it: a local stdio server only exists on your machine.
- Open the Project in Claude Desktop and start a chat.
- Check that
herdris enabled in the chat's tools menu. - Ask in plain language, for example:
- "Take a herdr snapshot and list every pane and agent."
- "Read the last 50 lines of pane w1:p2."
- "Ask the agent named reviewer to report its status."
To save repeating yourself, add something like this to the Project's instructions:
You can control my local Herdr session through the herdr tools.
Call snapshot first to get pane IDs and agent names; never guess them.
Read before you write: use pane_read or agent_read to check a pane's state
before pane_run or agent_prompt.
Ask me before running anything that deletes, overwrites, or pushes.
Error handling
- Any CLI failure becomes a tool error (
isError) carrying the CLI's JSON as-is (server_not_running,agent_blocked,agent_prompt_stalled,timeout, ...). agent_promptwhose turn ends at a question/approval dialog makes the CLI exit 0 withagent_status: "blocked". The server flags that as an error: the agent is waiting for a human; read it withagent_read.- No automatic retry. A
timeout(CLI or subprocess) does not prove the prompt was not delivered, so do not blindly resend. - Subprocess timeout: 30 s per call;
agent_promptusestimeout_ms+ 10 s. linesis clamped to 1..2000;timeout_msto 1000..600000.- Ownership guard:
pane_close,tab_close, andagent_startact only on panes/tabs this server created since it started. Others are refused.pane_closeandtab_closealso refuse when any affected pane hosts an agent or has a foreground process, and list each busy pane and what it runs. A just-created pane can be briefly refused while its shell starts; retry. - Missing or broken
herdrbinary is a tool error; the server stays up.
Notes from use in Claude Desktop
- Agent at a question or approval dialog.
agent_promptreturnsagent_blockedand sends nothing. Read the options withagent_read, then answer withpane_run(for example"1"). That is deciding on the user's behalf: ask the user first. - Starting an agent in a new pane.
agent_startright aftertab_createorpane_splitcan fail withagent_pane_busywhile the shell is still initialising. Wait a moment and retry. In busy-pane errors the process name can show as[None]during that window. - Closing a pane or tab with an agent. It is refused while the agent runs.
End the agent first (for example send
/exitwithagent_promptorpane_run), thenpane_close/tab_close. - Refused by Claude, not by the server. Claude Desktop's own safety review
can block destructive calls such as
tab_closebefore they reach the server. That is not a server error.
Test
Run from inside a Herdr pane. The test splits that pane, uses the new pane as a scratch target, and closes what it created afterwards.
uv run test_e2e.py
The error-path tests live in test_failure_modes.py (called from test_e2e.py);
shared helpers are in e2e_common.py.
They use fake HERDR_BIN scripts (written to a temp dir, then deleted)
and a nonexistent HERDR_SOCKET_PATH to exercise failure modes.
It writes e2e-transcript.json, which contains a snapshot of your real session
(pane titles and paths). Keep that file out of version control.
The test hardcodes /opt/homebrew/bin/herdr and /opt/homebrew/bin/uv.
Verification status
- Verified by hand from Claude Desktop:
snapshot,pane_read,pane_run,agent_read,agent_prompt,agent_start(claude --model opusplanstarted and replied),tab_create,pane_split,pane_close(including refusal of a pane running a process). tab_close: verified over MCP stdio bytest_e2e.py(create/close an empty/tmptab, refusal of a tab from another server instance, refusal of a tab containing a hand-added pane). From Claude Desktop it was blocked by Desktop's own safety review, not by the server.- Verified against the real CLI and covered by fake-binary tests:
timeout,agent_blocked,agent_prompt_stalled, blocked-settle,server_not_running, subprocess timeout. - Not verified from Claude Desktop:
tab_close(see above).
Installing Herdr
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/Ray0907/herdr-mcpFAQ
Is Herdr MCP free?
Yes, Herdr MCP is free — one-click install via Unyly at no cost.
Does Herdr need an API key?
No, Herdr runs without API keys or environment variables.
Is Herdr hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Herdr in Claude Desktop, Claude Code or Cursor?
Open Herdr on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
Opencode Omniroute Plugin
OpenCode plugin for the OmniRoute AI Gateway. Drives dynamic model discovery, /connect auth flow, and multi-instance OmniRoute providers via the official @openc
by GitHub ActionsRoblox Studio
Enables AI coding tools to control Roblox Studio for workspace exploration, instance manipulation, and script management. It provides tools for playtesting, sce
by paralovAntigravity Drawio
MCP server that enables AI assistants to create, parse, render, and validate Draw.io diagrams programmatically.
by S-SUJAN-SFetch
Web content fetching and conversion for efficient LLM usage.
Mcp
ModelContextProtocol server for enhancing JSON Resumes
by mcpflow.ioVault
Bitwarden/Vaultwarden MCP server — BYOK vault access with 6 tools, Send-based reveal, TOTP, and safe agent-write
by agbergsmannAWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
by modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
by xuzexin-hzMCP-Agent
A simple, composable framework to build agents using Model Context Protocol by [LastMile AI](https://www.lastmileai.dev)
by lastmile-aiCompare Herdr with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All ai MCPs
