Contracts, drift detection and security checks for MCP servers — in CI and in production.
Project description
ToolGuard
Contracts, drift detection and security checks for MCP servers — in CI and in production.
Know when an MCP server changes — yours, or the one you depend on.
⚠️ Pre-release. The full toolkit ships before the MCP 2026-07-28 spec lands.
- ✅
mcp-toolguard scan— snapshot an MCP server's tools, schemas, capabilities and descriptions (stdio & streamable HTTP), with security findings- ✅
mcp-toolguard baseline [--update]— commit a reference snapshot to your repo- ✅
mcp-toolguard diff— classified diff against the baseline: breaking / compatible / suspicious- ✅
mcp-toolguard ci— exit codes and Markdown output for any CI, plus spec-version matrix validation (2025-11-25 + 2026-07-28)- ✅ 15 security rules against tool poisoning, exfiltration and lying annotations
- ✅ A GitHub Action wrapping all of the above:
toolguard-io/action@v1
Usage
# Snapshot a server over stdio…
mcp-toolguard scan "python -m my_mcp_server"
# …or over streamable HTTP; --json emits the full canonical snapshot
mcp-toolguard scan https://api.example.com/mcp --json
# Save the reference contract to .toolguard/baseline.json (commit it!)
mcp-toolguard baseline https://api.example.com/mcp
# What changed since the baseline? breaking / compatible / suspicious
mcp-toolguard diff https://api.example.com/mcp
# Gate your CI: fails on breaking changes or spec errors (policy: breaking)
# --policy audit never fails; --policy strict fails on any change
# Also validates against the MCP spec matrix: 2025-11-25 + 2026-07-28 (RC)
mcp-toolguard ci https://api.example.com/mcp --markdown
# Accepting a contract change is explicit and visible in code review:
mcp-toolguard baseline https://api.example.com/mcp --update
Exit codes: 0 ok · 1 policy failure (ci) · 2 operational error.
Security rules
Every scan and ci runs a pack of 15 rules over the snapshot — the text and
schemas that reach your model's context:
- TG1xx — tool poisoning / prompt injection: imperative instructions to the
model ("ignore previous instructions", "do not tell the user"), hidden
<IMPORTANT>-style tags, cross-tool coercion, references to~/.sshand other sensitive files, embedded URLs, encoded blobs, invisible characters. - TG2xx — exfiltration via schemas: credential-shaped input parameters, environment-variable harvesting, conversation harvesting, unconstrained input schemas.
- TG3xx — broad permissions and lying annotations: arbitrary-execution
tools,
readOnlyHint/destructiveHintcontradicted by what the tool says it does, credentials returned in outputs.
In ci, findings already present in the committed baseline are the accepted
state; only new findings gate. Policy breaking fails on new high-severity
findings; strict fails on any new finding.
Install
uvx mcp-toolguard --version
# or
pip install mcp-toolguard
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_toolguard-0.2.0.tar.gz.
File metadata
- Download URL: mcp_toolguard-0.2.0.tar.gz
- Upload date:
- Size: 92.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86e1ceb52bfbd6611f5fee900952d151c1674fd7f0d223ba7212ad61edb4a950
|
|
| MD5 |
70f0214b85b9d738ee1b2695459e0927
|
|
| BLAKE2b-256 |
b509d0ef05b30bd5df1d516bde623e757d5b5a09e9f26a987a8d59ce0b81551c
|
File details
Details for the file mcp_toolguard-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcp_toolguard-0.2.0-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
721b4beb4809583b44f7bed79c0a77049683063343191ba373303c84dc4abd0c
|
|
| MD5 |
29853e4fe72fdf37a93f5890cd16c3f8
|
|
| BLAKE2b-256 |
0ecaf96e108de610b61d71fb5cc9b52485141a4793b510889bdd6b401d0aa705
|