Skip to main content

PiHerder MCP

Release PyPI PiHerder MCP Install guide Sponsor Buy Me a Coffee

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. PiHerder v1.7.0 also serves POST /mcp on the herder. This adapter is the air-gapped fallback for a machine that cannot reach that URL. The public demo is not a target.

Adapter 0.2.0 calls the PiHerder 1.7.0 bearer API, including the wider trigger_job list. MCP registry name: io.github.bjorngluck/piherder-mcp (see server.json). Herder notes: PiHerder v1.7.0. The matching hosted tool list is the v1.8.0 train. Adapter notes: CHANGELOG.md.

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). The package is on PyPI. uvx piherder-mcp installs the latest published release. 0.2.0 is on PyPI after the v0.2.0 tag. Until then, pin the git commit.

Git fallback (pin a branch or commit):

uvx --from git+https://github.com/bjorngluck/piherder-mcp.git piherder-mcp

Auth and tokens

  1. In PiHerder 1.7.0: Settings → API management → Create new token → MCP agent. Details: API tokens.
  2. read is required. jobs, edit, and files add the write tools. A token without read exits on stderr.
  3. Set PIHERDER_URL and PIHERDER_TOKEN for 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_TOKEN in the host environment and omit it from the client env object (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, container_update_check, host_reboot, docker_stack_check, docker_stack_deploy, docker_stack_stop, docker_stack_start, docker_stack_restart, template_deploy, and template_redeploy. For a docker_stack_* job, source_filter is the compose project path. A 409 is the job already running. Poll get_job. File bodies are capped at 256 KiB.

SSH, the console, Move, undo, nmap, and token admin are not tools. docker_stack_down, docker_stack_remove, and template_drift_check are not in this list.

Wiki

Topic Page
PiHerder v1.7.0 Release · notes
Adapter 0.2.0 Changelog · v0.2.0 tag · v1.8.0 train
Install, clients, scopes Agents (MCP)
Token scopes and allowlist API tokens
Jobs the token can start Jobs
Fleet-jail files Host Files

Do not vendor this tree inside the PiHerder Docker image.

Publishing (maintainers)

piherder-mcp 0.1.1 was the first PyPI release. 0.2.0 publishes when you push the v0.2.0 tag. The PyPI badge links to the project page. The Release badge links to that tag.

Trusted Publisher is already set: GitHub Environment pypi, workflow release.yml, owner bjorngluck, repository piherder-mcp. Later versions reuse it. github-release and publish-pypi still run independently after the build, so a green GitHub Release is not proof the package is on PyPI.

  1. Package version is piherder_mcp.__version__. pyproject.toml reads it. CI checks server.json, the Continue sample, the changelog heading, and the README adapter line.
  2. Tag the release commit and push the tag: git tag -a vX.Y.Z <sha> -m "piherder-mcp X.Y.Z" && git push origin vX.Y.Z.
  3. Confirm the Release has wheel and sdist assets and the publish-pypi job succeeded, then check pypi.org/project/piherder-mcp.
  4. Optional: publish server.json to the MCP registry; keep the README <!-- mcp-name: … --> marker in sync with server.json name (the version test checks the marker).
  5. 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 Sponsors   Buy me a coffee

github.com/sponsors/bjorngluck · buymeacoffee.com/bjorngluck · Support the project

Release files for piherder-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for piherder-mcp 0.2.0
File Size Uploaded
piherder_mcp-0.2.0.tar.gz 15.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for piherder-mcp 0.2.0
File Interpreter ABI Platform
piherder_mcp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.7 kB

Release files / piherder_mcp-0.2.0.tar.gz

Download URL piherder_mcp-0.2.0.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
83fd50eec0ddacff1dabc9f239cfae39e6327864f054ec5d8cdc61d7df679252
BLAKE2b-256 checksum
How to use checksums
62cec73a5d6386edf13613c70be21ef2d4d7fab2ef2ad07ed41ab489f7c46ff8
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 28, 2026.

Transparency log

Release files / piherder_mcp-0.2.0-py3-none-any.whl

Download URL piherder_mcp-0.2.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
266e4a7bf806f64370bcccc863aa2913343f42dc747e1503f8307141195d2c75
BLAKE2b-256 checksum
How to use checksums
348dc3bf1ab992af86c0f287342daa59df9ac31f4685218d3223fb7c110f7e42
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 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page