Skip to content

build: cap mcp dependency to <2 (fixes #235) - #236

Open
DUC750 wants to merge 1 commit into
sparfenyuk:mainfrom
DUC750:fix/cap-mcp-below-2
Open

build: cap mcp dependency to <2 (fixes #235)#236
DUC750 wants to merge 1 commit into
sparfenyuk:mainfrom
DUC750:fix/cap-mcp-below-2

Conversation

@DUC750

@DUC750 DUC750 commented Jul 30, 2026

Copy link
Copy Markdown

Problem

mcp-proxy declares an unbounded mcp>=1.27.1. mcp 2.0.0 removed request_ctx from mcp.server.lowlevel.server, which src/mcp_proxy/proxy_server.py imports at module load. As a result, any fresh resolution (uvx mcp-proxy, a clean pip install, or a Docker rebuild) pulls mcp==2.0.0 and crashes on startup:

ImportError: cannot import name 'request_ctx' from 'mcp.server.lowlevel.server'

This matches the report in #235.

Fix

Cap the dependency at mcp>=1.27.1,<2 so resolution stays on the 1.x line that still provides request_ctx. This is the minimal change that restores a working install; it does not add support for mcp 2.x (that would require migrating proxy_server.py off the removed request_ctx API and can be a follow-up). The cap can be lifted/raised once the code targets the 2.x request-context API.

Verified locally (alpine 3.24, Python 3.14, mcp-proxy 0.12.0):

  • without the cap → resolves mcp==2.0.0import mcp_proxy.proxy_server raises the ImportError above
  • with the cap → resolves mcp==1.29.0 → import succeeds

Closes #235.

@RenanMsV RenanMsV left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This provides a simple and straightforward way to address the issue until MCP 2.0.0 support is available.

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.

Unbounded mcp>=1.17.0 dependency lets uvx mcp-proxy resolve mcp==2.0.0, which removed request_ctx — every ephemeral run crashes on import

2 participants