[bot] MCP (Model Context Protocol) Python SDK: no instrumentation for ClientSession tool-calling execution
Mantenedores costumam responder em até 1 dia
@raoashish10 já está trabalhando nisso.
Desde 2/8/2026.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- python
- Domínio
- observability-sre
Direção de pesquisa
Comece por py/src/braintrust/integrations/adk/test_adk_mcp_tool.py e pelo layout ao redor de py/src/braintrust/integrations/, pois o repositório não tem uma integração mcp independente. Revise as superfícies estáveis de mcp.ClientSession listadas na issue e as convenções de tracing existentes; o trabalho estará concluído quando chamadas diretas de ferramentas, leituras de recursos e operações de prompt estiverem instrumentadas com as entradas, saídas e metadados indicados, e a tabela de integrações do README tiver sido atualizada.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 21
- Forks
- 23
- Merge médio
- 20h 2min
- PRs com merge (30d)
- 95
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de braintrustdata/braintrust-sdk-python
-
feature python
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
braintrustdata/braintrust-sdk-python#868 ·
Mantenedores costumam responder em até 1 dia
-
feature integration: mistral python
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
braintrustdata/braintrust-sdk-python#867 ·
Mantenedores costumam responder em até 1 dia
-
[bot] Google GenAI: streaming responses drop `url_context_metadata` that non-streaming responses preserveTalvez já em andamento @Kayvan-Zahiri assumiu há 6 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
braintrustdata/braintrust-sdk-python#774 ·
Mantenedores costumam responder em até 1 dia
-
feature python
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
braintrustdata/braintrust-sdk-python#866 ·
Mantenedores costumam responder em até 1 dia
-
feature python
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
braintrustdata/braintrust-sdk-python#863 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de braintrustdata/braintrust-sdk-python
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
RedHatQE/mtv-api-tests#721 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 85/100
pytest-dev/pluggy#757 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 85/100
NousResearch/hermes-agent#134960 ·
Mantenedores costumam responder em até 1 dia
-
HTML backend: `<br>` leaks the internal sentinel U+E000 into list items, headings and captionsTalvez já em andamento @morten-lagabote assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
docling-project/docling#4671 ·
Mantenedores costumam responder em até 1 dia