Prefect 于 2026-09-25 发布 FastMCP v4.0.10(PyPI fastmcp 4.0.10,代号 Inside Job):被 Search transforms / CodeMode 隐藏的 task-enabled tools 仍会向 task backend 注册;当某 tool/resource/prompt 经 `ctx.fastmcp.call_tool()`(含 search 的 `call_tool` 代理与 CodeMode `execute`)调用这些工具时,现在返回真实结果,而不再是空的 task receipt。另含 stdio 析构容忍 transport 构造失败的修复。文档见 gofastmcp.com。

核心要点速览 (Key Takeaways)

  • ✓发版:v4.0.10 / PyPI fastmcp 4.0.10
  • ✓Task:被 Search / CodeMode **隐藏** 的 task tools 仍注册到 task backend(#5262)
  • ✓调用:经 `ctx.fastmcp.call_tool()` / CodeMode `execute` 跨工具调用时返回**真实结果**,不再空 task receipt(#5275)
  • ✓稳健性:stdio `__del__` 容忍 transport 构造失败,避免析构噪音(#5256)
  • ✓文档:gofastmcp.com 与仓库 changelog 已同步 v4.0.10 条目
🔬

深度技术解析与实战评估

核心背景与行业痛点

MCP 服务端常用 Search transforms / CodeMode 把工具「藏」进可搜索或可执行平面,同时用 task-enabled tools 做后台任务。FastMCP 先前会出现两类静默故障:隐藏后 task 未向 backend 注册;或经 ctx.fastmcp.call_tool() / CodeMode execute 跨工具调用时只拿到空 task receipt,组合工具链与 Agent 编排会丢结果却看似成功。stdio 场景下 transport 构造失败还会在 __del__ 制造析构噪音,干扰本地调试与进程退出路径。

架构亮点与底层机制

v4.0.10(2026-09-25,PyPI fastmcp 4.0.10,代号 Inside Job)确保被 Search/CodeMode 隐藏的 task tools 仍注册到 task backend;从另一 tool/resource/prompt 经 ctx.fastmcp.call_tool()(含 search 的 call_tool 代理与 CodeMode execute)调用时在前台执行并返回真实结果(#5262/#5275)。stdio 侧容忍 transport 构造失败的 __del__(#5256)。文档站点 gofastmcp.com 已同步 changelog 条目。

权威 Benchmark 与实测跑分对比

发行说明未给出吞吐或延迟公开数字,属于编排正确性修复。相对 v4.0.9(Cache and Release,聚焦 ResourceTemplate 编译模式缓存边界)本版焦点转到「隐藏 task + 跨工具调用」语义闭合;验收应以「隐藏 task 经 call_tool/execute 拿到非空业务结果」为回归点,而不是对比 QPS 或延迟百分位。

开发者实战落地与开箱指南

pip install -U fastmcp==4.0.10,在启用 Search transforms 或 CodeMode 的服务器上复测 task tool:经 ctx.fastmcp.call_tool() / execute 应返回业务结果而非空 receipt。参考官方文档与 完整 Changelog。仓库:PrefectHQ/fastmcp。