MCP错误修复工具

修复CAI框架中MCP服务器STDIO传输模式下的'StdioServerParameters'对象属性错误,确保'/mcp add'命令正常执行。

  • by DefaceRoot
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 defaceroot/cai-mcp-bug-fix

使用说明

CAI MCP错误修复

修复 'StdioServerParameters' object has no attribute 'get' 错误输入 网络安全人工智能(CAI) 这防止了 /mcp add 使用STDIO MCP服务器的命令。

问题

当通过STDIO传输将CAI与MCP(模型上下文协议)服务器一起使用时 /mcp add 命令失败,原因如下:

解决方案

此脚本通过替换来自动修复错误 server.params.get() 电话与 getattr(server.params, ...) 贯穿CAI代码库。

用法

  1. 确保CAI已安装: pip install cai-framework
  2. 下载并运行修复程序:
wget https://raw.githubusercontent.com/DefaceRoot/cai-mcp-bug-fix/main/fix_cai_mcp_bug.py
python fix_cai_mcp_bug.py