Skip to main content

SMCP - Secure Model Context Protocol

A security-focused wrapper library for MCP (Model Context Protocol) servers, providing multiple layers of protection through conditional guards that activate only when needed.

Features

  • Conditional Security Guards: Each security layer activates only when its required configuration is present
  • Mutual TLS Support: Automatic certificate-based authentication
  • Host Allowlisting: Outbound connection validation
  • Input Sanitization: Prompt and parameter filtering
  • Destructive Action Confirmation: Queue-based approval system for dangerous operations
  • Tamper-proof Logging: SHA-chained append-only audit logs
  • Universal Coverage: Same decorator factory works for tools, prompts, and retrieval

Quick Start

from smcp import FastSMCP as FastMCP
from smcp import tool, prompt

# Configure security features (all optional)
cfg = {
    "ca_path": "ca.pem",
    "cert_path": "server.pem", 
    "key_path": "server.key",
    "ALLOWED_HOSTS": ["api.internal.local", "10.0.0.5"],
    "SAFE_RE": r"^[\w\s.,:;!?-]{1,2048}$",
    "LOG_PATH": "/var/log/smcp.log"
}

app = FastMCP("myserver", smcp_cfg=cfg)

@tool(confirm=True)  # Requires approval
def delete_user(uid: str):
    ...

@prompt()  # Auto-filtered if SAFE_RE present
def chat(prompt: str):
    ...

Security Guards

Feature Activation Trigger Purpose
Mutual TLS ca_path, cert_path, key_path in config Certificate-based authentication
Host Allowlist Non-empty ALLOWED_HOSTS Outbound connection validation
Input Filtering SAFE_RE or MAX_LEN defined Sanitize prompts and parameters
Action Confirmation confirm=True on decorator Queue destructive operations for approval
Audit Logging LOG_PATH set Tamper-proof operation logging

CLI Tools

# Generate certificates
smcp-mkcert --ca-name "MyCA" --server-name "myserver.local"

# Approve queued actions  
smcp-approve <action-id>

Installation

From PyPI.org (Public)

pip install bizteam-smcp

From Private PyPI Server

# Using private PyPI server
pip install --extra-index-url https://bizteamai.com/pypi/simple/ bizteam-smcp

Upgrading to Business Edition

For additional features and enterprise support, a business edition is available:

pip install --extra-index-url https://bizteamai.com/pypi/simple/ bizteam-smcp-biz

Contact: business@bizteamai.com for more information.

License

MIT License

Metadata

Release files for bizteamai-smcp 1.25.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 bizteamai-smcp 1.25.0
File Size Uploaded Provenance Actions
bizteamai_smcp-1.25.0.tar.gz 26.1 kB Without provenance Details for bizteamai_smcp-1.25.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bizteamai-smcp 1.25.0
File Interpreter ABI Platform Actions
bizteamai_smcp-1.25.0-py3-none-any.whl Python 3 none any Details for bizteamai_smcp-1.25.0-py3-none-any.whl

Total release size: 53.3 kB

Release files / bizteamai_smcp-1.25.0.tar.gz

Download URL bizteamai_smcp-1.25.0.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
103be11c7a449dce93dd6ff387de8cb1e97918a593dacb4694a410bddfc9815f
BLAKE2b-256 checksum
How to use checksums
b9649fbc9763ed2c9a339d175454b7d686dbe64a9f2fd0930b89daa202ff276b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / bizteamai_smcp-1.25.0-py3-none-any.whl

Download URL bizteamai_smcp-1.25.0-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d45f2cab8ccc9f20e987ef42d79d3b8ab2cda9d02b98a4d9a274b145259db769
BLAKE2b-256 checksum
How to use checksums
3aefc459a933e92e27c72369ce345a52357700d4a56ef3c6cc88e6bed8f73598
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Security for bizteamai-smcp 1.25.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.

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