home / mcp / excel mcp server

Excel MCP Server

Provides tools to automate Excel workbooks and worksheets via the MCP framework, enabling data access and manipulation from AI agents.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

# 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 sse

Configuration for clients and usage notes

The 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).

MCP client connection methods

- 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.

Security and best practices

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

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.

Notes

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.

Available tools

create_workbook

Create a new Excel workbook with a specified filename and initial sheet name.

list_workbooks

List all Excel workbooks in the configured directory.

read_workbook_data

Read data from a specified worksheet within a workbook, with optional start and end cells and preview mode.

write_workbook_data

Write data to a worksheet starting at a given cell or append after the last row if not specified.

get_workbook_info

Retrieve metadata and basic information about a workbook.

create_worksheet

Create a new worksheet in a workbook at a given index or at the end.

delete_worksheet

Delete a worksheet from a workbook.

rename_worksheet

Rename an existing worksheet within a workbook.

copy_worksheet

Copy an existing worksheet to a new one with a specified name.

move_worksheet

Move a worksheet to a different position within the workbook.

get_worksheet

Retrieve detailed information about a specific worksheet.

list_worksheets

List all worksheets contained in a workbook.

merge_cells

Merge a specified range of cells within a worksheet.

unmerge_cells

Unmerge a previously merged range of cells.

filter_rows_by_column

Return rows where a given column matches a specific value.

filter_rows_by_columns

Return rows where multiple specified columns match given values.

delete_range

Delete a range of cells and shift remaining cells accordingly.

copy_range

Copy a range of cells to a new location.

move_range

Move a range of cells to a new location.

merge_range

Merge a range of cells.

unmerge_range

Unmerge a previously merged range of cells.

validate_range

Validate that a given cell range is within the workbook and correctly formatted.