MCP Shipyard
Docs menu
Docs

CLI

The shipyard command line: scan, eval, selection, launch, presence, diff and snapshot, with flags and exit codes for CI.

The shipyard command runs the same checks as the web scan from your terminal or CI. From a checkout of the repository run npx tsx packages/cli/src/bin.ts <command> <url> [flags]. Once the package is published to npm, use shipyard <command>.

shipyard <command> <url> [flags]

  scan <url>      [--json|--markdown] [--fail-on blocker|major] [--baseline tools.json] [--no-presence]
  eval <url>      [--cases file.json] [--draft] [--max-cost 0.5]
  launch <url>    --namespace io.github.x/y [--out ./shipyard-launch] [--repo URL] [--website URL] [--email ADDR] [--privacy URL] [--terms URL]
  presence <url>  [--json]
  diff <url>      --baseline tools.json [--json]
  snapshot <url>  > tools.json
  selection <url> --prompts prompts.json [--competitor url ...] [--baseline selection.json] [--min-share 0.8] [--max-drop 0.05] [--trials 3] [--model id] [--max-cost 0.5] [--json|--markdown]
  selection <url> --prompts prompts.json --snapshot [--baseline selection.json]

shared: --header "Name: value" (repeatable)

Commands

scan runs the handshake and protocol version negotiation, OAuth discovery, tool lint (including security checks), protocol conformance and directory presence check and prints a report. Output is colored text on a terminal, JSON with --json and Markdown with --markdown (useful as a pull request comment). --no-presence skips the directory check.

eval runs model evals against the live server. Without --cases it drafts cases from your tool list. --draft prints the drafted cases as JSON and exits, so you can edit them and pass them back with --cases. --max-cost is a ceiling in US dollars per run, default 0.5. eval needs ANTHROPIC_API_KEY and/or OPENAI_API_KEY. It runs each case 3 times per provider (--trials), grades with an LLM judge when substring checks cannot decide (--no-judge turns it off) and marks flaky cases. See evals.

launch writes server.json, .github/workflows/publish-mcp.yml and LAUNCH_KIT.md under --out. --namespace is required. See the launch kit.

selection runs the selection gate: a model picks tools for your prompts, and the command exits 1 when your share is below --min-share or dropped more than --max-drop against the baseline. --snapshot writes the baseline. It needs ANTHROPIC_API_KEY.

presence checks the directories and prints each listing's state and drift.

snapshot prints the live tool list as JSON. Save it as your baseline.

diff exits 1 on removed tools or changed required parameters. It compares live tools to a baseline file and lists added, removed and changed tools. A removed tool, a new required parameter, or a required parameter that disappeared counts as breaking.

Authenticated probing

Pass credentials as headers:

shipyard scan https://mcp.example.com/mcp --header "Authorization: Bearer $TOKEN"

Use a test account token, not a production user's.

Exit codes

CodeMeaning
0Success. For scan, no finding at or above the --fail-on level failed, and no breaking diff
1A failed check: server unreachable, a --fail-on hit, a breaking diff against a baseline, a failed eval, or a missed selection gate
2Usage error

--fail-on blocker fails only on failing blockers. --fail-on major fails on failing blockers and majors. Warnings never fail the gate.

CI pattern

shipyard snapshot https://mcp.example.com/mcp > tools.baseline.json   # commit once
shipyard scan https://mcp.example.com/mcp --fail-on blocker --baseline tools.baseline.json --markdown

This fails the build when a deploy introduces a blocker or removes a tool or adds a required parameter. See the GitHub Action for a ready workflow.