GitHub 0
Skip to content

Run in CI

Fail a pull request when an MCP client would lose a tool, or when the tools list grows, with the CLI as a step in your own workflow.

There is no GitHub Action to install. Add a step that runs the CLI: it exits 1 when the check fails, which fails the job. The same step works in any CI with Node.js 22.12 or later.

Run the CLI one of two ways:

  • As a dev dependency. pnpm add -D is-mcp-ok, then pnpm exec is-mcp-ok in the workflow. The lockfile pins the version, and Renovate or Dependabot updates it.
  • With npx. Pin a version, such as npx is-mcp-ok@0.1.1, or a new release can change the result when your code hasn't changed.

Where the CLI reads tools/list from depends on how your server runs:

Your serverWhat to pass the CLI
One the job starts, such as a dev serverIts local URL
A deployed one, such as a preview or stagingIts URL, with a token from a secret
A stdio server, or one the job can't reachA file with its tools/list

By default, tools/list diagnostics fail the run at error. Add --max-warnings 0 to fail on list warnings too. A client warning on an answer fails the run regardless of that flag.

Start the server in the background, wait until it answers, then check it:

- run: pnpm install --frozen-lockfile
- name: Check the MCP server
  run: |
    nohup pnpm dev --port 3000 > dev.log 2>&1 &
    for i in $(seq 1 60); do curl -sf -o /dev/null http://localhost:3000/ && break; sleep 1; done
    pnpm exec is-mcp-ok http://localhost:3000/mcp --max-warnings 0
.github/workflows/checks.yml

Pass its token from a secret. It goes to the server only and is never printed:

- name: Check the staging MCP server
  run: npx is-mcp-ok@0.1.1 https://staging.example.com/mcp --header "Authorization: Bearer $MCP_TOKEN" --max-warnings 0
  env:
    MCP_TOKEN: ${{ secrets.MCP_TOKEN }}
.github/workflows/checks.yml

For this section and the GitHub summaries below, install the preview CLI as a dev dependency and commit the lockfile. npm 0.1.1 doesn't have these options. Commit a baseline once, from a server you run locally:

pnpm exec is-mcp-ok http://localhost:3000/mcp --save mcp-tools.json

Then compare each pull request with it. The step fails when the budget grew by more than 5%:

- name: Check the MCP server
  run: pnpm exec is-mcp-ok http://localhost:3000/mcp --baseline mcp-tools.json --max-increase 5%
.github/workflows/checks.yml

When the growth is intended, run --save again and commit mcp-tools.json in the pull request. This works in forks and needs no token.

To compare with production instead, save its list in one step and check the pull request's server in the next:

- run: pnpm exec is-mcp-ok https://example.com/mcp --save base.json
- run: pnpm exec is-mcp-ok http://localhost:3000/mcp --baseline base.json --max-increase 5%
.github/workflows/checks.yml

--summary <file> appends the result as Markdown: the verdict, a table of findings with a link to each code, the budget and, with --baseline, what each tool added. It holds no more than the text output, never a header, a token or the URL's path. Each table stops at 50 rows.

Pass the file GitHub gives each step to show it on the run's summary page:

- name: Check the MCP server
  run: pnpm exec is-mcp-ok http://localhost:3000/mcp --baseline mcp-tools.json --max-increase 5% --summary "$GITHUB_STEP_SUMMARY"
.github/workflows/checks.yml

To post it on the pull request, write it to a file and let a comment action post it. This uses marocchino/sticky-pull-request-comment, a third-party action that edits its one comment on each run:

permissions:
  contents: read
  pull-requests: write
steps:
  # …start the server as above
  - name: Check the MCP server
    id: mcp-check
    run: |
      summary=$(mktemp "$RUNNER_TEMP/is-mcp-ok.XXXXXX")
      status=0
      pnpm exec is-mcp-ok http://localhost:3000/mcp --baseline mcp-tools.json --max-increase 5% --summary "$summary" || status=$?
      if [ -s "$summary" ]; then
        printf 'summary=%s\n' "$summary" >> "$GITHUB_OUTPUT"
      fi
      exit "$status"
  - if: ${{ !cancelled() && github.event_name == 'pull_request' && steps.mcp-check.outputs.summary != '' }}
    uses: marocchino/sticky-pull-request-comment@v2
    with:
      header: is-mcp-ok
      path: ${{ steps.mcp-check.outputs.summary }}
.github/workflows/checks.yml

!cancelled() lets the comment run after a failed check, but only if the check wrote a summary. A pull request from a fork doesn't get pull-requests: write, so the summary page is the one that works everywhere. Pin the action to a commit SHA, as for any third-party action.

With the preview CLI on GitHub Actions, the text output also adds an annotation for each finding in a checked file.