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

Events flush when the batch is full or every flush_interval_ms. Failed flushes are restored. Shutdown drains remaining events.

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.2

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.2
File Size Uploaded Provenance Actions
mcp_monitor_local_sdk-0.1.2.tar.gz 8.2 kB Without provenance Details for mcp_monitor_local_sdk-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 19.2 kB

Release files / mcp_monitor_local_sdk-0.1.2.tar.gz

Download URL mcp_monitor_local_sdk-0.1.2.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ab2bab9b61a7194a527a6452767646617a18ac89838f996d7b57b9cbb3466264
BLAKE2b-256 checksum
How to use checksums
378167c9f286c01a2baed512385c8d80664addf4a42d672ede607e8fa857b4de
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.2-py3-none-any.whl

Download URL mcp_monitor_local_sdk-0.1.2-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfa7234306e7950fbbb4892c8bf393d63c2098f9d1479ecdbc156b3b3030843d
BLAKE2b-256 checksum
How to use checksums
3f9158ff3f5b7821d9b07e9af83c7a41c8ba6f7539915cda210bf095d543d0b7
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.2

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