[bot] MCP (Model Context Protocol) Python SDK: no instrumentation for ClientSession tool-calling execution
維護者通常 1 天內回覆
@raoashish10 已經在處理了。
開始於 2026年8月2日。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 48/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- python
研究方向
從 py/src/braintrust/integrations/adk/test_adk_mcp_tool.py 及其周圍的 py/src/braintrust/integrations/ 配置開始,因為此 repository 沒有獨立的 mcp 整合。檢查 issue 中列出的穩定 mcp.ClientSession 介面以及現有的 tracing 慣例;當直接的工具呼叫、資源讀取和 prompt 操作都使用所述的輸入、輸出和中繼資料完成 instrumentation,且 README integrations 表已更新時,即視為完成。
由索引模型根據 Issue 內容生成。
描述
Summary
The official Model Context Protocol Python SDK (PyPI package mcp, https://github.com/modelcontextprotocol/python-sdk) is not instrumented anywhere in this repo. mcp.ClientSession exposes an execution surface for agent tool-calling — call_tool(), list_tools(), read_resource(), list_resources(), list_prompts(), get_prompt() — that a developer's own agent code can call directly, independent of any of the agent frameworks this repo already instruments (claude_agent_sdk, openai_agents, google-adk, etc., which each embed their own MCP client internally).
Braintrust already instruments several agent-run frameworks that use MCP under the hood (e.g. Google ADK — see py/src/braintrust/integrations/adk/test_adk_mcp_tool.py — plus Claude Agent SDK and OpenAI Agents SDK), but a developer who talks to an MCP server directly via the standalone mcp SDK (not through one of those frameworks) gets zero tracing for their tool calls, resource reads, or prompt fetches.
Braintrust docs status: not_found. https://www.braintrust.dev/docs/guides/tracing lists supported providers ("OpenAI, Anthropic, Gemini, AWS Bedrock, Azure, Mistral, Together, Groq, and many more") and frameworks ("LangChain, LangGraph, CrewAI, Vercel AI SDK, Pydantic AI, DSPy, and many more") but does not mention the standalone MCP Python SDK or ClientSession instrumentation.
What needs to be instrumented
| SDK surface | Already traced? |
|---|---|
ClientSession.call_tool(name, arguments) |
No |
ClientSession.list_tools() |
No |
ClientSession.read_resource(uri) |
No |
ClientSession.list_resources() |
No |
ClientSession.get_prompt(name, arguments) |
No |
A useful span for call_tool should record input (tool name + arguments), output (CallToolResult.content / structuredContent), and metadata (provider: "mcp", server name/transport).
Upstream sources
- Repo: https://github.com/modelcontextprotocol/python-sdk
- PyPI:
mcp— latest stable release1.28.1(2026-06-26): https://pypi.org/project/mcp/ - Client quickstart showing
ClientSession.list_tools()/call_tool()usage: https://modelcontextprotocol.io/quickstart/client
Local repo files inspected
- Repo-wide grep for
import mcp,from mcp,ClientSessionunderpy/src/braintrust/— zero matches py/src/braintrust/integrations/adk/test_adk_mcp_tool.py— MCP only exercised as a sub-feature of the Google ADK integration; no standalonemcppatcherpy/src/braintrust/integrations/— nomcp/directoryREADME.mdintegrations table — no MCP entry
Note: as of this writing the mcp package's v2 line (2.0.0b1) is an explicit pre-release not intended for production per its own README, so instrumentation should target the stable v1.x ClientSession API.
- 主要語言
- Python
- 星號
- 21
- 分支
- 23
- 平均合併
- 20 小時 8 分鐘
- 30 天內合併 PR
- 94
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
braintrustdata/braintrust-sdk-python 的其他 Issue
-
feature python
難度 2/5 1-3 小時 新手友好度 76/100
braintrustdata/braintrust-sdk-python#868 ·
維護者通常 1 天內回覆
-
feature integration: mistral python
難度 2/5 1-3 小時 新手友好度 75/100
braintrustdata/braintrust-sdk-python#867 ·
維護者通常 1 天內回覆
-
[bot] Google GenAI: streaming responses drop `url_context_metadata` that non-streaming responses preserve可能已有人在做 @Kayvan-Zahiri 於 5 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 86/100
braintrustdata/braintrust-sdk-python#774 ·
維護者通常 1 天內回覆
-
OpenAI: trace computer-use Agents session items and capture Responses `access_programs`可能已有人在做 @AbhiPrasad 於 1 天前認領。 未關閉feature integration: openai python
braintrustdata/braintrust-sdk-python#869 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
feature python
難度 3/5 1-2 天 新手友好度 72/100
braintrustdata/braintrust-sdk-python#866 ·
維護者通常 1 天內回覆
查看 braintrustdata/braintrust-sdk-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 3 天內回覆
-
Negation with "not" and "no" is ignored during sentiment analysis可能已有人在做 @vivek-3728 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
techcsispit/mess-mood#11 · 1 則留言 ·
-
changelog investigate
難度 2/5 1-3 小時 新手友好度 68/100
ramnes/notion-sdk-py#408 ·
-
good first issue
難度 2/5 1-3 小時 新手友好度 83/100
btclib-org/btclib-wallet#267 ·
維護者通常 1 天內回覆
-
good first issue tech-debt
難度 2/5 1-3 小時 新手友好度 85/100
knnmelprop/YAADO#111 ·