Skip to content

fix: support mcp SDK v2 (FastMCP renamed to MCPServer) - #81

Merged
nrvim merged 1 commit into
mainfrom
fix/mcp-v2-compat
Aug 22, 2026
Merged

fix: support mcp SDK v2 (FastMCP renamed to MCPServer)#81
nrvim merged 1 commit into
mainfrom
fix/mcp-v2-compat

Conversation

@nrvim

@nrvim nrvim commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Unblocks #78.

mcp 2.0 removed the mcp.server.fastmcp module (FastMCP is now mcp.server.MCPServer; the decorator API and run(transport="stdio") are unchanged), which is why #78's CI is red: the bound bump lets pip resolve mcp 2.x, and garmin_mcp/server.py fails to import.

This adds a try/except import so the server works with both mcp v1 and v2, making the >=1.0,<3 range in #78 genuinely installable.

Verified:

  • Under mcp 2.0.0 (clean venv): garmin_mcp.server imports and all 48 tools register (was ModuleNotFoundError: No module named 'mcp.server.fastmcp' before the shim).
  • Under mcp 1.27.0: full test suite passes (251 tests), ruff clean.

Merge order: land this first, then comment @dependabot rebase on #78 — its CI should go green and it can merge.

🤖 Generated with Claude Code

mcp 2.0 removed the mcp.server.fastmcp module; the decorator API and
run(transport="stdio") are unchanged on the renamed MCPServer class.
Import whichever is available so the package works with mcp >=1.0,<3,
unblocking the dependabot bound bump in #78.

Verified under mcp 2.0.0: server imports and all 48 tools register.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@nrvim
nrvim merged commit 1179a50 into main Aug 22, 2026
7 checks passed
@nrvim
nrvim deleted the fix/mcp-v2-compat branch August 22, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant