MCP-Bastion security middleware for FastMCP servers. Prompt injection, PII, and rate-limit protection.
Project description
mcp-bastion-fastmcp
Security middleware for FastMCP servers powered by MCP-Bastion.
Protect any FastMCP server from prompt injection, PII leakage, and resource exhaustion with a single import.
Install
pip install mcp-bastion-fastmcp
Usage
from mcp.server.fastmcp import FastMCP
from mcp_bastion_fastmcp import secure_fastmcp
mcp = FastMCP("My Secure Server")
# Add MCP-Bastion security to your server
secure_fastmcp(mcp)
@mcp.tool()
def get_weather(city: str) -> str:
return f"Weather in {city}: 22C, sunny"
if __name__ == "__main__":
mcp.run(transport="streamable-http")
What it protects
- Scans all tool inputs for prompt injection
- Rate limits per session (15 calls, 60s timeout)
- Content filtering on inputs and outputs
License
MIT
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_bastion_fastmcp-0.1.0.tar.gz.
File metadata
- Download URL: mcp_bastion_fastmcp-0.1.0.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4621973c48ff653eb7a4a795177c6fcb2a92e36342f4ab3fb706cf88f43477d1
|
|
| MD5 |
1565f47695317b7fa4e35c95990d392f
|
|
| BLAKE2b-256 |
4d6fca6b47e839e7f4d866ee2fabaae25994686e4d11c7838a3466839545ece1
|
Provenance
The following attestation bundles were made for mcp_bastion_fastmcp-0.1.0.tar.gz:
Publisher:
publish-integrations.yml on vaquarkhan/MCP-Bastion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_bastion_fastmcp-0.1.0.tar.gz -
Subject digest:
4621973c48ff653eb7a4a795177c6fcb2a92e36342f4ab3fb706cf88f43477d1 - Sigstore transparency entry: 1280534651
- Sigstore integration time:
-
Permalink:
vaquarkhan/MCP-Bastion@78773d41fa839a374f34fe287b2e0fda3484c8dd -
Branch / Tag:
refs/tags/integration-v0.1.19 - Owner: https://github.com/vaquarkhan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-integrations.yml@78773d41fa839a374f34fe287b2e0fda3484c8dd -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_bastion_fastmcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_bastion_fastmcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fa5cc9ae762e5700318b414ec0f1cc625d54cdbccc130431bd3e27cbd6b7ba6
|
|
| MD5 |
7570693df08af607eef1d784219a81bb
|
|
| BLAKE2b-256 |
51d0a94f9af7c0c82e492f1817659ff2ca3823c012e8477bd3845cfbc3263e13
|
Provenance
The following attestation bundles were made for mcp_bastion_fastmcp-0.1.0-py3-none-any.whl:
Publisher:
publish-integrations.yml on vaquarkhan/MCP-Bastion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_bastion_fastmcp-0.1.0-py3-none-any.whl -
Subject digest:
1fa5cc9ae762e5700318b414ec0f1cc625d54cdbccc130431bd3e27cbd6b7ba6 - Sigstore transparency entry: 1280534657
- Sigstore integration time:
-
Permalink:
vaquarkhan/MCP-Bastion@78773d41fa839a374f34fe287b2e0fda3484c8dd -
Branch / Tag:
refs/tags/integration-v0.1.19 - Owner: https://github.com/vaquarkhan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-integrations.yml@78773d41fa839a374f34fe287b2e0fda3484c8dd -
Trigger Event:
push
-
Statement type: