
万能
STDIO将Web API转化为MCP工具的万能助手
将Web API转化为MCP工具的万能助手
一个万能的MCP工具,能够将Web API接口轻松转化为MCP工具,供AI助手使用。
python 3.8+
zhipuai>=1.0.0
requests>=2.31.0
beautifulsoup4>=4.12.3
websockets>=12.0
python-dotenv>=1.0.0
fastmcp>=0.1.0
pip install -r requirements.txt
python 启动_universal_mcp.py
在"API管理"选项卡中,您可以添加、删除和修改API配置
添加API时,需要提供以下信息:
添加完成后,点击"保存API"按钮
{ "api_name": "查询天气", "api_url": "https://api.example.com/weather", "method": "GET", "request_format": { "city": "string", "days": "number" }, "response_format": { "temperature": "number", "weather": "string", "humidity": "number" }, "description": "根据城市名称查询天气预报" }
{ "api_name": "翻译文本", "api_url": "https://api.example.com/translate", "method": "POST", "api_key": "your-api-key-here", "key_location": "header", "key_name": "Authorization", "request_format": { "text": "string", "source": "string", "target": "string" }, "response_format": { "translated": "string", "status": "number" }, "description": "将文本从源语言翻译到目标语言" }
register_api
工具,可以通过AI助手直接调用注册新APIlist_registered_apis
工具查看所有已注册的APIremove_registered_api
工具删除指定的APIapi_configs.json
文件中~/.xiaozhi_mcp_config.json
文件中