WeKnora/.github
veater 37837c00a9 fix(mcp-server): migrate to MCPServer high-level API (mcp 2.x) [v1.1.0]
MCP Python SDK 2.0 removed the low-level Server decorator API
(@app.list_tools() / @app.call_tool() / app.get_capabilities()), so the
server crashed at startup with:
  AttributeError: 'Server' object has no attribute 'list_tools'

The released PyPI package weknora-mcp==1.0.1 declared 'mcp>=1.0.0' with
no upper bound, so uvx resolved to the latest 2.0.0 and the plugin's
weknora MCP server could no longer connect.

Fix: rewrite the server on top of the mcp 2.x high-level MCPServer API
(formerly FastMCP), and cap the dependency at 'mcp>=2,<3'.

- weknora_mcp_server.py: replace @app.list_tools()/@app.call_tool() with
  28 @mcp.tool() function-signature tools (input schema auto-generated
  from type hints, descriptions from docstrings, plain return values
  serialized by the framework). Transports use run_stdio_async() /
  sse_app() / streamable_http_app(). WeKnoraClient business logic is
  unchanged.
- deps: mcp>=2,<3 in pyproject.toml / requirements.txt / setup.py;
  commit uv.lock pinning mcp 2.0.0.
- version bump to 1.1.0 (pyproject, setup, __init__, main --version,
  server_version).
- check_imports.py: validate MCPServer / ToolError / mcp_types imports.
- ci(.github/workflows/mcp-server.yml): publish on merge to main +
  manual dispatch, not only on tags; add PyPI version-dedup check so
  re-runs on an unchanged version stay green (absorbed from PR #2399).

Verified: stdio initialize + tools/list returns all 28 tools; no
list_tools AttributeError; tool dispatch + error wrapping confirmed.

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-07-30 15:52:28 +08:00
..
ISSUE_TEMPLATE chore(release): v0.6.0 2026-05-21 16:56:19 +08:00
workflows fix(mcp-server): migrate to MCPServer high-level API (mcp 2.x) [v1.1.0] 2026-07-30 15:52:28 +08:00
dependabot.yml chore(deps): update dependencies in /docreader and adjust dependabot configuration 2026-05-12 14:58:52 +08:00
pull_request_template.md docs: clarify contributor validation workflow 2026-07-28 20:45:30 +08:00