Skip to content

ModuleNotFoundError: No module named 'pydantic_core._pydantic_core' when importing from mcp.server even though pydantic-core is installed #570

Open
@ABHIJITH-EA

Description

@ABHIJITH-EA

Describe the bug
I'm using the mcp package (version 1.6.0) in a Docker container based on node:20-alpine, running Python 3.11.12. When I try to import NotificationOptions and Server from mcp.server, I get the following error:

ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'

Even though pydantic-core==2.33.1 and pydantic==2.11.3 are already installed.

To Reproduce
Steps to reproduce the behavior:

  1. Use a Docker image based on node:20-alpine
  2. Install Python 3.11.12
  3. Install mcp==1.6.0 using uv pip install
  4. Try this import in Python:
    from mcp.server import NotificationOptions, Server
  5. See the ModuleNotFoundError for pydantic_core._pydantic_core

Expected behavior
The import should work as expected since pydantic-core is installed. There should be no missing module error if dependencies are properly installed.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Alpine (via Docker node:20-alpine)
  • Python version: 3.13
  • MCP version: 1.6.0
  • Install method: uv pip install mcp==1.6.0

Smartphone (please complete the following information):
Not applicable.

Additional context
Here is the relevant part of uv pip freeze:

pydantic==2.11.3  
pydantic-core==2.33.1  
mcp==1.6.0  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions