Skip to content

action: lint a stdio server with the command input - #174

Open
abu-tahir-0 wants to merge 1 commit into
patsypppe:mainfrom
abu-tahir-0:feat/action-lint-command
Open

abu-tahir-0 wants to merge 1 commit into
patsypppe:mainfrom
abu-tahir-0:feat/action-lint-command

Conversation

@abu-tahir-0

Copy link
Copy Markdown

Problem

action.yml only knew about endpoint, so a repository that ships its own MCP server could not lint it in CI. Closes #146.

Solution

  • New command input. When set, the scan step is skipped and a lint step runs toolgauge lint --command "$COMMAND" --format markdown, writes the report to $GITHUB_STEP_SUMMARY, and records the exit code in the same exit-code output.
  • command together with endpoint or targets is refused with ::error:: and exit code 2 rather than silently ignoring one of them; gate, config, baseline, snapshot and SARIF upload do not apply to lint and are documented as such in the input description.
  • The gate step reads steps.scan.outputs.exit-code || steps.lint.outputs.exit-code, so the job still fails on lint failures.
  • SARIF upload is gated on command == ''.
  • docs/USING.md lists the new input.

Testing

  • tests/harness/test_distribution.py executes the lint step as the bash it is, the same way the existing tests execute the scan step:
    • a stdio server with an undescribed parameter yields exit code 1 and a summary containing the failing rule;
    • command plus endpoint yields exit code 2 and a summary saying both were given;
    • every flag the lint step passes is read from the real lint command definition, so a typo cannot pass the test.
  • pytest tests/harness/test_distribution.py — 14 passed.
  • ruff check . — clean.

Impact

The Action can now gate a repository's own MCP server on its tool manifest on every push, without a running endpoint.

A repository that ships its own MCP server had no way to lint it from
the Action. Setting command runs toolgauge lint instead of a scan,
writes the Markdown report to the job summary, and still applies the
exit code through the same gate step. SARIF upload is skipped, since
lint has no SARIF report.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub Action: lint a stdio server

1 participant