Provides tools to automate Excel workbooks and worksheets via the MCP framework, enabling data access and manipulation from AI agents.
Configuration
View docs{
"mcpServers": {
"bassem-elsodany-mcp_excel_server": {
"url": "http://localhost:8800/sse",
"headers": {
"EXCEL_MCP_SERVER_TOOL_PREFIX": "EXCEL_MCP_"
}
}
}
}You can connect your AI workflows to Excel data and operations through a focused MCP server. This server exposes workbook, worksheet, and range tools so you can automate Excel tasks—from creating workbooks to reading, writing, and transforming data—via a standard, secure interface that your AI agents can call.
You interact with the MCP Excel Server by connecting an MCP client to the server and invoking the registered tools. Start the local server, then configure your AI agent to communicate with the server either through STDIO (local process) or SSE/HTTP transport. Use the tool names to perform actions such as creating workbooks, reading data, writing data, and manipulating worksheets and ranges. The server handles authentication and tool invocation so your AI can operate on your Excel files without manual file handling.
# Prerequisites
# Ensure you have Python installed (3.8+ is usually fine)
# Ensure you have access to install Python packages
# Step 1: Clone the project
# git clone <repository-url>
# cd mcp_excel_server
# Step 2: Create and activate a Python environment (optional but recommended)
python3 -m venv venv
source venv/bin/activate
# Step 3: Install dependencies
pip install -r requirements.txt
# Step 4: Start the MCP server (SSE transport)
# This runs the server in SSE mode on the local machine
PYTHONPATH=src python src/mcp_excel_server/__main__.py sseThe server registers a rich set of tools that your AI agent can call. Two common ways to connect are through an HTTP/SSE transport or a local STDIO transport. The server exposes tools with a consistent naming convention and can be configured to prefix tool names for clarity. If you want to customize how your agent discovers and calls tools, you configure the MCP server connection in your agent’s settings to point at the proper transport (SSE/HTTP or STDIO).
- STDIO connection (local integration): start the server in STDIO mode so your agent runs alongside the server process. The typical pattern is to launch the server with a command that opens a named STDIO channel for remote tool invocations. - SSE/HTTP connection: connect to the server over a local web server endpoint (for example, /sse) so agents on the same machine or over the network can issue tool calls via HTTP-like transport. Use your agent’s MCP configuration to point to the SSE URL.
Run the server in a controlled environment (LAN or private network) and avoid exposing the SSE/HTTP endpoint to the public internet without proper authentication and TLS. Keep your Excel files in a dedicated data directory with appropriate filesystem permissions. Use the tool prefix to clearly identify Excel tools in your agent configuration and monitor tool usage to prevent unintended data access.
MCP Inspector provides an interactive way to test and debug MCP servers. Use it to verify tool availability, parameter validation, and responses from the server during development and troubleshooting.
The server includes a comprehensive set of tools for workbook, worksheet, and range management, including creating, listing, reading, writing, renaming, copying, moving, merging, and filtering. If you need to extend capabilities, you can register additional tools following the standard registration pattern.
Create a new Excel workbook with a specified filename and initial sheet name.
List all Excel workbooks in the configured directory.
Read data from a specified worksheet within a workbook, with optional start and end cells and preview mode.
Write data to a worksheet starting at a given cell or append after the last row if not specified.
Retrieve metadata and basic information about a workbook.
Create a new worksheet in a workbook at a given index or at the end.
Delete a worksheet from a workbook.
Rename an existing worksheet within a workbook.
Copy an existing worksheet to a new one with a specified name.
Move a worksheet to a different position within the workbook.
Retrieve detailed information about a specific worksheet.
List all worksheets contained in a workbook.
Merge a specified range of cells within a worksheet.
Unmerge a previously merged range of cells.
Return rows where a given column matches a specific value.
Return rows where multiple specified columns match given values.
Delete a range of cells and shift remaining cells accordingly.
Copy a range of cells to a new location.
Move a range of cells to a new location.
Merge a range of cells.
Unmerge a previously merged range of cells.
Validate that a given cell range is within the workbook and correctly formatted.