Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

MCP: get_stdio_tools() fails in documented setup

未关闭
#310 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@dajiaohuang 已经在做这个了。

开始于 2026年9月25日。

  • #311 来自 @dajiaohuang —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
api

调研方向

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

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
189
派生
26
平均合并
1 天 23 小时
30 天内合并 PR
14

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vercel-labs/ai-python 的其他 Issue

查看 vercel-labs/ai-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。