Skip to content

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

Description

@weike-zhang

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions