GitHub Action
Scan a remote MCP server on every pull request, diff its tools against a baseline, and get one updated PR comment plus a job summary.
The action scans a remote MCP server on every pull request, diffs its tools against a baseline, writes a job summary and keeps one updated comment on the pull request.
- uses: mcpshipyard/check@v1
with:
url: https://my-preview.vercel.app/mcp
baseline: tools.json
fail-on: blocker
Inputs
| Input | Default | Meaning |
|---|---|---|
url | required | MCP endpoint to check |
baseline | none | Tools snapshot made with shipyard snapshot <url> > tools.json. Removed tools or new required parameters fail the check |
fail-on | never | blocker or major: fail on failing findings at that severity or worse |
header | none | Request header Name: value, for protected previews. Pass it from a secret |
comment | true | Post or update the PR comment. Needs pull-requests: write |
pr-number | auto | Detected from the PR event, or from the commit for deployment_status events |
version | latest | npm version of mcpshipyard to run |
The action has one output, exit-code. It also has a selection mode that gates on tool-selection share. See selection gate.
Preview deployment workflow
This workflow checks the MCP endpoint of every successful Vercel preview deployment and comments on the pull request.
name: MCP Shipyard check
on:
deployment_status:
permissions:
contents: read
pull-requests: write
jobs:
mcp-check:
if: github.event.deployment_status.state == 'success' && github.event.deployment.environment == 'Preview'
runs-on: ubuntu-latest
steps:
# Only needed when the baseline file lives in the repo.
- uses: actions/checkout@v4
with:
ref: ${{ github.event.deployment.sha }}
- uses: mcpshipyard/check@v1 # or: uses: ./action when vendored
with:
url: ${{ github.event.deployment_status.environment_url }}/mcp
baseline: tools.json # made with: npx mcpshipyard snapshot <prod-url> > tools.json
fail-on: blocker
# For Vercel Deployment Protection, pass the automation bypass secret:
header: "x-vercel-protection-bypass: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}"
Behavior
- The PR comment starts with a hidden marker, so reruns edit the same comment instead of adding new ones.
- If no pull request is found for the commit, for example a push to the main branch, the comment is skipped and the job summary still has the report.
- The job exits with the scan's exit code: 1 for an unreachable server, a
fail-onhit, or a breaking tool change.
Tips
- Scan a deployed environment, not source code. The scan is a client of your server, so it needs a URL the runner can reach.
- Keep the baseline in the repository and update it with
shipyard snapshotin the pull request that intentionally changes tools, so tool changes show up as a diff in review. - Start with
fail-on: blockerand move tomajoronce the backlog is clean. - Pass any token or bypass header from a secret, and use a test account, not a production user.
npm package note
The action runs npx -y mcpshipyard@<version> scan ..., which assumes the CLI is published to npm as mcpshipyard. If you use a vendored copy of the repository, replace that line in action.yml with npx tsx packages/cli/src/bin.ts.
Publishing to the registry
The launch kit generates a separate workflow that publishes server.json to the official MCP Registry on a version tag. See publish to the official MCP Registry.
Related: CLI, monitoring.