MCP: get_stdio_tools() fails in documented setup
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Start with get_stdio_tools() and its connection helper, then compare the lifecycle used by get_http_tools(). Re-run the documented uv command on the frozen revision and verify that discovery starts the MCP transport and returns tools without requiring agent.run().
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug description
The MCP reference shows calling get_stdio_tools() as setup code that returns AgentTool values to pass to ai.Agent. On the frozen main revision, the documented call raises before returning tools when run outside agent.run().
Reproduction
From the repository root with Python 3.12:
uv run --frozen --python 3.12 python -c 'import asyncio, ai; asyncio.run(ai.mcp.get_stdio_tools("python", "--version"))'
Observed error:
RuntimeError: MCP tools must be used inside agent.run(). The connection pool is not initialized.
The pool check happens before an MCP transport is started, so this call does not launch the subprocess.
Expected behavior
The documented setup call should return tools that can be passed to ai.Agent, or the reference should show a supported lifecycle for discovery.
Source context
get_stdio_tools() calls the connection helper without establishing the pool. get_http_tools() establishes the pool around discovery. This is reproducible against main at c788059dd1db2d93ae1c3da6daffb660eca07dbb.
- Lenguaje dominante
- Python
- Estrellas
- 189
- Forks
- 26
- Merge medio
- 1 d 23 h
- PR fusionados (30 d)
- 14
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de vercel-labs/ai-python
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
vercel-labs/ai-python#299 ·
Los mantenedores suelen responder en 2 días
-
Structured output streaming: no way to see the object while it generatesPosiblemente ocupada @jaygupta17 la tomó hace 42 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
vercel-labs/ai-python#272 ·
Los mantenedores suelen responder en 2 días
-
Tool parameters lose descriptions from Annotated[...] and docstring Args sectionsPosiblemente ocupada @jaygupta17 la tomó hace 42 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
vercel-labs/ai-python#270 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
vercel-labs/ai-python#224 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 2 días
Todos los issues de vercel-labs/ai-python
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
agrc/palletjack#208 ·
-
status/needs-triage type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
PKU-YuanGroup/OpenAI4S#218 ·
Los mantenedores suelen responder en 1 día
-
Test LeakagePosiblemente ocupada @garland3 la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
sandialabs/atlas-ui-3#1030 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
aws-samples/sample-ai-persona#151 ·
Los mantenedores suelen responder en 1 día