Skip to content

Commit 4f7a36c

Browse files
committed
fix(mcp-server): pin MCP Python SDK to v1.x
WeKnora MCP Server still uses v1 low-level Server decorators such as @app.list_tools(). MCP SDK 2.0 removed those APIs, so fresh installs could fail at startup with AttributeError. Cap the dependency at <2 and require >=1.28 for Streamable HTTP transport support.
1 parent 7d2a631 commit 4f7a36c

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

mcp-server/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/)
66
并且本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)
77

8+
## [Unreleased]
9+
10+
### 修复
11+
-`mcp` 依赖上限锁定为 `<2`,避免 `pip install` / `uv sync` 自动安装 MCP Python SDK 2.x 导致 `@app.list_tools()` 启动失败(`AttributeError: 'Server' object has no attribute 'list_tools'`
12+
813
## [1.0.1] - 2026-07-28
914

1015
### 修复

mcp-server/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ classifiers = [
3030
]
3131
requires-python = ">=3.10"
3232
dependencies = [
33-
"mcp>=1.0.0",
33+
"mcp>=1.28,<2",
3434
"requests>=2.31.0",
35+
"starlette>=0.27.0",
36+
"uvicorn>=0.24.0",
3537
]
3638

3739
[project.optional-dependencies]

mcp-server/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mcp>=1.0.0
1+
mcp>=1.28,<2
22
requests>=2.31.0
33
starlette>=0.27.0
4-
uvicorn>=0.24.0
4+
uvicorn>=0.24.0

mcp-server/setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ def read_requirements():
2323
line.strip() for line in f if line.strip() and not line.startswith("#")
2424
]
2525
except FileNotFoundError:
26-
return ["mcp>=1.0.0", "requests>=2.31.0"]
26+
return [
27+
"mcp>=1.28,<2",
28+
"requests>=2.31.0",
29+
"starlette>=0.27.0",
30+
"uvicorn>=0.24.0",
31+
]
2732

2833

2934
setup(

0 commit comments

Comments
 (0)