Skip to content

lean_explore/mcp/app.py:97 uses pre v1.12.3 FastMCP() constructor #5

Description

@KellyJDavis

Currently src/lean_explore/mcp/app.py creates FastMCP as follows

mcp_app = FastMCP(                                                                                  
    "LeanExploreMCPServer",                                                                         
    version="0.1.0",                                                                                
    description=(                                                                                   
        "MCP Server for Lean Explore, providing tools to search and query Lean"                     
        " mathematical data."                                                                       
    ),                                                                                              
    lifespan=app_lifespan,                                                                          
)

However, it seems that as of mcp release v1.12.3 the FastMCP() constructor does not accept version or description as a argument to FastMCP constructor.

For example executing leanexplore chat fails as follows

(.venv) kdavis@Kellys-MacBook-Pro lean-explore % leanexplore chat                     
2025-11-01 11:13:59 - INFO [lean_explore.cli.agent:305] Loaded OpenAI API key from CLI configuration.
Traceback (most recent call last):
  File "/Users/kdavis/Code/project-numina/lean-explore/.venv/lib/python3.14/site-packages/lean_explore/mcp/server.py", line 30, in <module>
    from lean_explore.mcp import tools  # noqa: F401 pylint: disable=unused-import
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kdavis/Code/project-numina/lean-explore/.venv/lib/python3.14/site-packages/lean_explore/mcp/tools.py", line 17, in <module>
    from lean_explore.mcp.app import AppContext, BackendServiceType, mcp_app
  File "/Users/kdavis/Code/project-numina/lean-explore/.venv/lib/python3.14/site-packages/lean_explore/mcp/app.py", line 97, in <module>
    mcp_app = FastMCP(
        "LeanExploreMCPServer",
    ...<5 lines>...
        lifespan=app_lifespan,
    )
TypeError: FastMCP.__init__() got an unexpected keyword argument 'version'

One possible answer would be to limit the mcp version used

diff --git a/pyproject.toml b/pyproject.toml
index deb5b33..927d65e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -48,7 +48,7 @@ dependencies = [
     "openai-agents>=0.0.16",
 
     # MCP Server Components
-    "mcp>=1.9.0",
+    "mcp>=1.9.0,<1.12.3",
 
     # Utilities
     "tqdm>=4.60",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions