From 89302b8deb326c33b12b5772a91fc7553bdf0a12 Mon Sep 17 00:00:00 2001 From: Luke Memet <1598289+lukemmtt@users.noreply.github.com> Date: Fri, 1 Aug 2025 03:30:24 -0400 Subject: [PATCH] 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 --- pyproject.toml | 1 + src/excel_mcp/server.py | 11 +---------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3cb8d3c..280a148 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" ] diff --git a/src/excel_mcp/server.py b/src/excel_mcp/server.py index 902e802..8806f7e 100644 --- a/src/excel_mcp/server.py +++ b/src/excel_mcp/server.py @@ -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: