Skip to content

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

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi/implement-pr3-issue1023-a517623b
Oct 30, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
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

@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-30T15:46:15.989322Z bfae7b4 New commits
ℹ️ 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
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) force-pushed the abhi/implement-pr3-issue1023-a517623b branch from 3262542 to 0a0d75d Compare October 30, 2026 15:05
Base automatically changed from abhi/mcp-client-tracing-ae460b73 to main October 30, 2026 15:43
> 🤖 **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
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) force-pushed the abhi/implement-pr3-issue1023-a517623b branch from 0a0d75d to bfae7b4 Compare October 30, 2026 15:43
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 0b1efd6 into main Oct 30, 2026
98 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi/implement-pr3-issue1023-a517623b branch October 30, 2026 15:54
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