MaximeSwagel/Excel-MCP
If you are the rightful owner of Excel-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Excel MCP Server is a FastMCP-compatible server designed to manage and manipulate Excel workbooks through a structured protocol.
Excel MCP Server
A FastMCP-compatible server that lets assistants inspect, edit, and provision Excel workbooks. The service exposes structured MCP tools backed by openpyxl, offers an optional FastAPI UI for file management, and is packaged to deploy on Fly.io with persistent storage.
Project Structure
MCPserver.pydefines the FastMCP server, tool registry, middleware, and startup/shutdown hooks that configure logging and the Excel workspace path.FASTAPIserver.pywraps the MCP server in FastAPI, serves the optionalwebapp/assets, and adds REST helpers for uploading, listing, downloading, and deleting spreadsheets.run_server.pycollects environment variables and boots the combined FastAPI/MCP stack withuvicorn.src/data.py,sheet.py,workbook.pyimplement the read/write operations that power the MCP tools.cell_utils.pyparses A1-style ranges so tools can resolve coordinates reliably.exceptions.pyandOutputclasses.pycentralise error types and structured responses returned to clients.
webapp/contains the Vite-built static UI. Whenwebapp/assetsexists, it is served alongside the MCP API.data/is the default writable directory for Excel files when running on Fly.io.fly.tomlconfigures the Fly.io app, HTTP service, and persistent volume mount.
Runtime Dependencies with uv
This project uses uv to manage Python environments declared in pyproject.toml:
anyiosupplies structured concurrency primitives used by FastAPI and FastMCP.fastapihosts the HTTP endpoints and bridges the MCP server to the web.fastmcpprovides the Model Context Protocol server runtime, tool decorator, and middleware hooks.mcp[cli]bundles the CLI tools that make it easy to test MCP calls locally.openpyxlreads and writes Excel workbooks referenced by the MCP tools.vitebuilds the optional web UI that ships at/when assets are present.
Install uv (one time) and sync dependencies:
curl -LsSf https://astral.sh/uv/install.sh | sh # follow official instructions for your platform
uv sync
uv sync resolves the lockfile, creates a virtual environment, and installs the packages above in one step.
Local Development
- Ensure uv is installed and run
uv sync. - Choose a directory for Excel files and export it:
export EXCEL_FILES_PATH=./excel_files mkdir -p "$EXCEL_FILES_PATH" - (Optional) select a log destination:
export LOG_FILE_PATH=./logs mkdir -p "$LOG_FILE_PATH" - Launch the server:
uv run python run_server.py - The FastAPI app listens on
0.0.0.0:8000. Open/to load the UI (if built) or connect an MCP client to/mcp. - Sanity-check the transport:
uv run mcp ping http://127.0.0.1:8000/mcp
Deploying to Fly.io
- Install the Fly.io CLI and authenticate:
fly auth login. - Create the app (once):
fly launch --no-deployto keep the generatedfly.toml. - Provision the persistent volume referenced in
fly.toml:fly volumes create myapp_data --size 1 - Deploy:
fly deploy - Verify the machine and logs:
fly statusandfly logs.
The Fly configuration exposes port 8000, mounts /app/data, and keeps one machine online so MCP clients can connect immediately. Adjust CPU, memory, or scaling in fly.toml to suit your workload.
Production Notes
- Restrict access to trusted clients or place the service behind an authenticated proxy; the toolset can mutate spreadsheets.
- Validate filenames supplied to upload/delete endpoints to avoid path traversal.
- Monitor
excel-mcp.logandexcel-mcp-error.log, rotating or exporting logs if required.