herdr-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
herdr-mcp
MCP server that puts the herdr CLI (hc) behind an authenticated HTTP endpoint, so any MCP client on any machine can list terminals, read their screens, type into them, run detached programs, and wait for exit codes.
Two files, zero dependencies: server.mjs (protocol + tools) and oauth.mjs (authorization server). Runs on Node.js 20 or newer.
What it implements
Transport: MCP Streamable HTTP, JSON responses only (no SSE stream). Single endpoint
POST /mcp.Protocol version:
2026-07-28, advertised oninitializeandserver/discover.Extension:
io.modelcontextprotocol/tasks.herdr_run_taskstarts a detached program and returns aCreateTaskResult(resultType: "task") instead of aCallToolResult.tasks/get,tasks/cancel, andtasks/updateare supported. Task TTL is 1 hour, poll interval 3 seconds.Capability gate: a client that calls
herdr_run_taskwithout declaring the tasks extension inparams._meta["io.modelcontextprotocol/clientCapabilities"].extensionsstill gets a normalCallToolResult(never aCreateTaskResult), andtasks/*calls fail with JSON-RPC-32021.
Related MCP server: mcp-auth-proxy
Tools
Tool | Required args | Description |
| none | List herdr machines and their state |
| none | List terminals on all machines ( |
|
| Read a terminal screen and history ( |
|
| Paste text into a terminal and press Enter |
|
| Press named keys ( |
|
| Press the stop key in a terminal |
|
| Run one program without a terminal, return output and exit code |
|
| Start a program in a new persistent background terminal |
|
| Block until a terminal finishes, return exit code and output |
|
| Start a program as a background MCP task |
|
| Read a text file locally or on another machine |
A terminal is an address (machine/t7), a terminal id (t7), or a name. Optional args: on (machine), cwd, timeout, name, lines. Arguments are passed to hc as an argv array via execFile — no shell, no string interpolation.
Setup
git clone https://github.com/Pakheria/herdr-mcp
cd herdr-mcp
cp .env.example .env
# edit .env: set OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, APPROVE_PASSWORD (16+ chars each)
set -a; . ./.env; set +a
node server.mjsRequires hc on PATH. The server binds 127.0.0.1:8791 — put a reverse proxy or tunnel in front of it to expose TLS; the OAuth issuer and resource URLs are derived from the Host header with the scheme fixed to https, so the metadata is only correct behind a TLS-terminating proxy.
Client configuration (any MCP client that supports remote HTTP servers with OAuth):
{
"mcpServers": {
"herdr": {
"type": "http",
"url": "https://your-host.example/mcp"
}
}
}OAuth surface
Endpoint | Purpose |
| Resource metadata ( |
| Authorization server metadata |
| Dynamic client registration (redirect URIs restricted to the allowlist) |
| Consent page, gated by |
|
|
| MCP endpoint, requires |
Flow: unauthenticated POST /mcp returns 401 with WWW-Authenticate: Bearer resource_metadata=".../.well-known/oauth-protected-resource". The client registers, opens /authorize, the owner types the password, the client exchanges the code with its PKCE verifier, and gets a 24h access token plus a 30d sliding refresh token.
Security model
Owner-gated consent. No user login system. One password (
APPROVE_PASSWORD) decides whether a client gets linked. Rotate it to revoke future linkings.PKCE S256 mandatory. Plain and missing challenges are rejected.
Redirect allowlist. Only
https://oauth-redirect[-sandbox|-test].googleusercontent.com/[ra]/...is accepted, at registration and at authorize time. This is a fixed constant inoauth.mjs, not a config value; widening it turns the consent page into an open redirect.No plaintext credentials at rest.
state.jsonstores only SHA-256 hashes of client secrets and tokens, written atomically with mode0600.Timing-safe comparisons for the owner password and client secrets.
Loopback bind.
127.0.0.1only. Body reads are capped at 1 MiB.DCR cap. At most 100 dynamically registered clients.
No shell. Every
hcinvocation is an argv array throughexecFile, with a 660s hard timeout and a 16 MiB output cap.
What this server does not protect you from
herdr_execandherdr_runare remote code execution by design. Any holder of a valid bearer token can run arbitrary programs as the server's user, on this machine or any machine herdr can reach. Treat an access token as a shell.Token hashes in
state.jsoncannot be reversed, but a stolenstate.jsonstill lets an attacker race live tokens; back it up like a credential, or delete it to revoke everything.Tool arguments are logged to stdout, including
herdr_sendtext andherdr_execargv. Do not send secrets through a terminal you also log.There is no per-client scope or per-tool authorization. Every authenticated client gets every tool.
Report vulnerabilities per SECURITY.md.
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Termalin's hosted MCP server. Claude, ChatGPT or any MCP client runs commands, moves files over SFTP, queries databases and reads server metrics and monitoring alerts on your servers, keylessly through Termalin Connectors: no SSH key is handed over and no inbound port is opened. Per-host command policy and an audit log. Needs a termal.in Pro or Team account (new accounts start with a 14-day Pro trial).
Linux server administration over OAuth MCP: shell, Docker, systemd, files and monitoring.
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for SSH and local terminal access. Supports interactive commands, long-running processes, and TUI apps like tmux/zellij64MIT
- AlicenseNot gradedqualityDmaintenanceBridges stdio-based LLM harnesses to OAuth-protected remote MCP servers via Streamable HTTP, handling PKCE browser login and token refresh automatically.MIT
- AlicenseNot gradedqualityCmaintenanceExposes a Windows or Linux host terminal to remote MCP clients via Streamable HTTP, enabling command execution, tunnel management, and privileged operations with security features like OAuth and audit logging.10 npm4MIT
- AlicenseNot gradedqualityBmaintenanceA remote Streamable HTTP MCP server that lets web clients like Claude.ai and ChatGPT manage cloud machines with OAuth login — creating, starting, pausing and deleting machines, running commands, reading and writing files, managing snapshots and public ports, and driving an optional Linux desktop via screenshots and input actions. Long-running work can be backgrounded and operations polled, so browser-based clients stay within their timeouts.2MIT