Fix FastMCP compatibility issue and update dependencies (#77)

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 #76
This commit is contained in:
Luke Memet
2025-08-01 03:30:24 -04:00
committed by GitHub
parent 429a1e2a13
commit 89302b8deb
2 changed files with 2 additions and 10 deletions

View File

@ -6,6 +6,7 @@ readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"mcp[cli]>=1.10.1",
"fastmcp>=2.0.0,<3.0.0",
"openpyxl>=3.1.5",
"typer>=0.16.0"
]

View File

@ -66,16 +66,7 @@ logger = logging.getLogger("excel-mcp")
# Initialize FastMCP server
mcp = FastMCP(
"excel-mcp",
version="0.1.5",
description="Excel MCP Server for manipulating Excel files",
dependencies=["openpyxl>=3.1.5"],
env_vars={
"EXCEL_FILES_PATH": {
"description": "Path to Excel files directory",
"required": False,
"default": EXCEL_FILES_PATH
}
}
instructions="Excel MCP Server for manipulating Excel files"
)
def get_excel_path(filename: str) -> str: