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;
- the heuristic from the free AX Field Guide that explains why it matters.
$ npx mcp-ax-lint https://example.com/mcp --probe
WARN E2 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.
H-02 Affirmative Null Observations: https://spektiv.io/field-guide/heuristics/affirmative-null-observations
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.
We do check that the rules point at things that matter. See Does it matter? below.
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": { "H09-1": "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: warn
Levels:
- error means it breaks the MCP spec.
- warn means agents are likely to guess wrong.
- info is worth a look.
Rule ids are shared with mcp-sauna where they overlap.
| Rule | Checks | Heuristic |
|---|---|---|
| SPEC-1 | Tool names follow MCP's naming rule and are unique | H-05 |
| SPEC-2 | inputSchema is an object schema |
H-06 |
| S1 | Risk annotations are declared, and match the name (no read-only delete_…) |
H-12 |
| S4 | Tools that create or send things accept an idempotency key | H-12 |
| S6 | Descriptions don't give the model orders ("you must always call…") | H-13 |
| T3 | Descriptions are long enough to say what, when and what comes back | H-09 |
| H09-1 | Descriptions carry an example call (info) | H-09 |
| T4 | Required arguments have a description or constraint, so the agent doesn't guess shape or unit | H-10 |
| T5 | Id arguments say where the id comes from (info) | H-07 |
| R1 | List and search tools accept a limit or cursor | H-03 |
| H06-1 | One naming style across tool names | H-06 |
| H06-2 | One spelling per concept across arguments (order_id, never also orderId) |
H-06 |
| C1 | The tool list isn't so large it costs thousands of tokens every turn | H-07 |
| E2 (probe) | An empty result says what was searched | H-02 |
| E1 (probe) | Errors for bad arguments or unknown ids say what's wrong and what a valid call looks like | H-11 |
| SPEC-4 (probe) | Invalid arguments come back as a tool error the model can see, not a protocol error (info) | H-11 |
| R2 (probe) | A default call doesn't return thousands of tokens | H-03 |
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).
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.
Code: MIT. The heuristics it links to are from Designing for Agents, the AX Field Guide by Spektiv, CC BY 4.0.