Excel MCP Server

0.1.8 · active · verified Mon Apr 13

Excel MCP Server is a Model Context Protocol (MCP) server that enables AI agents to manipulate Excel files without requiring Microsoft Excel to be installed. It allows for creating, reading, and modifying Excel workbooks, including advanced features like formulas, charts, and pivot tables. The current version is 0.1.8, and it maintains an active development pace with ongoing updates for features and protocol alignment.

Warnings

Install

Imports

Quickstart

The Excel MCP Server runs as a standalone process. This quickstart demonstrates setting up essential environment variables. An AI agent or MCP client then connects to this running server. The 'uvx' command is often used as a wrapper for launching the server, especially for different transports. For local interaction, 'stdio' transport is an option, where file paths can be provided per tool call.

import os

# These are example environment variables. For actual usage, they should be set in your shell
# or deployment environment before starting the server.
# For local stdio transport, EXCEL_FILES_PATH is often not required as paths are sent per tool call.
# For SSE/Streamable HTTP, EXCEL_FILES_PATH is crucial.
# OPENAI_API_KEY is an example if the server were to call an LLM provider.

os.environ['EXCEL_FILES_PATH'] = os.environ.get('EXCEL_FILES_PATH', './excel_files')
os.environ['FASTMCP_PORT'] = os.environ.get('FASTMCP_PORT', '8017')

# To start the server using the recommended Streamable HTTP transport:
# You would typically run this in a terminal or as part of a service.
# The server will listen on the specified port.
# Clients (e.g., AI agents) then connect to this endpoint.
# For demonstration, this code block only sets up environment variables. The server itself is a long-running process.

print(f"Excel MCP Server configured to use files in: {os.environ['EXCEL_FILES_PATH']}")
print(f"Excel MCP Server configured to listen on port: {os.environ['FASTMCP_PORT']} (if using HTTP transports)")
print("To start the server, run: uvx excel-mcp-server streamable-http  (or python -m excel_mcp_server for older versions)")

view raw JSON →