[bot] MCP (Model Context Protocol) Python SDK: no instrumentation for ClientSession tool-calling execution
Maintainer antworten meist innerhalb von 1 Tag
@raoashish10 arbeitet bereits daran.
Seit 02.8.2026.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- python
- Bereich
- observability-sre
Rechercherichtung
Beginnen Sie mit py/src/braintrust/integrations/adk/test_adk_mcp_tool.py und dem umliegenden Layout unter py/src/braintrust/integrations/, da das Repository keine eigenständige mcp-Integration enthält. Überprüfen Sie die im Issue aufgeführten stabilen mcp.ClientSession-Oberflächen und die bestehenden Tracing-Konventionen; als abgeschlossen gilt die Arbeit, wenn direkte Tool-Aufrufe, Ressourcenlesevorgänge und Prompt-Operationen mit den angegebenen Eingaben, Ausgaben und Metadaten instrumentiert sind und die Integrationstabelle im README aktualisiert wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 21
- Forks
- 23
- Ø Merge
- 19 Std. 55 Min.
- Gemergte PRs (30 T.)
- 95
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus braintrustdata/braintrust-sdk-python
-
feature python
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
braintrustdata/braintrust-sdk-python#868 ·
Maintainer antworten meist innerhalb von 1 Tag
-
feature integration: mistral python
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
braintrustdata/braintrust-sdk-python#867 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[bot] Google GenAI: streaming responses drop `url_context_metadata` that non-streaming responses preserveEvtl. vergeben @Kayvan-Zahiri hat das vor 5 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
braintrustdata/braintrust-sdk-python#774 ·
Maintainer antworten meist innerhalb von 1 Tag
-
OpenAI: trace computer-use Agents session items and capture Responses `access_programs`Evtl. vergeben @AbhiPrasad hat das vor 1 Tag übernommen. Offenfeature integration: openai python
braintrustdata/braintrust-sdk-python#869 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
feature python
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
braintrustdata/braintrust-sdk-python#866 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in braintrustdata/braintrust-sdk-python
Ähnliche Issues
-
defect from-review v0.9.2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
khuisman/mcp-gee-sweet#926 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
EtanHey/brainlayer#1164 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug security
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
yunaremaia/vibeguard#141 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
PrismorSec/prismor#599 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
iii-hq/iii#2278 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag