Skip to content

Fix: Docker build fails due to dependency version incompatibility #13

@perctrix

Description

@perctrix

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

  1. 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.

  2. 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

cd mcp_server && uv lock

Environment

  • OS: Windows 11
  • Docker Desktop
  • Python 3.11

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