From a15a42be5325d57262f7f78b7431193a6e7c9a1a Mon Sep 17 00:00:00 2001 From: linsamtw Date: Sat, 1 Aug 2026 18:04:52 +0800 Subject: [PATCH] =?UTF-8?q?Pin=20mcp<2.0.0=20=E2=80=94=20mcp=202.0=20remov?= =?UTF-8?q?ed=20the=20Server=20decorator=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mcp 2.0.0 dropped the 1.x @app.list_tools()/@app.call_tool() decorator API, so fresh installs resolving mcp>=1.0.0 to 2.0.0 crash at import with AttributeError: 'Server' object has no attribute 'list_tools'. Fixes #16 Co-Authored-By: Claude Fable 5 --- pyproject.toml | 2 +- uv.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0922d7c..f2b0e6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ classifiers = [ "Topic :: Office/Business :: Financial", ] dependencies = [ - "mcp>=1.0.0", + "mcp>=1.0.0,<2.0.0", # 2.0 移除了 Server 的 list_tools/call_tool decorator API(issue #16) "httpx>=0.27", "pydantic>=2.0", ] diff --git a/uv.lock b/uv.lock index 0e59493..823ecc4 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 2 +revision = 3 requires-python = ">=3.10" [[package]] @@ -246,7 +246,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "httpx", specifier = ">=0.27" }, - { name = "mcp", specifier = ">=1.0.0" }, + { name = "mcp", specifier = ">=1.0.0,<2.0.0" }, { name = "pydantic", specifier = ">=2.0" }, { name = "pytest", marker = "extra == 'dev'", specifier = ">=7" }, { name = "pytest-asyncio", marker = "extra == 'dev'", specifier = ">=0.23" },