OpenInference instrumentation for MCP (Model Context Protocol) clients, enabling OpenTelemetry-based tracing of MCP tool calls and server interactions. Current version 2.0.0, requires Python >=3.10 <3.15. Part of the Arize AI OpenInference ecosystem. Active development with frequent releases.
pip install openinference-instrumentation-mcpVerified import paths — ran on the pinned version, not inferred.
Instrument MCP client with OpenInference tracing.
Upgrade MCP library to version that supports streamable_http_client (mcp>=1.6.0). Review your MCP server's streaming transport.
Call MCPClientInstrumentor().instrument() immediately after setting up the tracer provider and before importing/using mcp.ClientSession or any MCP client.
Use a separate OpenInference instrumentation for your MCP server (e.g., openinference-instrumentation-mcp-server) if available.
Ensure wrapt is installed. For wrapt 2.x compatibility, use openinference-instrumentation>=0.1.47.