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 andhttpx
Licensed under Apache-2.0.
Metadata
Release files for mcpobs 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcpobs-0.1.0.tar.gz | 36.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcpobs-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.3 kB
Release files / mcpobs-0.1.0.tar.gz
| Download URL | mcpobs-0.1.0.tar.gz |
|---|---|
| Size | 36.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f9b4a2afaca58b66f612b57a6a9b23876022fc92a9b205df705d6c92e6c4075
|
|
BLAKE2b-256 checksum How to use checksums |
8b1b4a507e2b28e5f4ef6ff77d5851c15abf537189f4ce316d017b36fd819532
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / mcpobs-0.1.0-py3-none-any.whl
| Download URL | mcpobs-0.1.0-py3-none-any.whl |
|---|---|
| Size | 42.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6f03025809dc67a3742f2a4f11963fac4bd8c8a62ba01fa27f41125968096bb
|
|
BLAKE2b-256 checksum How to use checksums |
0d54ad71ffdcc8f507dbae1b21a1fc144c26b888a34b004c3b72a6107f7361ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency log