Install: pip install mcp-testbench |
PyPI: pypi.org/project/mcp-testbench
Running the lint
mcp-testbench lint -- python my_server.py
mcp-testbench lint --url http://localhost:8000/mcp
mcp-testbench lint --definition server.json --strict # --strict also fails on warnings
Each finding carries a rule id, a severity (error /
warning), the surface and name, and a message. The command
exits 1 on any error. In Python: mcp_testbench.lint_schema(schema);
in pytest: the mcp_lint fixture or
mcp_testbench.plugin.assert_no_lint_errors. Parameter rules
recurse into nested object properties and array items, resolving local
$ref pointers.
The rules
| Rule id | Severity | Surface | What it flags |
|---|---|---|---|
tool-missing-description | error | tool | no / empty description |
tool-short-description | warning | tool | description < 20 chars, too short to route on |
tool-poisoning-pattern | error | tool | instruction-injection phrases ("ignore previous instructions", "you must always...", "do not tell the user", <important> tags, ...) |
tool-name-format | warning | tool | name is not snake_case |
tool-name-too-long | warning | tool | name > 64 chars |
tool-name-collision | error | tool | two tools share a name (case-insensitive) |
tool-missing-output-schema | warning | tool | no outputSchema declared |
param-missing-type | error | tool | parameter with no type / $ref / enum / composition |
param-untyped-object | warning | tool | type: object with no properties declared |
credential-param-unprotected | warning | tool | credential-sounding parameter name (password, api_key, token, ...) with no format hint |
param-required-with-default | error | tool | required parameter that also declares a default |
param-string-no-maxlength | warning | tool | string parameter with no maxLength |
param-single-value-enum | warning | tool | enum with exactly one value (use const) |
param-case-duplicate | error | tool | two parameters in one tool differ only by casing |
prompt-missing-description | error | prompt | no / empty description |
prompt-short-description | warning | prompt | description < 20 chars |
prompt-poisoning-pattern | error | prompt | instruction-injection phrases in a prompt description |
prompt-argument-missing-description | warning | prompt | a prompt argument has no description |
resource-missing-description | warning | resource | no / empty description |
resource-missing-mimetype | warning | resource | no mimeType declared |
resource-invalid-uri | error | resource | URI has no scheme |
resource-suspicious-scheme | error | resource | scriptable / inline-data scheme (javascript:, vbscript:, data:) |
Counting note: earlier releases undercounted this catalogue
by one in their branding; the enumerated catalogue in the README and the
lint module docstring lists 22 rule ids -- the table above
reproduces all of them, and the branding was corrected to the 22-rule
lint in v0.3.1.
Why descriptions are linted so hard
An agent chooses tools from their descriptions. A missing or five-word description is not a style issue -- it is a routing failure waiting to happen, and a description carrying instruction-injection phrases ("ignore previous instructions", "do not tell the user") is the classic tool-poisoning pattern. That is why description rules are errors, not warnings, and why the lint covers prompts and resources too, not only tools.