Skip to content

feat(mcp): add automatic client and server instrumentation - #1028

Open
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
abhi/mcp-client-tracing-ae460b73from
abhi/implement-pr3-issue1023-a517623b
Open

Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
abhi/mcp-client-tracing-ae460b73from
abhi/implement-pr3-issue1023-a517623b

Conversation

@AbhiPrasad

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

🤖 This text was AI-generated.

auto_instrument() previously skipped MCP, requiring separate setup:

client = wrap_mcp_client(client)
server = wrap_mcp_server(server)

Enable both sides automatically, with independent controls and content
capture enabled by default. Applications can opt out of payload capture:

auto_instrument(mcp_client=True, mcp_server=True, mcp_capture_content=False)

Repeated setup updates defaults without adding duplicate spans. Explicit
wrappers retain their per-object settings, and MCP dependencies stay optional.

Builds on #1025
for MCP 1.x/2.x and FastMCP 2.x–4.x.

resolves #1023
resolves https://linear.app/braintrustdata/issue/SDK-727/add-mcp-client-and-server-instrumentation-for-python-sdk

> 🤖 **This text was AI-generated.**

`auto_instrument()` previously skipped MCP, requiring separate setup:

```python
client = wrap_mcp_client(client)
server = wrap_mcp_server(server)
```

Enable both sides automatically, with independent controls and content
capture enabled by default. Applications can opt out of payload capture:

```python
auto_instrument(mcp_client=True, mcp_server=True, mcp_capture_content=False)
```

Repeated setup updates defaults without adding duplicate spans. Explicit
wrappers retain their per-object settings, and MCP dependencies stay optional.

Builds on [#1025](#1025)
for MCP 1.x/2.x and FastMCP 2.x–4.x.

Refs #1023
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T22:31:55.884390Z 3262542 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3262542081

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread py/src/braintrust/auto.py

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add MCP client and server instrumentation for Python SDK

1 participant