Skip to main content

mcpobs

Observability for Model Context Protocol servers, built for the protocol rather than adapted to it.

A generic tracing tool tells you a request took 800ms and returned 200. This tells you which tool failed, why it failed, and where the time went — because it understands MCP as a protocol.

pip install mcpobs
from mcpobs import instrument

instrument(mcp)          # that is the whole integration

What you get

Failures are classified, not counted. tool_error, server_exception, unknown_tool, invalid_arguments, protocol_error — each is a different problem with a different owner. One "error rate" collapses them into a number that cannot tell you what to do next.

Protocol reality is respected. A multi-round-trip tool pausing to ask the user a question is not an error, and counting it as one is the fastest way to corrupt an error rate. A 401 is not a server failure — the MCP authorization flow opens with an unauthenticated request answered by one. Both are categorised on their own terms.

Progress and cancellation are visible while they happen. Each report_progress() becomes a child span, queryable during a long call rather than when it ends. A cancelled call is recorded as cancelled — not as a fast success, which is what a truncated duration would otherwise look like.

Your database, cache and API calls

One call, and it reports what it touched:

from mcpobs import instrument, instrument_downstream

instrument(mcp)
report = instrument_downstream()
# {'httpx': 'instrumented', 'psycopg': 'instrumented', 'redis': 'instrumented'}

It discovers whatever you have installed through OpenTelemetry's own entry-point group, so pip install opentelemetry-instrumentation-redis is the entire integration. This package depends on none of them — you install the instrumentors you actually use.

It never raises: a package with a version conflict is reported and skipped, not allowed to stop your server booting.

What does not leave your process

Error classification reads SDK-generated boilerplate and reduces it to a single enum before anything is exported. Tool arguments and results are not captured by default.

On failing calls only, a truncated error message is recorded so you can see why something failed. instrument(mcp, capture_error_detail=False) turns that off.

Servers launched by the client (stdio)

If the client starts your server, it runs on your user's machine — so it must not hold a long-lived credential. Your backend mints a short-lived token instead:

pip install "mcpobs[sessions]"
instrument(
    mcp,
    session_endpoint="https://yourapp.com/mcpobs-session",
    session_headers=lambda: {"authorization": f"Bearer {current_token()}"},
)

Pass a callable — the credential authenticating that call usually refreshes, and a dict read once at startup would work for an hour and then quietly stop.

If your endpoint is unreachable, the server starts without telemetry and retries. Observability must never be the reason a tool fails to start.

Requirements

  • Python 3.11+
  • opentelemetry-api, opentelemetry-sdk (installed with this package)
  • mcpobs[sessions] additionally installs the OTLP HTTP exporter and httpx

Licensed under Apache-2.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcpobs-0.1.0.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcpobs-0.1.0-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

Details for the file mcpobs-0.1.0.tar.gz.

File metadata

  • Download URL: mcpobs-0.1.0.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mcpobs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5f9b4a2afaca58b66f612b57a6a9b23876022fc92a9b205df705d6c92e6c4075
MD5 177c61ba900a323e8b659311523e7d65
BLAKE2b-256 8b1b4a507e2b28e5f4ef6ff77d5851c15abf537189f4ce316d017b36fd819532

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpobs-0.1.0.tar.gz:

Publisher: publish-sdk.yml on Ruturajs4/mcpobs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcpobs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcpobs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 42.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mcpobs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6f03025809dc67a3742f2a4f11963fac4bd8c8a62ba01fa27f41125968096bb
MD5 7cca63afe4ba75e3c31135ff491844e6
BLAKE2b-256 0d54ad71ffdcc8f507dbae1b21a1fc144c26b888a34b004c3b72a6107f7361ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpobs-0.1.0-py3-none-any.whl:

Publisher: publish-sdk.yml on Ruturajs4/mcpobs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page