Skip to content

commerce-common: cap the mcp extras below 2 so mcp_server imports - #42

Open
vishalhabib99 wants to merge 1 commit into
anthropics:mainfrom
vishalhabib99:fix/cap-mcp-extras
Open

vishalhabib99 wants to merge 1 commit into
anthropics:mainfrom
vishalhabib99:fix/cap-mcp-extras

Conversation

@vishalhabib99

Copy link
Copy Markdown

commerce-common/README.md says the [mcp] extra installs what mcp_server.py needs. The [sdk], [mcp] and [dev] extras allow mcp>=1.2, so a fresh install today resolves mcp 2.3.0. commerce_common/mcp_server.py (like both managed-agent servers) imports from mcp.server.fastmcp import Context, FastMCP, a module mcp 2.x removed:

$ pip install "./commerce-common[mcp]"
$ python -c "import commerce_common.mcp_server"
ModuleNotFoundError: No module named 'mcp.server.fastmcp'. This is mcp 2.x, where FastMCP was renamed to MCPServer ...

requirements.txt already pins mcp==1.29.0, so the README's main install path is unaffected. Only installs through the extras break, such as a project that lists commerce-common[mcp] as a dependency.

This caps the three extras at mcp>=1.2,<2, until the servers move to mcp.server.mcpserver.MCPServer.

Checked (main at fd4d592, Python 3.12, clean venvs):

  • before: [mcp] → mcp 2.3.0 → the import above fails
  • after: [mcp], [sdk] and [dev] each resolve mcp 1.30.0, and import commerce_common.mcp_server succeeds
  • pytest commerce-common/tests plus both managed-agent MCP server test suites, installed from requirements-dev.txt: 175 passed

The [sdk], [mcp] and [dev] extras allowed mcp>=1.2, so a fresh install
resolved mcp 2.3.0, where mcp.server.fastmcp no longer exists and
commerce_common.mcp_server fails to import. requirements.txt already
pins mcp==1.29.0; this keeps installs through the extras on 1.x too.
@vishalhabib99

Copy link
Copy Markdown
Author

Hi, just checking whether this one is on your radar. A fresh pip install "./commerce-common[mcp]" resolves mcp 2.3.0 and mcp_server fails on import (mcp.server.fastmcp was removed); this caps the extras below 2, matching requirements.txt. Happy to change anything.

@vishalhabib99

Copy link
Copy Markdown
Author

Friendly ping on this one. Happy to rebase or change anything that would help it land. Thanks!

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