fix python dependency version for mcp

This commit is contained in:
suroy
2025-10-30 16:00:28 +08:00
committed by begoniezhao
parent a1d0ccaa09
commit 8a40377a4a
10 changed files with 130 additions and 14 deletions

View File

@@ -170,6 +170,8 @@ git clone https://github.com/Tencent/WeKnora
``` ```
#### 2⃣ Configure MCP Server #### 2⃣ Configure MCP Server
> It is recommended to directly refer to the [MCP Configuration Guide](./mcp-server/MCP_CONFIG.md) for configuration.
Configure the MCP client to connect to the server: Configure the MCP client to connect to the server:
```json ```json
{ {

View File

@@ -167,6 +167,8 @@ WeKnora 作为[微信对话开放平台](https://chatbot.weixin.qq.com)的核心
git clone https://github.com/Tencent/WeKnora git clone https://github.com/Tencent/WeKnora
``` ```
#### 2⃣配置MCP服务器 #### 2⃣配置MCP服务器
> 推荐直接参考 [MCP配置说明](./mcp-server/MCP_CONFIG.md) 进行配置。
mcp客户端配置服务器 mcp客户端配置服务器
```json ```json
{ {

View File

@@ -168,6 +168,8 @@ WeKnoraは[WeChat対話オープンプラットフォーム](https://chatbot.wei
git clone https://github.com/Tencent/WeKnora git clone https://github.com/Tencent/WeKnora
``` ```
#### 2⃣MCPサーバーの設定 #### 2⃣MCPサーバーの設定
> 設定には直接 [MCP設定説明](./mcp-server/MCP_CONFIG.md) を参照することをお勧めします。
MCPクライアントでサーバーを設定 MCPクライアントでサーバーを設定
```json ```json
{ {

View File

@@ -88,11 +88,11 @@ WeKnoraMCP/
- 完整的测试覆盖 - 完整的测试覆盖
### 依赖 ### 依赖
- Python 3.8+ - Python 3.10+
- mcp >= 1.0.0 - mcp >= 1.0.0
- requests >= 2.31.0 - requests >= 2.31.0
### 兼容性 ### 兼容性
- 支持 Windows、macOS、Linux - 支持 Windows、macOS、Linux
- 支持 Python 3.8-3.12 - 支持 Python 3.10-3.12
- 兼容现代 Python 包管理工具 - 兼容现代 Python 包管理工具

View File

@@ -103,7 +103,7 @@ python main.py --check-only
### 1. 导入错误 ### 1. 导入错误
如果遇到 `ImportError`,请确保: 如果遇到 `ImportError`,请确保:
- 已安装所有依赖:`pip install -r requirements.txt` - 已安装所有依赖:`pip install -r requirements.txt`
- Python 版本兼容(推荐 3.8+ - Python 版本兼容(推荐 3.10+
- 没有文件名冲突 - 没有文件名冲突
### 2. 连接错误 ### 2. 连接错误

114
mcp-server/MCP_CONFIG.md Normal file
View File

@@ -0,0 +1,114 @@
# 使用 uv 运行 WeKnora MCP 服务器
> 更推荐使用`uv`来运行基于python的MCP服务。
## 1. 安装 uv
```bash
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# 或使用 Homebrew (macOS)
brew install uv
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
## 2. MCP 客户端配置
### Claude Desktop 配置
在 Claude Desktop 设置中添加:
```json
{
"mcpServers": {
"weknora": {
"args": [
"--directory",
"/path/WeKnora/mcp-server",
"run",
"run_server.py"
],
"command": "uv",
"env": {
"WEKNORA_API_KEY": "your_api_key_here",
"WEKNORA_BASE_URL": "http://localhost:8080/api/v1"
}
}
}
}
```
### Cursor 配置
在 Cursor 中,编辑 MCP 配置文件 (通常在 `~/.cursor/mcp-config.json`):
```json
{
"mcpServers": {
"weknora": {
"command": "uv",
"args": [
"--directory",
"/path/WeKnora/mcp-server",
"run",
"run_server.py"
],
"env": {
"WEKNORA_API_KEY": "your_api_key_here",
"WEKNORA_BASE_URL": "http://localhost:8080/api/v1"
}
}
}
}
```
### KiloCode 配置
对于 KiloCode 或其他支持 MCP 的编辑器,配置如下:
```json
{
"mcpServers": {
"weknora": {
"command": "uv",
"args": [
"--directory",
"/path/WeKnora/mcp-server",
"run",
"run_server.py"
],
"env": {
"WEKNORA_API_KEY": "your_api_key_here",
"WEKNORA_BASE_URL": "http://localhost:8080/api/v1"
}
}
}
}
```
### 其他 MCP 客户端
对于一般 MCP 客户端配置:
```json
{
"mcpServers": {
"weknora": {
"command": "uv",
"args": [
"--directory",
"/path/WeKnora/mcp-server",
"run",
"run_server.py"
],
"env": {
"WEKNORA_API_KEY": "your_api_key_here",
"WEKNORA_BASE_URL": "http://localhost:8080/api/v1"
}
}
}
}
```

View File

@@ -184,9 +184,7 @@ WeKnora MCP Server 模组测试
## 🔍 兼容性 ## 🔍 兼容性
### Python 版本 ### Python 版本
- ✅ Python 3.8+ - ✅ Python 3.10+
- ✅ Python 3.9
- ✅ Python 3.10
- ✅ Python 3.11 - ✅ Python 3.11
- ✅ Python 3.12 - ✅ Python 3.12
@@ -275,5 +273,5 @@ python test_module.py # 运行测试
**项目状态**: ✅ 完成并可投入使用 **项目状态**: ✅ 完成并可投入使用
**项目仓库**: https://github.com/NannaOlympicBroadcast/WeKnoraMCP **项目仓库**: https://github.com/NannaOlympicBroadcast/WeKnoraMCP
**最后更新**: 2024年1月 **最后更新**: 2025年10
**版本**: 1.0.0 **版本**: 1.0.0

View File

@@ -4,6 +4,8 @@
## 快速开始 ## 快速开始
> 推荐直接参考 [MCP配置说明](./MCP_CONFIG.md),无需进行以下操作。
### 1. 安装依赖 ### 1. 安装依赖
```bash ```bash
pip install -r requirements.txt pip install -r requirements.txt
@@ -133,5 +135,5 @@ python test_module.py
如果遇到导入错误,请确保: 如果遇到导入错误,请确保:
1. 已安装所有必需的依赖包 1. 已安装所有必需的依赖包
2. Python 版本兼容(推荐 3.8+ 2. Python 版本兼容(推荐 3.10+
3. 没有文件名冲突(避免使用 `mcp.py` 作为文件名) 3. 没有文件名冲突(避免使用 `mcp.py` 作为文件名)

View File

@@ -21,8 +21,6 @@ classifiers = [
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",
"Operating System :: OS Independent", "Operating System :: OS Independent",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.12",
@@ -30,7 +28,7 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Artificial Intelligence",
] ]
requires-python = ">=3.8" requires-python = ">=3.10"
dependencies = [ dependencies = [
"mcp>=1.0.0", "mcp>=1.0.0",
"requests>=2.31.0", "requests>=2.31.0",

View File

@@ -38,8 +38,6 @@ setup(
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",
"Operating System :: OS Independent", "Operating System :: OS Independent",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.12",
@@ -47,7 +45,7 @@ setup(
"Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Artificial Intelligence",
], ],
python_requires=">=3.8", python_requires=">=3.10",
install_requires=read_requirements(), install_requires=read_requirements(),
entry_points={ entry_points={
"console_scripts": [ "console_scripts": [