Skip to main content

mcp-monitor-local-sdk

Self-host monitoring SDK for Python MCP servers. User guide · Developer guide

Repo copies: USER.md · DEV.md

User guide

Point this SDK at your self-host API (metrics_server_url + instance_secret). It wraps tool handlers and sends tool-call metrics (name, duration, success/error) — not application logs — to POST /v1/metrics. Open the local UI or desktop app to see them. This package does not talk to the hosted dashboard.

pip install mcp-monitor-local-sdk
from mcp_monitor_sdk import MonitoredFastMCP

server = MonitoredFastMCP(
    "todo-mcp",
    server_name="todo-mcp",
    instance_secret="change-me-to-a-long-random-secret",
    metrics_server_url="http://localhost:8000/v1/metrics",
)

@server.tool()
def todos_list() -> str:
    """List all todos."""
    return "No todos."

if __name__ == "__main__":
    server.run()

instance_secret must match INSTANCE_SECRET on the API.

Developer guide

Same ingest contract as the JS SDK. Built to sit next to the official mcp package.

Options

Option Required Default Notes
server_name yes Trimmed and lowercased
instance_secret yes Min 16 characters; sent as X-Instance-Secret
metrics_server_url yes Full ingest URL, usually http://localhost:8000/v1/metrics
batch_size no 10 Max 100
retry_attempts no 2 0 still tries once
timeout_ms no 5000
flush_interval_ms no 5000
log_level no info debug | info | warn | error | silent

Failed flushes are restored to the buffer. Process exit drains remaining events over a sync HTTP POST.

Local checkout:

pip install -e ./local/sdk/py

Publish:

cd local/sdk/py
python -m build
twine upload dist/*

Metadata

Release files for mcp-monitor-local-sdk 0.1.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 mcp-monitor-local-sdk 0.1.0
File Size Uploaded Provenance Actions
mcp_monitor_local_sdk-0.1.0.tar.gz 8.2 kB Without provenance Details for mcp_monitor_local_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-monitor-local-sdk 0.1.0
File Interpreter ABI Platform Actions
mcp_monitor_local_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for mcp_monitor_local_sdk-0.1.0-py3-none-any.whl

Total release size: 19.2 kB

Release files / mcp_monitor_local_sdk-0.1.0.tar.gz

Download URL mcp_monitor_local_sdk-0.1.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4bd49021111a44250e776f0c98cce2858162a2ddb826b208cfff2e46a265e510
BLAKE2b-256 checksum
How to use checksums
75f6e3ec3440d4fc3c160b91afa3a1df4676e60cc58f079279df2b155e08a2dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / mcp_monitor_local_sdk-0.1.0-py3-none-any.whl

Download URL mcp_monitor_local_sdk-0.1.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18c11b9b28e6b8d4477a36a06a29071ea1be6941a8d2fe59c96308f1497661cc
BLAKE2b-256 checksum
How to use checksums
df77c193670af5d1110863102efaced7974e6cd1daa859583f00b1ac0ef9901e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for mcp-monitor-local-sdk 0.1.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