MCP server

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

Terminal
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 --write

With --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

Terminal
# 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 / envMeaning
--project DIRProject to serve (default: walk up from the current directory to muster.json)
--allow-actionsEnable the action tools (or MUSTER_MCP_ALLOW_ACTIONS=1)
--read-onlyForce read-only, even when the env var is set
--list-toolsPrint 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 with muster 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 --yes to deploy or rollback and drops any MUSTER_APPROVE_HOOKS it 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.
muster 0.7.3 and earlier had MCP tools that wrote hooks and stored credentials, and ran hooks without approval. Those tools are gone. To create a project, use setup_preview and then muster setup in a terminal.

Troubleshooting

  • Run muster mcp doctor (or --json).
  • project_info returns found: false: add --project /abs/path to the args.
  • actions_disabled: re-run muster mcp install <client> --allow-actions --write and restart the client.
  • hooks_not_approved: review them with muster hooks approve in a terminal.

Tools

Read tools

ToolWhat it does
project_infoProject, services, deploy order, fleet, whether actions are on
statusHealth checks (status --json)
logsLast N log lines for a service (1–1000)
historyDeploy, rollback and restart events
explainLikely cause and a suggested fix from the offline rules engine; the fix is never run
doctorProject diagnostics
hooks_statusApproval state of hooks, muster.json and .env
setup_previewWhat setup --scan would configure; writes nothing
config_getmuster.json without credentials or env values
fleet_list / fleet_status / fleet_testFleet servers, health and connectivity
fleet_logs / fleet_historyLogs and history from a fleet server

Action tools

Always listed. Without --allow-actions they return {"error": "actions_disabled"} with instructions.

ToolNotes
deployservices or all: true; dry_run defaults to true; returns hooks_not_approved with a next step if hooks changed
rollback / restartOne service
hooks_approveOnly after a human reviewed the diff; dangerous patterns are refused
fleet_deploydry_run defaults to true
fleet_rollback / fleet_restartRestart 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.