herdr-mcp
herdr-mcp
一个 MCP 服务器,让编码代理能够控制正在运行的 Herdr 终端会话:列出工作区、标签页、窗格和代理,读取窗格输出,向其他代理发送提示,发送按键,运行命令,等待状态或输出,以及拆分或关闭窗格。
它是一个精简的 stdio 桥接层。每个工具都会转调 herdr CLI,而该 CLI 已经会使用 Herdr 的 socket API,并以 JSON 信封格式返回响应。没有守护进程、没有端口、没有配置文件,也没有身份验证。
要求
安装
herdr并确保它在PATH中(或者用HERDR_BIN指定其完整路径)。
需要有一个正在运行的 Herdr 会话。服务器会与
herdrCLI 从环境中(HERDR_SOCKET_PATH/HERDR_SESSION)解析出的那个会话通信。Python 3.12+ 和 uv。
Related MCP server: HT MCP Server
运行
从本地检出目录运行:
uv run herdr-mcp直接从 GitHub 运行,无需检出:
uvx --from git+https://github.com/aelaguiz/herdr-mcp herdr-mcp该进程通过 stdio 提供 MCP 服务,所以它不会向 stdout 打印任何内容;日志会输出到 stderr(设置 HERDR_MCP_LOG_LEVEL=DEBUG 可跟踪 argv)。
客户端配置
Claude Code:
claude mcp add herdr -- uvx --from git+https://github.com/aelaguiz/herdr-mcp herdr-mcp通用的 mcpServers JSON(Claude Desktop、Cursor、Codex 等):
{
"mcpServers": {
"herdr": {
"command": "uvx",
"args": ["--from", "git+https://github.com/aelaguiz/herdr-mcp", "herdr-mcp"],
"env": {}
}
}
}改为从本地检出目录运行:
{
"mcpServers": {
"herdr": {
"command": "uv",
"args": ["run", "--directory", "/path/to/herdr-mcp", "herdr-mcp"]
}
}
}工具
窗格 ID 形如 w17:p1,标签页 ID 形如 w17:t1,工作区 ID 形如 w17。代理工具接受窗格 ID 或代理名称。每个工具都会返回 herdr JSON 信封中解析后的 result 对象;read_pane 返回纯文本。
工具 | 作用 |
| 列出工作区及其 ID、标签和聚合后的代理状态。 |
| 列出整个会话中的所有标签页。 |
| 列出所有窗格,包括 ID、工作区、标签页、cwd、标题和代理状态。 |
| 列出正在运行已识别代理的窗格,包括类型和状态。 |
| 显示某个代理的当前状态。 |
| 以文本形式读取窗格输出( |
| 向代理提交提示,并可选地一直等待它进入稳定状态。 |
| 等待代理进入 idl/working/blocked/done/unknown 状态。 |
| 向窗格发送字面文本而不按 Enter。 |
| 发送按键,例如 |
| 在窗格中运行命令(文本 + Enter)。 |
| 等待窗格输出中出现字面子字符串或 Rust 正则表达式。 |
| 向右或向下拆分窗格,并返回新的窗格 ID。 |
| 关闭窗格及其正在运行的所有内容。 |
CLI 返回的失败信息(未知窗格、超时、socket 失效)会作为 MCP 工具错误返回,其中包含 herdr 自己的错误码和错误消息,因此模型可以自我纠正。
安全
没有身份验证、没有沙箱、仅本地 stdio。任何能启动这个办公户端的都可以在你的终端窗格中运行任意命令,并读取屏幕上的所有内容,包括某个 agent 窗格正在显示的任何东西。请只把把服务器连接到你自己机器上信任的客户端。
环境变量
变量 | 默认值 | 含义 |
|
| herdr 可执行文件的路径。 |
|
| Python 日志级别(输出到 stderr)。 |
环境中的其余所有内容都会原样传递,这正是 CLI 查找正确会话 socket 的方式。
开发
uv sync
uv run pytest -q单元测试通过 SDK 的内存客户端并针对一个桩(stub)herdr 脚本来驱动服务器,不会接触真实会话。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to manage local tmux sessions, including creating and controlling sessions, windows, and panes, sending commands, and capturing terminal output.168Do What The F*ck You Want To Public
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to programmatically control interactive terminal applications through HT sessions, supporting session management, key sending, snapshots, and command execution.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to spawn, interact with, and orchestrate multiple concurrent terminal sessions via tmux.
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to orchestrate Herdr coding agents by wrapping its Unix-socket JSON-RPC API, providing tools for agent management, layout editing, and terminal interaction.
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
The team layer for AI coding agents: shared contracts, collision alerts, E2EE sessions.
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/aelaguiz/herdr-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server