MCP server
Let Claude Code, Claude Desktop, Cursor, VS Code or any MCP client check, explain, deploy and roll back your services, with the same approvals and locks as the command line.
How it works
muster-mcp is a stdio Model Context Protocol server written in bash (plus jq). Its tools run muster's own --json commands with a scoped local token, so hook approvals, locks, preflight and redaction behave exactly as in a terminal. It never runs a hook script itself.
Quickstart
cd your-project
muster mcp doctor # start the server, check the handshake, list tools
muster mcp install claude # print the config for a client
muster mcp install cursor --write # merge it into .cursor/mcp.json (shows the diff first)
muster mcp install claude-desktop --allow-actions --writeWith --write, muster shows a diff, asks [y/N] (pass --yes without a TTY), keeps your other servers and saves the previous file as <file>.bak. Configs use absolute paths, because GUI clients start servers with a minimal PATH and no working directory.
Client setup
# this project only (local scope)
claude mcp add muster -- /path/to/muster/bin/muster-mcp --project /path/to/project
# shared with the repo (.mcp.json, project scope)
claude mcp add --scope project muster -- /path/to/muster/bin/muster-mcp --project /path/to/project| Flag / env | Meaning |
|---|---|
--project DIR | Project to serve (default: walk up from the current directory to muster.json) |
--allow-actions | Enable the action tools (or MUSTER_MCP_ALLOW_ACTIONS=1) |
--read-only | Force read-only, even when the env var is set |
--list-tools | Print the tool definitions as JSON and exit |
Security model
- Scoped tokens. A read-scope token (
muster-mcp-read), and a deploy-scope token only when actions are on. muster checks the scope on every call; revoke withmuster auth revoke muster-mcp-read. - Read-only by default. Actions need a flag in the client config, which a model can't set.
- Hook approvals still apply. The server never passes
--yesto deploy or rollback and drops anyMUSTER_APPROVE_HOOKSit inherits. - Dry run first. Destructive annotations make clients ask the user before action tools.
- Validation and redaction. Arguments are checked against each tool's schema and passed as argv, never a shell string. Every result is redacted; if redaction can't run, the output is withheld.
- Attribution. Deploys over MCP are recorded with
"source": "mcp"in history.
setup_preview and then muster setup in a terminal.Troubleshooting
- Run
muster mcp doctor(or--json). project_inforeturnsfound: false: add--project /abs/pathto the args.actions_disabled: re-runmuster mcp install <client> --allow-actions --writeand restart the client.hooks_not_approved: review them withmuster hooks approvein a terminal.
Tools
Read tools
| Tool | What it does |
|---|---|
project_info | Project, services, deploy order, fleet, whether actions are on |
status | Health checks (status --json) |
logs | Last N log lines for a service (1–1000) |
history | Deploy, rollback and restart events |
explain | Likely cause and a suggested fix from the offline rules engine; the fix is never run |
doctor | Project diagnostics |
hooks_status | Approval state of hooks, muster.json and .env |
setup_preview | What setup --scan would configure; writes nothing |
config_get | muster.json without credentials or env values |
fleet_list / fleet_status / fleet_test | Fleet servers, health and connectivity |
fleet_logs / fleet_history | Logs and history from a fleet server |
Action tools
Always listed. Without --allow-actions they return {"error": "actions_disabled"} with instructions.
| Tool | Notes |
|---|---|
deploy | services or all: true; dry_run defaults to true; returns hooks_not_approved with a next step if hooks changed |
rollback / restart | One service |
hooks_approve | Only after a human reviewed the diff; dangerous patterns are refused |
fleet_deploy | dry_run defaults to true |
fleet_rollback / fleet_restart | Restart hooks must be approved on the server |
Resources: muster://project, muster://config, muster://history, muster://fleet, muster://services/{name}, muster://logs/{service}. Prompts: diagnose_failure, deploy_checklist, rollback_plan.
Protocol
The server speaks both the stateless MCP 2026-07-28 revision (server/discover, per-request version in _meta) and the initialize handshake (2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05), so current and older clients both work. Calls run as background workers; notifications/cancelled stops muster's process tree and releases locks like Ctrl+C, and a progressToken streams deploy events as progress notifications.