--- id: opentelemetry-instrumentation-mcp version: "0.62.3" license: Apache-2.0 license_treatment: permissive maintenance: active --- # opentelemetry-instrumentation-mcp — OpenTelemetry mcp instrumentation License: permissive · Maintenance: active · Downloads: 6.7M/mo ## What it is and what it does This package integrates the MCP Python SDK with OpenTelemetry to emit distributed traces from agentic workflows. When you call `McpInstrumentor().instrument()`, it hooks into MCP framework calls to generate spans that track tool invocations, prompts sent to LLMs, and completions received—giving you visibility into how your agent is using tools and interacting with language models. By default, the instrumentation logs the actual content of prompts, completions, and embeddings to span attributes, which helps with debugging and evaluation but may expose sensitive user data. You can disable this by setting `TRACELOOP_TRACE_CONTENT=false` to reduce trace size and protect privacy. The package depends on the OpenTelemetry API and instrumentation base libraries, plus semantic convention definitions for AI workloads. Use it for: - Debug agentic workflows by viewing the full trace of tool calls, prompts, and LLM responses in your observability backend. - Monitor production MCP applications to detect tool call failures, latency spikes, or unexpected LLM behavior. - Evaluate agent performance by analyzing spans to understand which tools are called most frequently and how long each step takes. - Reduce trace volume in privacy-sensitive environments by disabling content logging while keeping structural tracing intact. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds distributed tracing to MCP (Model Context Protocol) agentic workflows by instrumenting the MCP Python SDK to emit OpenTelemetry spans tracking tool calls, prompts, and completions. Yes, if you are building or running MCP-based agentic workflows and need observability. The package is actively maintained, has no known vulnerabilities, and integrates cleanly into the OpenTelemetry ecosystem. Install it when you want to trace tool calls and LLM interactions; skip it if you have no observability infrastructure or are not using the MCP framework. ## Install pip install opentelemetry-instrumentation-mcp uv add opentelemetry-instrumentation-mcp poetry add opentelemetry-instrumentation-mcp ## Installing opentelemetry-instrumentation-mcp Before you install: Low friction install with four runtime dependencies on the OpenTelemetry ecosystem. Active maintenance with a recent release (4 days old) and an established repository. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and note material changes. Quickstart: pip install opentelemetry-instrumentation-mcp from opentelemetry.instrumentation.mcp import McpInstrumentor McpInstrumentor().instrument() Requires Python 3.10 or later; requires an OpenTelemetry SDK and exporter already configured in your application. Verify before relying: - Whether this instrumentation works with all MCP framework versions or has specific version constraints beyond what the fact sheet shows. - What span attributes are captured beyond prompts, completions, and embeddings. - Performance overhead of instrumentation on typical agentic workflows. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 6.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags opentelemetry mcp instrumentation, trace mcp tool calls, agentic workflow tracing, mcp framework observability, llm tool usage tracing, mcp span instrumentation, observability, mcp-instrumentation, agentic-ai [View on SkillFed](https://skillfed.io/packages/opentelemetry-instrumentation-mcp) · [View on PyPI](https://pypi.org/project/opentelemetry-instrumentation-mcp/)