mcp-ax-lint
v0.2.1
Published
Check an MCP server's tools against AX Rules v1 and the AX Field Guide: findings with evidence and severity, no score.
Maintainers
Readme
ax-lint
Check an MCP server's tools the way an agent meets them. ax-lint reads your server's tool definitions (and, if you ask, calls its read-only tools with tricky arguments) and reports what will make an AI agent guess:
- empty results that don't say what was searched;
- errors that don't say what to do next;
- arguments with no shape or unit;
- missing risk annotations;
- lists with no limit;
- names that change style from tool to tool.
Every finding comes with:
- the evidence, meaning the exact field or response;
- the fix;
- a fixed severity (Critical, High, Medium or Low) and a link to its rule in AX Rules v1;
- the heuristic from the free AX Field Guide that explains why it matters.
$ npx mcp-ax-lint https://example.com/mcp --probe
WARN E3 search_refunds: An empty result says nothing about what was searched, so the agent can't tell
'none exist' from 'wrong scope' or 'search failed'.
evidence: search_refunds({"order_id":"zzq-ax-lint-no-match-7f3a"}) → "[]"
fix: Return the match count, the scope and filters applied (including defaults like date windows), and where else to look.
E3 Empty result without scope · Medium: https://spektiv.io/tools/rules#e3-empty-result-without-scope-medium-probe
H-02 Affirmative Null Observations: https://spektiv.io/field-guide/heuristics/affirmative-null-observationsPart of the AX toolkit
ax-lint is one step of four. Each one fits a different moment:
- Design with the AX Field Guide: the heuristics behind every rule. Read it while you shape your tools.
- Lint every commit with ax-lint: fast, deterministic checks in CI.
- Rehearse before launch with mcp-sauna: an agent reviews the whole server, adds judgment and runs real tasks through safe calls.
- Run in production with Neurouter: an open-source MCP gateway with evals and an agent-readiness score.
ax-lint and mcp-sauna share one rulebook, AX Rules v1: the same rule ids and severities. ax-lint checks the rules it can decide without judgment; mcp-sauna applies all of them.
No score, on purpose
A lint finding is a claim about the interface: "this empty result gives no scope." It doesn't measure whether agents finish tasks on your server, and no static check can. So ax-lint prints findings, not a grade. To measure task success you need evals: real tasks, real models, counted outcomes. A score belongs there, like Neurouter's readiness score, not in a linter.
Each run ends with a summary from AX Rules v1: a label from the most severe
finding (Do not ship, Fix before production, Fix soon, Polish, or No findings in scope) and coverage. Coverage is
incomplete when a check that applies was skipped: probes were off, a tool wasn't probed because it isn't
annotated read-only, or a probe couldn't build safe arguments. The skipped checks are listed. Rules ax-lint never
checks (T1, T2, R3, E2, S2, S3, S5) need judgment or test identities; mcp-sauna covers them. --fail-on still uses
levels, not the label. The summary is in JSON as summary and in SARIF as run.properties.summary.
skipped E1, E3, SPEC-3, R2: probes off (run with --probe on a server you own)
Not checked by ax-lint: T1, T2, R3, E2, S2, S3, S5 need judgment or test identities; mcp-sauna covers them.
Summary: Fix before production · coverage: incomplete (ax-rules-v1)We do check that the rules point at things that matter. See Does it matter? below.
Use it
The npm package is mcp-ax-lint; the command it installs is ax-lint (npm i -g mcp-ax-lint).
npx mcp-ax-lint https://your-server.example/mcp # Streamable HTTP
npx mcp-ax-lint -- node dist/server.js # stdio
npx mcp-ax-lint --probe -- node dist/server.js # also call read-only tools with crafted arguments
npx mcp-ax-lint --format sarif -- node dist/server.js # for GitHub code scanning (also: --format json)| Option | |
|---|---|
| --probe | Call tools annotated readOnlyHint: true with crafted arguments: a query that can't match, an invalid value, an unknown id, a default call. Only on servers you own. |
| --probe-tools a,b | Probe exactly these tools, including ones not annotated read-only. Point it at a test server. |
| --fail-on error\|warn\|info\|never | Exit 1 if a finding at this level or worse exists. Default error. |
| --config .ax-lint.json | Ignore rules, with a reason: { "ignore": { "T6": "examples are in our docs", "S1": { "tools": ["legacy_export"], "reason": "…" } } } |
GitHub Action, with findings shown in code scanning:
- uses: prspktvs/ax-lint@v0
with:
command: node dist/server.js # or: url: https://staging.example.com/mcp
probe: true # only for your own server
fail-on: warnRules
Levels:
- error means it breaks the MCP spec.
- warn means agents are likely to guess wrong.
- info is worth a look.
Severity is fixed per rule by the rulebook. Rule ids, tests and severities come from AX Rules v1, which ax-lint shares with mcp-sauna. Rules marked signal catch a symptom of the rule; the full test needs mcp-sauna's judgment.
| Rule | Checks | Severity | Heuristic |
|---|---|---|---|
| SPEC-1 | Tool names follow MCP's naming rule and are unique | High | H-05 |
| SPEC-2 | inputSchema is an object schema | High | H-06 |
| S1 | Risk annotations are declared, and match the name (no read-only delete_…) | Medium | H-12 |
| S4 | Tools that create or send things accept an idempotency key | Medium | H-12 |
| S6 | Descriptions don't give the model orders ("you must always call…") | High | H-13 |
| T3 | Descriptions are long enough to say what, when and what comes back (signal) | Medium | H-09 |
| T4 | Required arguments have a description or constraint, so the agent doesn't guess shape or unit | High | H-10 |
| T5 | Id arguments say where the id comes from (signal, info) | Medium | H-07 |
| T6 | Tools with required arguments carry an example call (info) | Low | H-09 |
| T7 | One naming style across tool names | Medium | H-06 |
| T8 | One spelling per concept across arguments (order_id, never also orderId) | Medium | H-06 |
| C1 | Tool definitions stay under 5,000 estimated tokens (UTF-8 bytes / 4) | Medium | H-07 |
| R1 | List and search tools accept a limit or cursor, or declare a total, has-more or cursor field in outputSchema | High | H-03 |
| E3 (probe) | An empty result says what was searched | Medium | H-02 |
| E1 (probe) | Errors for bad arguments or unknown ids say what's wrong and what a valid call looks like | High | H-11 |
| SPEC-3 (probe) | Invalid arguments come back as a tool error the model can see, not a protocol error (info) | Low | H-11 |
| R2 (probe) | A default call doesn't return more than 5,000 estimated tokens (signal) | Medium | H-03 |
ax-lint 0.1 used other ids for five rules: H09-1 is now T6, H06-1 T7, H06-2 T8, SPEC-4 SPEC-3, and the
empty-result probe E2 is now E3. Old ids still work in --config ignores.
Does it matter? A small synthetic test
We built one small support desk twice, with the same data and the same business rules, and only the interface
different (fixtures/):
bad.tshas the problems ax-lint flags planted in it: a silent 30-day window that returns a bare[], an undocumented amount in cents, reason codes only the server knows, and"Error"as the only error message.good.tsfollows the Field Guide.
ax-lint finds exactly the planted problems in bad.ts (20 findings) and nothing at warn or error level in good.ts
(the test checks this against fixtures/expected.json).
Then we gave the same small local model (qwen2.5:3b via Ollama) three tasks on each server, five runs each:
| Task | Bad interface | Good interface | |---|---|---| | "Order 4471 arrived cracked, refund it" (it was already refunded 46 days ago) | 0/5 decided correctly: every run tried to refund again | 4/5 | | "Refund order 5502 in full" ($180) | 0/5 | 5/5 | | Control: look up a recent refund's date | 5/5 | 5/5 |
Read it for what it is:
- The test is tiny: one model, 30 runs, and a synthetic server we designed.
- The failures can't be pinned on one rule: each task trips several flagged problems at once.
- It doesn't prove ax-lint's rules predict outcomes in general. It shows that the kind of problem they flag can decide whether a small model gets a task right.
Next we test each rule on its own (fix only what one rule flags, re-run) on a larger harness. Re-run this test with
npm run eval -- 5 qwen2.5:3b (needs Ollama).
Privacy
ax-lint runs locally and sends nothing anywhere except to the server you point it at. It identifies itself to that
server as ax-lint with its version.
License
Code: MIT. The heuristics it links to are from Designing for Agents, the AX Field Guide by Spektiv, CC BY 4.0.
