Skip to main content
Trace MCP tool calls, server responses, and client interactions in HoneyHive so you can debug agent workflows that rely on the Model Context Protocol. Use OpenInference for experimental auto-instrumentation or @trace decorators for production MCP servers and clients. See custom spans for decorator patterns and tracer initialization for runtime setup.
MCP Integration: Trace tool calls, server responses, and client interactions in your MCP-based AI applications.

What is the Model Context Protocol?

The Model Context Protocol (MCP) is an open standard for connecting AI assistants to external tools and data sources. HoneyHive can trace both MCP servers (tool providers) and MCP clients (AI applications).

What MCP versions does HoneyHive support?

Python version support

MCP SDK Requirements

  • Minimum: mcp >= 1.0.0
  • Recommended: mcp >= 1.0.0
  • Protocol: MCP 1.0

Instrumentor Status

MCP instrumentation is experimental. For production use, we recommend manual tracing with the @trace decorator.

How do you auto-trace MCP with OpenInference?

Installation

Basic Setup


How do you manually trace MCP in production?

For production MCP applications, use manual tracing with the @trace decorator.

MCP server instrumentation

Server with Error Handling


MCP Client Instrumentation

Trace your MCP client to monitor how your AI application uses external tools.

Basic Client Setup

Client with Multiple Servers

Client with Retry Logic


Integration with AI Frameworks

With LangChain

With OpenAI Function Calling


Environment Configuration


Best Practices

1. Trace Tool Boundaries Clearly

2. Include Rich Context

3. Track Metrics


Troubleshooting

Tool Calls Not Appearing in Traces

Ensure the @trace decorator is correctly applied:

Missing Tracer Reference

Always pass the tracer to the decorator:

High Latency Investigation

Add timing metadata to identify bottlenecks:

LangChain Integration

Use MCP with LangChain

Distributed Tracing

Link client and server traces

Span Enrichment

Add metadata to traces

Multi-Provider

Use MCP with multiple providers