Skip to main content

🛡️ MCPatrol

Lighthouse for MCP servers. Point it at any HTTP MCP endpoint and get back a security, cost, and quality report card in 30 seconds.

PyPI License: MIT Python 3.10+

Why this exists

MCP servers are exploding in production — every major AI lab now supports the protocol, and they're being deployed faster than they're being audited. Public reporting (RSAC 2026, Perplexity CTO at Ask 2026) flagged real problems:

  • Tool descriptions burning 40-50% of context windows before agents do any work
  • Prompt-injection through tool descriptions ("rugpull" attacks)
  • Auth handled inconsistently — many servers ship with bearer-token gaps
  • Error responses leaking stack traces, file paths, and env vars

MCPatrol is a free, open-source CLI that tests for all of these in one command. No infrastructure, no signup. Audit a server, get an HTML report card, fix what matters.

Install

pip install mcpatrol

Use

# Audit a remote MCP server (HTTP or SSE)
mcpatrol https://my-mcp-server.com/sse

# With auth header
mcpatrol https://my-mcp-server.com/sse --auth-header "Bearer xyz123"

# Skip the slow tests (no latency loop, no Claude scoring)
mcpatrol https://my-mcp-server.com/sse --quick --no-quality

# Generate a demo report (no network, no API calls)
mcpatrol --demo

The output is a self-contained mcpatrol-report.html that opens in your browser. Share it, screenshot it, commit it to your repo.

What it checks

Category Examples
Security TLS / plain HTTP, missing auth, prompt-injection in descriptions, error disclosure (stack traces, file paths, env vars), unmarked destructive tools, schema completeness
Cost Total tokens burned by tool descriptions before any work happens. Compared against published industry benchmarks (median ~4,200 tokens; heavy ~8,500).
Tool clarity (optional, uses Claude API) Asks Claude Sonnet to score each tool's description on a 1-10 rubric and suggest improvements
Reliability Latency (median, p95, max), success rate over 10 calls, error patterns

Every finding includes a CWE-style category, severity, and concrete remediation.

Honest scope

MCPatrol is a starting point, not a comprehensive pentest. It catches the common, public attack classes documented in the early-2026 MCP security research. It will not catch sophisticated zero-days, server-side bugs requiring authentication you don't have, or anything that requires source-code access.

Treat it like Lighthouse for the web — a fast first pass that flags the obvious problems, not a SOC 2 audit.

Quality scoring needs your API key

The optional --with-quality mode uses Claude to score tool descriptions. It uses your Anthropic API key:

export ANTHROPIC_API_KEY=sk-ant-...
mcpatrol https://my-mcp-server.com/sse

Cost: ~$0.001 per tool. Auditing a 40-tool server runs about 4 cents. Skip with --no-quality if you'd rather pay zero.

MCPatrol never sees, transmits, or stores your API key — it goes from your env directly to Anthropic.

What's coming

  • stdio (local) MCP servers via --launch "command args"
  • More security probes: SSE state-confusion, race conditions, auth flow tests
  • CI mode: exit non-zero if grade drops below threshold
  • JSON Schema spec for the findings format (so you can build dashboards on it)
  • Markdown summary output (for PR comments)

Contributing

This is a brand-new project. Open issues, suggest probes, or PR new ones — every probe should map to a real, public attack class with a citation in the docstring.

License

MIT. Use it, fork it, ship it.


Built with care, in public.

Metadata

Release files for mcpatrol 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcpatrol 0.1.0
File Size Uploaded Provenance Actions
mcpatrol-0.1.0.tar.gz 26.7 kB Without provenance Details for mcpatrol-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcpatrol 0.1.0
File Interpreter ABI Platform Actions
mcpatrol-0.1.0-py3-none-any.whl Python 3 none any Details for mcpatrol-0.1.0-py3-none-any.whl

Total release size: 54.3 kB

Release files / mcpatrol-0.1.0.tar.gz

Download URL mcpatrol-0.1.0.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
957014f3678cface8e9720582437a337f2c655ddff62625a01acb3f54001d930
BLAKE2b-256 checksum
How to use checksums
21b080fa282021de4c779f6898bc8d1d0aa1ac3a86d51af2f7bd0dfe95d82de0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.2

Release files / mcpatrol-0.1.0-py3-none-any.whl

Download URL mcpatrol-0.1.0-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7c10cf894975cd6e59812cf22f0ecb4ad9dc6df2df064ffc94e0965ff1b37ad
BLAKE2b-256 checksum
How to use checksums
9c84d25c034550f1a8eacd1deb7465c9c1e77efe275b81245518e10dc028514e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.2

Security for mcpatrol 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page