unclecode / unclecode/crawl4ai

[Bug]: Docker server fails to boot after mcp 2.0.0 release — mcp_bridge uses the removed v1 low-level API

Open Beginner friendly
#2,147 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
83.9k
Forks
8.7k
Avg merge
3d 7h
Merged PRs (30d)
11

Description

crawl4ai version

Docker server (deploy/docker), requirements.txt as of today (mcp>=1.18.0).

Expected Behavior

The Docker server boots and exposes the API, with the MCP layer at /mcp/sse, /mcp/ws, /mcp/schema.

Current Behavior

A fresh build/install now fails to start the server. The mcp Python SDK released v2.0.0 on 2026-07-28, and deploy/docker/requirements.txt pins mcp>=1.18.0 with no upper bound, so a fresh pip install -r deploy/docker/requirements.txt resolves mcp==2.0.0. The v2 low-level API removed the Server.list_tools/call_tool/list_resources/read_resource/list_resource_templates decorator helpers that deploy/docker/mcp_bridge.py uses, so attach_mcp() crashes at import time:

AttributeError: 'Server' object has no attribute 'list_tools'

server.py calls attach_mcp(app, ...) at module level (line ~1092), so uvicorn server:app fails on boot. .github/workflows/security.yml installs the same requirements, so CI is broken too.

Steps to Reproduce
pip install "mcp==2.0.0" fastapi uvicorn httpx anyio pydantic PyJWT
python - <<'PY'
import os, sys
sys.path.insert(0, "deploy/docker")
os.environ["CRAWL4AI_API_TOKEN"] = "x"
from fastapi import FastAPI
from mcp_bridge import attach_mcp
app = FastAPI()
attach_mcp(app, base_url="http://127.0.0.1:8020")
PY

Output: AttributeError: 'Server' object has no attribute 'list_tools'.

With pip install "mcp==1.18.0" the same code works and the MCP SSE handshake completes.

Root Cause
Suggested Fix

Add the <2 ceiling to the requirement (as the mcp SDK maintainers recommend for projects not yet migrated to v2):

- mcp>=1.18.0
+ mcp>=1.18.0,<2

A proper migration of mcp_bridge.py to the v2 low-level API can be done separately.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Update deploy/docker/requirements.txt to constrain the mcp dependency, then inspect deploy/docker/mcp_bridge.py and the server.py attach_mcp call to confirm the existing v1 API remains supported. Rebuild or install the Docker requirements and run the provided attach_mcp reproduction, then verify that uvicorn server:app boots and the MCP endpoints remain available.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, fastapi, python
Domain
api, backend, devops
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.