Skip to content

Pin mcp below 2.0 to fix fresh installs - #58

Merged
oleksandr-nc merged 1 commit into
mainfrom
feature/pin-mcp-below-2
Sep 15, 2026
Merged

oleksandr-nc merged 1 commit into
mainfrom
feature/pin-mcp-below-2

Conversation

@oleksandr-nc

Copy link
Copy Markdown
Contributor

Summary

pyproject.toml declared mcp[cli]>=1.20 with no upper bound. mcp 2.0.0 (released 2026-07-28) removed mcp.server.fastmcp: FastMCP is now mcp.server.mcpserver.MCPServer, and other APIs changed. A fresh install now resolves mcp 2.2.0, and the server fails on startup at from mcp.server.fastmcp import FastMCP in src/nc_mcp_server/server.py:

ModuleNotFoundError: No module named 'mcp.server.fastmcp'. This is mcp 2.x, where FastMCP was renamed to MCPServer ...

In 2.x, mcp/server/fastmcp.py is only a stub that raises this error (same in v2.1.1 and v2.2.0), so there is no compatibility path without code changes.

This PR caps the requirement at mcp[cli]>=1.20,<2. It is the minimal unblock; migrating to the 2.x MCPServer API is separate work.

Worth knowing

  • PyPI installs stay broken until a release. The published nc-mcp-server 0.7.0 has the same unbounded requirement, so pip install nc-mcp-server pulls mcp 2.2.0 today. A patch release (e.g. 0.7.1) is needed after merge; publish.yml runs when a GitHub release is published.
  • CI hasn't caught this yet. The unit-test workflow installs with pip install -e ".[dev]", and its last run (2026-07-26, on Bump the ci-dependencies group across 1 directory with 4 updates #57) was two days before mcp 2.0.0 shipped. Any new run without this cap would install mcp 2.x.

Test plan

  • uv pip compile of mcp[cli]>=1.20 resolves mcp==2.2.0; with <2 it resolves mcp==1.30.0
  • With mcp 1.29.1 installed, nc_mcp_server.server imports and the unit tests run locally on Windows: 93 passed; the 11 failures are Windows-specific symlink/FIFO/os.O_NOFOLLOW tests, unrelated to this change
  • CI green (unit tests on Python 3.12–3.14)

mcp 2.0 removed mcp.server.fastmcp: FastMCP is now
mcp.server.mcpserver.MCPServer, and other APIs changed. Because the
dependency was declared as mcp[cli]>=1.20 with no upper bound, a fresh
install now resolves mcp 2.2.0, and the server fails at startup when
server.py imports FastMCP:

    ModuleNotFoundError: No module named 'mcp.server.fastmcp'

Cap the requirement at <2 until the code is migrated to the 2.x API.
With the cap, a fresh resolve picks mcp 1.30.0.
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 1cd4e225-3bb7-47b2-979a-9bf71c07fcf6


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@oleksandr-nc
oleksandr-nc merged commit d6c3af6 into main Sep 15, 2026
8 of 11 checks passed
@oleksandr-nc
oleksandr-nc deleted the feature/pin-mcp-below-2 branch September 15, 2026 11:46
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