Skip to content

Pin langchain-mcp-adapters and mcp versions - #25

Merged
aviweit merged 2 commits into
skillberry-ai:mainfrom
aviweit:fix/pin-langchain-mcp-adapters
Jul 30, 2026
Merged

aviweit merged 2 commits into
skillberry-ai:mainfrom
aviweit:fix/pin-langchain-mcp-adapters

Conversation

@aviweit

@aviweit aviweit commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Fix: Pin langchain-mcp-adapters and mcp versions

Why This PR Was Needed

Breaking Change in mcp 2.0.0: MCP 2.0.0 removed RequestContext from mcp.shared.context, which is still imported by langchain-mcp-adapters versions ≤0.3.0 at module load time. This causes an ImportError on every request.

The Issue:

  • langchain-mcp-adapters 0.3.1+ still imports the removed RequestContext
  • This surfaces as HTTP 500 errors from the skillberry proxy agent
  • Without version pinning, dependency resolution would pull mcp 2.0.0+ and break the application

The Solution:

  1. Pin mcp to >= 1.9.2, < 2.0.0 — Keeps the dependency on the mcp 1.x series which still exports RequestContext
  2. Pin langchain-mcp-adapters to >= 0.2.1, <= 0.3.0 — Ensures we use adapter versions compatible with mcp 1.x

This maintains stability until langchain-mcp-adapters releases a version compatible with mcp 2.0.0+.

Description

This PR pins version constraints for langchain-mcp-adapters and mcp dependencies to prevent compatibility issues.

  • Added explicit mcp dependency with upper bound constraint < 2.0.0
  • Added upper bound constraint <= 0.3.0 to langchain-mcp-adapters to prevent breaking changes in future releases

aviweit added 2 commits July 29, 2026 17:37
mcp 2.0.0 removed RequestContext from mcp.shared.context which
langchain-mcp-adapters 0.3.1 still imports, causing an ImportError
that surfaces as HTTP 500 from the skillberry proxy agent.

Capping at 0.3.0 keeps the dependency on the mcp 1.x-compatible
adapter release.
mcp 2.0.0 removed RequestContext from mcp.shared.context.
langchain-mcp-adapters <=0.3.0 still imports it at module load time,
causing an ImportError on every request. Explicitly cap mcp to <2.0.0.
@aviweit aviweit self-assigned this Jul 30, 2026
@aviweit
aviweit merged commit e359494 into skillberry-ai:main Jul 30, 2026
1 check failed
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