Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

MCP: get_stdio_tools() fails in documented setup

Aperta
#310 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@dajiaohuang ci sta già lavorando.

Dal 25/9/2026.

  • #311 di @dajiaohuang — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api

Direzione di ricerca

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().

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
189
Fork
26
Merge medio
1g 23h
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vercel-labs/ai-python

Tutte le issue di vercel-labs/ai-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.