Skip to main content
Interceptors wrap live objects and record each interaction as it happens. Unlike adapters (which parse log files after the fact), interceptors sit in the call path and capture spans in real time.

MCP interceptor

MCP is the standard protocol for agent-tool connectivity. Every call_tool invocation has a clean input/output boundary — the interceptor captures each one as a KIND_TOOL span with no changes to your agent code.

Basic usage

Attach to a Witness tracer

Combine MCP spans with @span-instrumented reasoning steps into a single unified trace:

Multiple servers

Wrap each server separately and merge the node lists:

Set a parent span

Wire MCP tool spans as children of a reasoning span in a larger DAG:

What each span contains

Transparent proxy

The interceptor forwards every non-intercepted attribute to the underlying session — list_tools, read_resource, get_prompt, etc. all pass through unchanged. You can use it as a drop-in replacement:

API reference