PiHerder MCP
stdio process that lets Cursor, Claude, Codex, Windsurf, Continue, Goose, and other MCP clients call a PiHerder instance through the existing bearer API.
It runs on the computer that runs the agent. It is not part of the PiHerder image, and the herder does not open an MCP port. The public demo is not a target.
Adapter 0.1.1 talks to the token API that shipped with PiHerder 1.6.0. The contract for this cut is the v1.7 train. MCP registry name: io.github.bjorngluck/piherder-mcp (see server.json).
Install
Full steps and scope notes: Agents (MCP).
export PIHERDER_URL='https://piherder.example.com'
export PIHERDER_TOKEN='ph_…'
uvx piherder-mcp
Requires uv (uvx). After the first PyPI release, that is the whole install story.
Git fallback (pre-PyPI, or to pin a branch/commit):
uvx --from git+https://github.com/bjorngluck/piherder-mcp.git piherder-mcp
Auth and tokens
- In PiHerder: Settings → API management (mint a token). Prefer an MCP preset when that lands on the token page. Details: API tokens.
readis required.jobs,edit, andfilesadd the write tools. A token withoutreadexits on stderr.- Set
PIHERDER_URLandPIHERDER_TOKENfor the MCP process.
${PIHERDER_TOKEN} often does not expand inside client JSON env blocks. Many clients pass that string literally. Prefer one of:
- Export
PIHERDER_TOKENin the host environment and omit it from the clientenvobject (if the client inherits the parent env), or - Use the client's secret / env UI when it has one, or
- Paste the token once into the client config and keep that file out of git.
Samples in clients/ use a ph_… placeholder — replace it, or remove the key and rely on the host env. Do not commit real tokens.
Clients
Samples: clients/ (Cursor, Claude Desktop, Codex, Grok, Windsurf, Continue, Goose, Windows cmd /c). Path notes: clients/README.md.
Claude Desktop config locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Minimal Cursor / Claude-shaped entry:
{
"mcpServers": {
"piherder": {
"command": "uvx",
"args": ["piherder-mcp"],
"env": {
"PIHERDER_URL": "https://piherder.example.com",
"PIHERDER_TOKEN": "ph_…"
}
}
}
}
The same operating note is in skills/piherder/SKILL.md (Grok), clients/cursor/piherder.mdc (Cursor), CLAUDE.md, and AGENTS.md.
Tools
| Tool | Scope |
|---|---|
health, summary, list_servers, get_server, inventory, services, list_jobs, get_job |
read |
trigger_job |
jobs |
set_features |
edit |
list_files, read_file, write_file, mkdir, rename_file, delete_file |
files |
trigger_job accepts backup, retention, os_patch, container_patch, os_update_check, and container_update_check. A 409 is the job already running. Poll get_job. File bodies are capped at 256 KiB.
SSH, the console, Move, undo, compose stack actions, and token admin are not tools.
Wiki
| Topic | Page |
|---|---|
| Install, clients, scopes | Agents (MCP) |
| Token scopes and allowlist | API tokens |
| Jobs the token can start | Jobs |
| Fleet-jail files | Host Files |
| Train contract | PLAN v1.7.0 |
Do not vendor this tree inside the PiHerder Docker image.
Publishing (maintainers)
First PyPI upload needs a one-time Trusted Publisher click — automation cannot finish that alone.
The Release badge links to the releases index so it does not 404 before the v0.1.1 tag exists. The PyPI badge stays pending and links to this section until the project page exists. After the first upload, point that badge at https://pypi.org/project/piherder-mcp/.
github-release and publish-pypi run independently after the build. A green GitHub Release is not proof the package is on PyPI — if Trusted Publisher is not set up yet, the PyPI job fails and the Release assets can still appear.
- Package version is
piherder_mcp.__version__.pyproject.tomlreads it. CI checksserver.json, the Continue sample, the changelog heading, and the README adapter line. - Create a GitHub Environment named
pypi(Settings → Environments). Optional: require a reviewer. - On PyPI publishing, add a pending trusted publisher:
- Project name:
piherder-mcp - Owner:
bjorngluck - Repository:
piherder-mcp - Workflow filename:
release.yml - Environment name:
pypi
- Project name:
- Tag and push:
git tag v0.1.1 && git push origin v0.1.1. - Confirm the Release has wheel/sdist assets and the
publish-pypijob succeeded. Then openhttps://pypi.org/project/piherder-mcp/and retarget the README PyPI badge. - Optional: publish
server.jsonto the MCP registry; keep the README<!-- mcp-name: … -->marker in sync withserver.jsonname(the version test checks the marker). - Suggested GitHub topics:
mcp,model-context-protocol,piherder,python,stdio,uvx.
See CHANGELOG.md. Workflow comments in .github/workflows/release.yml repeat the Trusted Publisher fields.
Tests
pip install -e ".[dev]"
pytest -q
Tests mock HTTP. They do not call a live herder. CI runs Python 3.10–3.12.
Support
Optional. Nothing here is required to install the adapter.
github.com/sponsors/bjorngluck · buymeacoffee.com/bjorngluck · Support the project
Release files for piherder-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| piherder_mcp-0.1.1.tar.gz | 15.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| piherder_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.0 kB
Release files / piherder_mcp-0.1.1.tar.gz
| Download URL | piherder_mcp-0.1.1.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0a0fc60bececbd3fa20b2deb17f3bb2ef391b1d814d9ff1b676aadfbffac77e
|
|
BLAKE2b-256 checksum How to use checksums |
039591e87dcdfab979bdbb70170cf607a01b856c254a1a0e8656bb1af4360ae5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.
Transparency logRelease files / piherder_mcp-0.1.1-py3-none-any.whl
| Download URL | piherder_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34eb61aebe84238b31d8e0d88bd80aadf12e206be6aff89cdd7bebf9c8f2ffe6
|
|
BLAKE2b-256 checksum How to use checksums |
db78a997f3a37bffe79c0a11bfec894ef896bda8ae0179fae926a8d10141dff6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.
Transparency log