> For the complete documentation index, see [llms.txt](https://docs.observal.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.observal.io/use-cases/observe-mcp-traffic.md).

# Observe MCP traffic

Observal identifies MCP and tool activity from the session transcript recorded by each coding harness. It does not intercept MCP transport traffic.

## What you get

When the harness records the relevant detail, session events can include:

* Tool or MCP name
* Tool input and result
* Event ordering within the session
* Harness, user, agent, and model attribution
* Token totals and timing derived from the session

Coverage varies by harness because Observal can only index fields present in the local transcript or native message API. Transport-level latency and payload data are not synthesized when the harness does not record them.

## Discover and install session hooks

```bash
observal scan
observal doctor patch --all-harnesses
```

`scan` is read-only. `doctor patch` installs supported session hooks or extensions and leaves every MCP command and remote URL unchanged.

Scope hook installation to selected harnesses:

```bash
observal doctor patch --harness claude-code
observal doctor patch --harness kiro
observal doctor patch --harness copilot-cli
```

Restart the harness after hook changes, then run a coding session. If a hook was missed or the machine was offline, reconcile local session sources:

```bash
observal reconcile
```

## Query collected sessions

Open `/traces` in the web UI to filter sessions by harness, agent, user, model, and time range. Expand a session to inspect parsed prompts, responses, tool calls, tool results, and lifecycle events.

The CLI can list recent sessions and unfold their events:

```bash
observal ops traces --limit 20
observal ops traces --turn --limit 10
```

## Caveats

* MCP visibility depends on the harness transcript format.
* Observal does not modify, proxy, or wrap MCP traffic.
* Monetary cost and structured transport errors are unavailable unless the harness records equivalent session fields.

## Next

[Debug agent failures](/use-cases/debug-agent-failures.md) explains how to investigate failures using session evidence.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.observal.io/use-cases/observe-mcp-traffic.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
