Skip to main content

bastionsupply

MCP supply-chain security scanner. Point it at an MCP server's tool definitions and it flags the supply-chain attacks before you install: tool-poisoning, tool-shadowing, hidden unicode, secret solicitation, dangerous capabilities, and rug-pull drift.

The pre-flight leg of the bastion family:

tool job
bastionsupply scan an MCP server before you trust it
agentbastion prevent — firewall around a running agent
bastionprobe attack — pentest your agent with injections
bastiontrace investigate — forensics on an agent trace

No network, no LLM, no dependencies — pure static analysis of what a server claims about itself, which is exactly where the attack hides.

Install

pip install bastionsupply

Use

# offline: scan a tools/list JSON dump
bastionsupply scan tools.json

# live: spawn a stdio MCP server and scan the tools it advertises
bastionsupply scan --stdio "npx -y @some/mcp-server" --live

# live: scan every server in an MCP client config
bastionsupply scan --config ~/.config/mcp.json --live

# rug-pull: pin tool hashes now, detect silent changes later
bastionsupply lock tools.json -o supply.lock
bastionsupply verify tools.json --lock supply.lock

# bridge: emit an agentbastion tool policy (default-deny, risky tools blocked)
bastionsupply harden tools.json -o policy.yaml

scan exits non-zero when anything critical or high is found — drop it in CI to fail a build that pulls in a poisoned server.

What it catches

check severity what it means
tool-poisoning critical instructions aimed at the model — in the tool description or a parameter
hidden-unicode critical format / control / private-use chars (zero-width, bidi, tag) hiding in a name, description, or parameter
homoglyph-name high tool name mixes scripts (e.g. Cyrillic + Latin) — look-alike impersonation of another tool
tool-shadowing high a tool's description talks about other tools — hijacking their behavior
secret-solicitation high a parameter asks the model to hand over an api_key / token / password
sensitive-capability high/med tool exposes exec, delete, network, secret-read, or privilege escalation
rug-pull (verify) — tool definitions changed since you pinned them

Library

from bastionsupply import load_json_file, scan, to_text, to_policy_yaml

report = scan(load_json_file("tools.json"))
print(to_text(report))
print("safe" if report.ok else "risky", report.risk)

Live fetch note

--stdio / --config --live spawn the server process to call tools/list. Only run them on servers you intend to execute. Offline scan tools.json never runs anything. Live fetch is bounded — a hostile server that hangs or streams a giant reply is cut off by the timeout and a per-message size cap, not left to hang or exhaust memory.

HTTP/SSE transport isn't implemented yet — stdio covers the common locally-installed case.

MIT.

Metadata

Release files for bastionsupply 0.2.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 bastionsupply 0.2.0
File Size Uploaded
bastionsupply-0.2.0.tar.gz 18.5 kB Details

Built distribution (wheel)

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

Total release size: 36.4 kB

Release files / bastionsupply-0.2.0.tar.gz

Download URL bastionsupply-0.2.0.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
85c7876c2d6a94f4bc9f7a831a5801b72109a54d37c22fb9f4f3e18be438c92f
BLAKE2b-256 checksum
How to use checksums
28e7c234233ccc46075a2d279b706192ba3a2aeccd6e6b5db6223695d822d037
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release files / bastionsupply-0.2.0-py3-none-any.whl

Download URL bastionsupply-0.2.0-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c70c16dac67c82ad2afaa83ab30e00203f8358c86d232388ba51d95c21068fa4
BLAKE2b-256 checksum
How to use checksums
bf1a208a44e71bba94f9594f777bf7c9fb78ecd794df868e7c6b4ba403cdd0ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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