Fix FastMCP compatibility issue #77
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Users updating their environments (e.g., running
pip install --upgradeor reinstalling) suddenly find excel-mcp-server broken with a TypeError. This PR fixes the FastMCP 2.x compatibility issue and adds version constraints to prevent future breaking changes.Root Cause Analysis
The excel-mcp-server uses FastMCP, a Python framework for building MCP (Model Context Protocol) servers. The excel-mcp-server was configured with an unbounded version constraint for its dependencies. The
pyproject.tomlonly specifiedmcp[cli]>=1.10.1without any upper bound, which allowed any newer version to be installed, including versions with breaking API changes.When FastMCP released version 2.0 (compare v1.0...v2.0.0), it introduced breaking changes to the API. The FastMCP constructor was changed in
src/fastmcp/server/server.py:v1.0: The constructor accepted various parameters through
**settingsv2.0: The constructor now explicitly requires
nameandinstructionsparameters, while the old parameters (version,description,dependencies,env_vars) are no longer supportedThis caused the following error for users:
Solution
This PR implements a two-part fix:
1. Code Changes
Updated the FastMCP initialization to use only the currently supported parameters:
version,dependencies,env_varsdescriptionparameter toinstructions2. Dependency Constraints
Added explicit version constraints to prevent future breaking changes:
fastmcp>=2.0.0,<3.0.0to dependenciesTesting
Tested locally with FastMCP 2.10.6 and confirmed the server starts successfully without errors.
Fixes #76