Skip to main content

cerberus-mcp

MCP (Model Context Protocol) server instrumentation for Cerberus API monitoring.

Drop-in replacement for FastMCP that captures tool, resource, and prompt call metrics and streams them to the Cerberus analytics pipeline.

Installation

pip install cerberus-mcp

Quick Start

Replace FastMCP with CerberusMCP — a single-line change:

from cerberus_mcp import CerberusMCP

mcp = CerberusMCP(
    "my-server",
    cerberus_config={
        "token": "your-api-key",
        "client_id": "your-client-id",
        "ws_url": "wss://your-cerberus-backend:8765",
    }
)

@mcp.tool()
def get_weather(location: str) -> str:
    """Get weather for a location."""
    return f"Sunny in {location}"

@mcp.resource("config://settings")
def get_settings() -> str:
    """Return server settings."""
    return '{"theme": "dark"}'

@mcp.prompt()
def summarize(text: str) -> str:
    """Summarize text."""
    return f"Please summarize: {text}"

All tool calls, resource reads, and prompt invocations are automatically captured with:

  • Execution timing (duration_ms)
  • Sanitized arguments (sensitive values redacted)
  • Error tracking
  • Result summaries
  • MCP client identity (name, version) and session correlation

Events are sent asynchronously via WebSocket to the Cerberus event_ingest backend using the same pipeline as cerberus-django.

Configuration

Key Required Description
token Yes API key for Cerberus authentication
client_id Yes Client identifier for your MCP server
ws_url Yes WebSocket URL of your Cerberus event_ingest server
server_name No Override server name in events (defaults to MCP server name)

Set CERBERUS_DEBUG=true to enable verbose logging.

How It Works

CerberusMCP subclasses FastMCP from the MCP Python SDK and wraps the tool(), resource(), and prompt() decorators. Each handler call is intercepted to capture timing, arguments, results, and errors. Events are queued into a thread-safe queue and sent via a background WebSocket connection — zero impact on your MCP server's response times.

Requirements

  • Python >= 3.10
  • mcp >= 1.0 (MCP Python SDK)
  • websockets >= 12.0
  • A running Cerberus backend (cerberus-int)

License

MIT

Metadata

Release files for cerberus-mcp 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cerberus-mcp 0.1.4
File Size Uploaded Provenance
cerberus_mcp-0.1.4.tar.gz 13.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cerberus-mcp 0.1.4
File Interpreter ABI Platform
cerberus_mcp-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 28.2 kB

Release files / cerberus_mcp-0.1.4.tar.gz

Download URL cerberus_mcp-0.1.4.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
40487072a4640fea574fbcdc82ea3abab7d61c17e88385f418e486cab2dd1419
BLAKE2b-256 checksum
How to use checksums
737938e13c7885095021ef560888382969f6924b14f8dcc52b50fb98311cf78d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / cerberus_mcp-0.1.4-py3-none-any.whl

Download URL cerberus_mcp-0.1.4-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f85e84e94c662387bc5c1142ef9dacc4a29e781b331300e5c878431599b1693a
BLAKE2b-256 checksum
How to use checksums
b599cf5f927492554486d4ecb582a44a433fdd01a3b38db8ae5ffaf069e6c462
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for cerberus-mcp 0.1.4

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