Skip to content

Conversation

@lukemmtt
Copy link
Contributor

@lukemmtt lukemmtt commented Aug 1, 2025

Summary

Users updating their environments (e.g., running pip install --upgrade or 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.toml only specified mcp[cli]>=1.10.1 without 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 **settings
v2.0: The constructor now explicitly requires name and instructions parameters, while the old parameters (version, description, dependencies, env_vars) are no longer supported

This caused the following error for users:

TypeError: FastMCP.__init__() got an unexpected keyword argument 'version'

Solution

This PR implements a two-part fix:

1. Code Changes

Updated the FastMCP initialization to use only the currently supported parameters:

  • Removed unsupported parameters: version, dependencies, env_vars
  • Changed description parameter to instructions
  • Kept minimal initialization that works with FastMCP 2.x API

2. Dependency Constraints

Added explicit version constraints to prevent future breaking changes:

  • Added fastmcp>=2.0.0,<3.0.0 to dependencies
  • This ensures compatibility with FastMCP 2.x while preventing automatic updates to FastMCP 3.x

Testing

Tested locally with FastMCP 2.10.6 and confirmed the server starts successfully without errors.

Fixes #76

@lukemmtt lukemmtt force-pushed the fix-fastmcp-compatibility branch from 9ed0a61 to 77839dc Compare August 1, 2025 01:03
The excel-mcp-server was using outdated FastMCP API parameters (version, description, dependencies, env_vars) that are no longer supported in the current FastMCP version. Updated the initialization to use only the supported parameters (name and instructions) to resolve the TypeError.

Also added explicit dependency on fastmcp>=2.0.0,<3.0.0 to ensure compatibility with FastMCP 2.x API and prevent future breaking changes from major version updates.

This fixes the "TypeError: FastMCP.__init__() got an unexpected keyword argument 'version'" error when running excel-mcp-server.

Fixes haris-musa#76
@lukemmtt lukemmtt force-pushed the fix-fastmcp-compatibility branch from 77839dc to f5a4f84 Compare August 1, 2025 01:03
@HougeLangley
Copy link

Working for me

@haris-musa
Copy link
Owner

Thank you !

@haris-musa haris-musa merged commit 89302b8 into haris-musa:main Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: FastMCP.__init__() got an unexpected keyword argument 'version'

3 participants