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

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

Built distribution (wheel)

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

Total release size: 19.2 kB

Release files / mcp_monitor_local_sdk-0.1.1.tar.gz

Download URL mcp_monitor_local_sdk-0.1.1.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6ba97eab300f51925a54b2c48fb8b5b5c9dc3022984498ae9744667f6f430572
BLAKE2b-256 checksum
How to use checksums
d7f4e3f6718d04f55265c15a905cc4c603d47c9527a19a2fbbaf7f19d31b6cac
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.1-py3-none-any.whl

Download URL mcp_monitor_local_sdk-0.1.1-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
732203828c2a7430f67e1178803c87af76e27157a20ecc783666a0d9d26de2c0
BLAKE2b-256 checksum
How to use checksums
1e0f4a49b2887b4a6a61d3bcca6c21b45b2fa7938a3a4d4651428f9e888524c4
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.1

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