mcpvet
Test, lint, and vet your MCP servers — pytest + eslint + contract testing for MCP, in one CLI.
Why
- ~40% of deployed MCP servers ship a broken tool — an invalid schema, a missing description, or stdout that corrupts the protocol. Agents fail silently and you find out from a user.
- Schema drift breaks agents without a stack trace. Rename an argument, tighten a type, drop a tool — the client just stops calling it. Nothing errors. Nothing tells you.
- Inspector is manual-only. Great for poking at a server by hand, useless in CI. There's no
pytestfor MCP. Now there is.
mcpvet catches all three before they reach production, and it runs in your pipeline.
Quickstart
pip install mcpvet # or: uvx mcpvet ...
# Lint any server — command, URL, or client config
mcpvet lint -- npx -y @modelcontextprotocol/server-filesystem /tmp
mcpvet lint http://localhost:8000/mcp
# Write tests once, run them forever
mcpvet test mcpvet.test.yaml --format junit
# Catch breaking changes between releases
mcpvet snapshot -o v1.json -- python my_server.py
mcpvet diff v1.json "python my_server.py"
Test suites
Declarative YAML — call a tool, assert on the result. No test harness to wire up.
# mcpvet.test.yaml
target:
command: ["npx", "-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
tests:
- name: list_directory returns entries
tool: list_directory
args: { path: "/tmp" }
expect:
- type: success
- type: contains
value: "tmp"
- type: latency_under
ms: 2000
- name: bad path returns proper MCP error
tool: list_directory
args: { path: "/nonexistent" }
expect:
- type: error
message_contains: "not found"
Expectation types: success, error, contains, equals, regex, latency_under, jsonschema.
Output formats: pretty (default), json, junit.
Lint rules
| Rule | Severity | Checks |
|---|---|---|
| MV101 | error | inputSchema is not a valid JSON Schema |
| MV102 | warning | inputSchema root type is not "object" |
| MV201 | error | tool has no description — models can't choose it reliably |
| MV202 | warning | description is too short (< 10 chars) to be useful |
| MV301 | error | non-protocol output on stdout corrupts the stdio transport |
GitHub Action
- run: pip install mcpvet
- run: mcpvet lint --format json -- python my_server.py
- run: mcpvet test --format junit > results.xml
Exit codes
| Code | Meaning |
|---|---|
| 0 | clean — no findings, all tests passed, no breaking changes |
| 1 | findings, test failures, or breaking changes detected |
| 2 | execution error — couldn't reach or inspect the server |
Roadmap
- record / mock — record real server traffic, replay it as a mock in tests.
- scan — security heuristics: prompt-injection surface, over-broad tool scopes.
- bench — latency and throughput benchmarks with regression tracking.
License
MIT
Metadata
Release files for mcpvet 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcpvet-0.1.0.tar.gz | 35.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcpvet-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.2 kB
Release files / mcpvet-0.1.0.tar.gz
| Download URL | mcpvet-0.1.0.tar.gz |
|---|---|
| Size | 35.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f1b6ca1224a8dd572d5d03d0c90f8a7a4e577a399e97bf79f1a7729b68a18f5
|
|
BLAKE2b-256 checksum How to use checksums |
4c10a6cf183e1ed7caf7a38aebfbb85ecb66a94af1325e9cd6bdc14a6a78b3b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.
Transparency logRelease files / mcpvet-0.1.0-py3-none-any.whl
| Download URL | mcpvet-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a0e4645f47e96ccd06d62821e73fc8c037140c48af6edd84336a7b974c47637
|
|
BLAKE2b-256 checksum How to use checksums |
a8c3ab9fc4761d2067e5d83362b64eb2b1d98fa9db63f89c692a4f662f2fced2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.
Transparency logSecurity for mcpvet 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for mcpvet-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.