MCP lint rules

Every rule in the mcp-testbench lint -- what it flags, on which surface, and how severe it is.

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 idSeveritySurfaceWhat it flags
tool-missing-descriptionerrortoolno / empty description
tool-short-descriptionwarningtooldescription < 20 chars, too short to route on
tool-poisoning-patternerrortoolinstruction-injection phrases ("ignore previous instructions", "you must always...", "do not tell the user", <important> tags, ...)
tool-name-formatwarningtoolname is not snake_case
tool-name-too-longwarningtoolname > 64 chars
tool-name-collisionerrortooltwo tools share a name (case-insensitive)
tool-missing-output-schemawarningtoolno outputSchema declared
param-missing-typeerrortoolparameter with no type / $ref / enum / composition
param-untyped-objectwarningtooltype: object with no properties declared
credential-param-unprotectedwarningtoolcredential-sounding parameter name (password, api_key, token, ...) with no format hint
param-required-with-defaulterrortoolrequired parameter that also declares a default
param-string-no-maxlengthwarningtoolstring parameter with no maxLength
param-single-value-enumwarningtoolenum with exactly one value (use const)
param-case-duplicateerrortooltwo parameters in one tool differ only by casing
prompt-missing-descriptionerrorpromptno / empty description
prompt-short-descriptionwarningpromptdescription < 20 chars
prompt-poisoning-patternerrorpromptinstruction-injection phrases in a prompt description
prompt-argument-missing-descriptionwarningprompta prompt argument has no description
resource-missing-descriptionwarningresourceno / empty description
resource-missing-mimetypewarningresourceno mimeType declared
resource-invalid-urierrorresourceURI has no scheme
resource-suspicious-schemeerrorresourcescriptable / 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.