fastmcp 纳米AI 报错 uniq_id Unexpected keyword argument 多余参数报错

在编写MCP服务,使用第三方工具调用,例如纳米AI来使用时,可能遇到如下报错。

bash 复制代码
[11/09/25 18:11:54] Error validating tool 'test_server': 1 validation error for call[test_server]
                    uniq_id
                      Unexpected keyword argument [type=unexpected_keyword_argument, input_value='14MY1PwGBRt', input_type=str]
                        For further information visit https://errors.pydantic.dev/2.12/v/unexpected_keyword_argument
                    ╭───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────╮                    │ C:\venv_mcp_server\Lib\site-packages\fastmcp\tools\tool_manager.py:160 in call_tool  │                    │                                                                                                                     │                    │ C:\venv_mcp_server\Lib\site-packages\fastmcp\tools\tool.py:319 in run                │                    │                                                                                                                     │                    │ C:\venv_mcp_server\Lib\site-packages\pydantic\type_adapter.py:441 in validate_python │                    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                    ValidationError: 1 validation error for call[test_server]
                    uniq_id
                      Unexpected keyword argument [type=unexpected_keyword_argument, input_value='14MY1PwGBRt', input_type=str]
                        For further information visit https://errors.pydantic.dev/2.12/v/unexpected_keyword_argument

莫名其妙的多出来uniq_id或其他我们并未约定的参数。此时会触发参数多余报错,实测FastMCP 2.13.0.2版本是报错的。

原因是,之前的MCP协议对参数要求相对比较宽松,因此各家AI客户端,都尝试了增加一些自己的参数,用于追踪MCP调用等等目的。但是从某个版本开始,目前尚未查明,fastmcp开始严格要求参数一致性,导致多余参数就会报错。

解决这个问题很简单,将调用MCP的客户端升级即可。我将纳米AI升级以后,就没有再遇到这种报错。目前我使用的是纳米AI 1.3.1516.64。

调试MCP建议使用MCP Inspecto,我的版本是v0.17.2。如果MCP Inspecto正常调用,但是客户端一直报错,建议找客户端的问题。

安装并启动最新MCP Inspecto命令。

bash 复制代码
npx @modelcontextprotocol/inspector
相关推荐
康de哥6 小时前
MCP Unity + Claude Code 配置关键步骤
unity·mcp·claude code
田井中律.8 小时前
MCP协议
mcp
通义灵码18 小时前
Qoder 支持通过 DeepLink 添加 MCP Server
人工智能·github·mcp
酩酊仙人2 天前
fastmcp构建mcp server和client
python·ai·mcp
kwg1262 天前
本地搭建 OPC UA MCP 服务
python·agent·mcp
小小工匠2 天前
LLM - 从通用对话到自治智能体:Agent / Skills / MCP / RAG 三层架构实战
agent·rag·skill·mcp
小小工匠2 天前
LLM - 将业务 SOP 变成 AI 能力:用 Skill + MCP 驱动 Spring AI 应用落地不完全指南
人工智能·skill·spring ai·mcp
kaizq3 天前
AI-MCP本地流媒音频服务器设计与CherryStudio部署应用
音视频·cherrystudio·fastmcp·streamablehttp·本地mcp流媒服务器
Esun_R3 天前
当 LLM 开始连接真实世界:MCP 的原理、通信与工程落地
node.js·openai·mcp
chao_6666663 天前
【MCP】Claude Code for VS Code 配置阿里云 MCP 工具教程
阿里云·云计算·claude·mcp