Skip to main content

MCP Observability SDK for Python

Open, vendor-agnostic observability SDK for Model Context Protocol (MCP) applications. No vendor lock-in, plug-and-play integration, and extensible for rate limiting, tool filtering, auth, and traceability.

Installation

pip install mcp-hack

Quick Start

1. Get an API Key

  1. Visit https://etalesystems.com
  2. Sign in with your Google account
  3. Create a new API key from the dashboard
  4. Set your API key as an environment variable:
export MCP_API_KEY="your_api_key_here"

2. Use in Your Code

import os
from mcp_observability import MCPObservability

# Initialize observability
obs = MCPObservability(
    api_url="https://etalesystems.com/api",  # Production backend URL
    api_key=os.getenv('MCP_API_KEY')  # Your API key from etalesystems.com
)

# Add observability to your MCP tools
@mcp.tool()
@obs.tool_observer("add_numbers")
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

# Get metrics
metrics = obs.get_metrics()
print(f"Total calls: {metrics['summary']['total_calls']}")

Features

  • 🔍 Automatic Tool Tracing: Monitor all MCP tool calls with zero configuration
  • 📊 Rich Metrics: Execution time, success rates, error tracking
  • 🚀 Non-blocking: Async trace submission doesn't slow down your tools
  • 🔒 Secure: API key authentication with environment variable support
  • 📈 Dashboard Integration: Real-time visualization of your MCP tools

API Reference

MCPObservability

Main class for MCP observability.

Constructor

MCPObservability(api_url: str, api_key: Optional[str] = None)
  • api_url: URL of your observability backend
  • api_key: API key for authentication (optional, but required for trace submission)

Methods

tool_observer(tool_name: Optional[str] = None)

Decorator to add observability to MCP tools.

@obs.tool_observer("my_tool")
def my_tool(param: str) -> str:
    return f"Hello {param}"
trace(task: str, context: Dict[str, Any], model_output: str, metadata: Optional[Dict[str, Any]] = None)

Send a custom trace to the backend.

obs.trace(
    task="Custom Task",
    context={"user_input": "Hello"},
    model_output="Response",
    metadata={"custom_field": "value"}
)
get_metrics() -> Dict[str, Any]

Get current metrics snapshot.

metrics = obs.get_metrics()
print(metrics['summary']['total_calls'])
print_metrics()

Print formatted metrics to console.

obs.print_metrics()

Environment Variables

License

MIT License. See LICENSE file for details.

Contributing

Contributions are welcome! Please see our Contributing Guide.

Links

Metadata

Release files for mcp-observability 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-observability 0.1.2
File Size Uploaded Provenance
mcp_observability-0.1.2.tar.gz 5.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-observability 0.1.2
File Interpreter ABI Platform
mcp_observability-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / mcp_observability-0.1.2.tar.gz

Download URL mcp_observability-0.1.2.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
330dfeaa6b51dca76d3bd1e047160b5bbf331c031b3ccb66253bb176728a9bc4
BLAKE2b-256 checksum
How to use checksums
6d283acc64d20bf95d2b028539a5599f6dd3a2cfc7cb0b0837039834b97151c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / mcp_observability-0.1.2-py3-none-any.whl

Download URL mcp_observability-0.1.2-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff9107775d3177843268ab7daf51609886e282d0a41a2b3d5567283ba1ac988f
BLAKE2b-256 checksum
How to use checksums
44cfa494ae405d1627bdd5d9a18c8ca5d74921f2c5c3c4f3197dee59628ecf6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for mcp-observability 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.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

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