Integrations
该项目通过MCP协议将本地 LLM(例如 Qwen)连接到计算器或知识库等工具。助手会自动检测并调用这些工具来帮助解答用户疑问。
📦 功能
- 🔧 通过 MCP 服务器执行工具
- 🧠 通过 HTTP 或 OpenAI SDK 进行本地 LLM 集成
- 📚 知识库支持(
data.json
) - ⚡ 支持
stdio
和sse
传输
🗂 项目文件
文件 | 描述 |
---|---|
server.py | 注册工具并启动 MCP 服务器 |
client-http.py | 使用aiohttp 与本地 LLM 通信 |
clientopenai.py | 使用与 OpenAI 兼容的 SDK 实现 LLM + 工具调用逻辑 |
client-stdio.py | 使用 stdio 的 MCP 客户端 |
client-see.py | 使用 SSE 的 MCP 客户端 |
data.json | 问答知识库 |
📥 安装
要求
Python 3.8+
安装依赖项:
Copy
requirements.txt
Copy
🚀 入门
1. 运行 MCP 服务器
Copy
这将启动您的工具服务器,具有add
、 multiply
和get_knowledge_base
等功能。
2. 启动客户端
选项 A:HTTP 客户端(通过原始 API 的本地 LLM)
Copy
选项 B:OpenAI SDK 客户端
Copy
选项 C:stdio 传输
Copy
选项 D:SSE 传输
确保server.py
设置:
Copy
然后运行:
Copy
💬 示例提示
数学工具调用
Copy
回复:
Copy
知识库问题
Copy
响应将包括来自data.json
的相关答案。
📁示例: data.json
Copy
🔧 配置
在client-http.py
或clientopenai.py
中,更新以下内容:
Copy
确保您的 LLM 提供与 OpenAI 兼容的 API 端点。
🧹 清理
客户端自动处理工具调用和响应。您可以使用Ctrl+C
停止服务器或客户端。
🪪 许可证
MIT 许可证。请参阅LICENSE文件。
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
通过 MCP 协议将本地 LLM 连接到外部工具(计算器、知识库),实现自动工具检测和执行,以增强查询响应。
Related MCP Servers
- -securityAlicense-qualityMCP server for toolhouse.ai. This does not rely on an external llm unlike the official server.Last updated -1PythonMIT License
- -securityAlicense-qualityA comprehensive toolkit that enhances LLM capabilities through the Model Context Protocol, allowing LLMs to interact with external services including command-line operations, file management, Figma integration, and audio processing.Last updated -14PythonApache 2.0
- -securityAlicense-qualityAn MCP server that provides tools to load and fetch documentation from any llms.txt source, giving users full control over context retrieval for LLMs in IDE agents and applications.Last updated -177PythonMIT License
- -security-license-qualityA tool server that processes mathematical expressions via Multi-Chain Protocol (MCP), allowing LLMs to solve math problems through tool integration.Last updated -PythonMIT License