Author-side hardening primitives for Python MCP servers.
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"mcp-server-shield","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# mcp-server-shield `mcp-server-shield` is a Python-first hardening library for MCP server authors. It is not a scanner, gateway, proxy, or hosted security service. It protects the MCP tool function boundary directly: validate arguments before execution, use safe wrappers for dangerous operations, filter outputs before they reach the MCP client, lint tool descriptions, lock tool manifests, and emit structured audit logs. The project is built for the way FastMCP and the official Python MCP SDK expose tools: ordinary Python functions decorated as tools. ## Install ```bash pip install mcp-server-shield ``` For local development: ```bash pip install -e ".[dev]" ``` ## Quickstart ```python from mcp_server_shield import ShieldPolicy, shield from mcp_server_shield.output_filters import PromptInjectionFilter, SecretRedactor from mcp_server_shield.validators import PathGuard, StringGuard, URLGuard policy = ShieldPolicy.strict( paths={"file_path": PathGuard(root="./workspace", read=True, write=False)}, urls={"url": URLGuard(allowed_schemes=["https"], allowed_hosts=["api.github.com"])}, strings={ "query": StringGuard( max_len=5000, deny_substrings=["ignore previous instructions"], ) }, output_filters=[SecretRedactor(), PromptInjectionFilter()], ) @shield(policy) def read_file(file_path: str) -> str: with open(file_path, encoding="utf-8") as handle: return handle.read() ``` ## FastMCP Example Use `@shield(policy)` closest to the function so FastMCP sees the preserved signature and metadata after the wrapper is applied: ```python from fastmcp import FastMCP from mcp_server_shield import ShieldPolicy, shield from mcp_server_shield.validators import PathGuard mcp = FastMCP("secure-files") policy = ShieldPolicy.strict( paths={"file_path": PathGuard(root="./workspace", read=True, write=False)}, ) @mcp.tool() @shield(policy) def read_file(file_path: str) -> str: with open(file_path, encod…
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.