Problem
The Docker build for mcp_server fails with the following error:
TypeError: cannot specify both default and default_factory
This is caused by incompatibility between fastmcp==2.10.3 and pydantic>=2.12.
Root Cause
-
Missing uv.lock in Dockerfile: The Dockerfile only copies pyproject.toml but not uv.lock, causing uv sync to resolve dependencies fresh each time, potentially installing incompatible versions.
-
Outdated dependencies: fastmcp==2.10.3 and mcp==1.10.1 are incompatible with newer versions of pydantic.
Proposed Fix
1. Update mcp_server/Dockerfile
- COPY pyproject.toml ./
+ COPY pyproject.toml uv.lock ./
- RUN uv sync
+ RUN uv sync --frozen
2. Update mcp_server/pyproject.toml
- "fastmcp==2.10.3",
+ "fastmcp>=2.14.0",
- "mcp==1.10.1",
+ "mcp>=1.24.0",
3. Regenerate uv.lock
Environment
- OS: Windows 11
- Docker Desktop
- Python 3.11
Problem
The Docker build for
mcp_serverfails with the following error:This is caused by incompatibility between
fastmcp==2.10.3andpydantic>=2.12.Root Cause
Missing
uv.lockin Dockerfile: TheDockerfileonly copiespyproject.tomlbut notuv.lock, causinguv syncto resolve dependencies fresh each time, potentially installing incompatible versions.Outdated dependencies:
fastmcp==2.10.3andmcp==1.10.1are incompatible with newer versions ofpydantic.Proposed Fix
1. Update
mcp_server/Dockerfile2. Update
mcp_server/pyproject.toml3. Regenerate
uv.lockEnvironment