MCP ExplorerExplorer

Excel

@haris-musaon 11 days ago
970Β MIT
FreeCommunity
Productivity
#Excel Manipulation#Python
Excel manipulation including data reading/writing, worksheet management, formatting, charts, and pivot table.

Overview

What is Excel

Excel MCP Server is a Model Context Protocol server that allows interactions with Excel files without requiring Microsoft Excel. It enables users to create, read, modify, and manage Excel workbooks seamlessly using an AI agent.

Use cases

Ideal for developers and data analysts who need to automate Excel file manipulation within their applications or workflows. It can be integrated with AI tools to enhance productivity, allowing for tasks like data analysis, reporting, and visualization without manual Excel intervention.

How to use

To use the server, install it via Python’s package manager. Choose between two transport modes: stdio for local file manipulation or SSE for remote file management. Configure the transport method in your client and set any necessary environment variables for file paths and ports before starting the server.

Key features

The server offers functionalities to create and modify workbooks, read/write data, apply formatting, generate charts, create pivot tables, and manage worksheets and ranges. It supports two transport methods, stdio for local use and SSE for remote connections.

Where to use

Best used in environments requiring Excel file handling, such as data analytics platforms, automated reporting systems, or AI-assisted applications that leverage Excel files for data processing and visualization.

Content

Excel MCP Server Logo

PyPI version
PyPI downloads
License: MIT

A Model Context Protocol (MCP) server that lets you manipulate Excel files without needing Microsoft Excel installed. Create, read, and modify Excel workbooks with your AI agent.

Features

  • πŸ“Š Create and modify Excel workbooks
  • πŸ“ Read and write data
  • 🎨 Apply formatting and styles
  • πŸ“ˆ Create charts and visualizations
  • πŸ“Š Generate pivot tables
  • πŸ”„ Manage worksheets and ranges
  • πŸ”Œ Dual transport support: stdio and SSE

Quick Start

Prerequisites

  • Python 3.10 or higher

Running the Server

The server supports two transport modes: stdio and SSE.

Using stdio transport

Stdio transport is ideal for direct integration with tools like Cursor Desktop or local development, which can manipulate local files:

uvx excel-mcp-server stdio

Using SSE transport

SSE transport is perfect for remote connections, which manipulate remote files:

uvx excel-mcp-server sse

Add to Cursor

Install MCP Server

Using with AI Tools

  1. Add this configuration to your client, choosing the appropriate transport method for your needs:

Stdio transport connection (for local integration):

{
  "mcpServers": {
    "excel-stdio": {
      "command": "uvx",
      "args": [
        "excel-mcp-server",
        "stdio"
      ]
    }
  }
}

SSE transport connection:

  1. The Excel tools will be available through your AI assistant.

Environment Variables & File Path Handling

SSE Transport

When running the server with the SSE protocol, you must set the EXCEL_FILES_PATH environment variable on the server side. This variable tells the server where to read and write Excel files.

  • If not set, it defaults to ./excel_files.

You can also set the FASTMCP_PORT environment variable to control the port the server listens on (default is 8000 if not set).

  • Example (Windows PowerShell):
    $env:EXCEL_FILES_PATH="E:\MyExcelFiles"
    $env:FASTMCP_PORT="8080"
    uvx excel-mcp-server sse
    
  • Example (Linux/macOS):
    EXCEL_FILES_PATH=/path/to/excel_files FASTMCP_PORT=8080 uvx excel-mcp-server sse
    

Stdio Transport

When using the stdio protocol, the file path is provided with each tool call, so you do not need to set EXCEL_FILES_PATH on the server. The server will use the path sent by the client for each operation.

Available Tools

The server provides a comprehensive set of Excel manipulation tools. See TOOLS.md for complete documentation of all available tools.

Star History

Star History Chart

License

MIT License - see LICENSE for details.

Tools

create_workbook
Creates a new Excel workbook.
create_worksheet
Creates a new worksheet in an existing workbook.
get_workbook_metadata
Get metadata about workbook including sheets and ranges.
write_data_to_excel
Write data to Excel worksheet.
read_data_from_excel
Read data from Excel worksheet.
format_range
Apply formatting to a range of cells.
merge_cells
Merge a range of cells.
unmerge_cells
Unmerge a previously merged range of cells.
apply_formula
Apply Excel formula to cell.
validate_formula_syntax
Validate Excel formula syntax without applying it.
create_chart
Create chart in worksheet.
create_pivot_table
Create pivot table in worksheet.
copy_worksheet
Copy worksheet within workbook.
delete_worksheet
Delete worksheet from workbook.
rename_worksheet
Rename worksheet in workbook.
copy_range
Copy a range of cells to another location.
delete_range
Delete a range of cells and shift remaining cells.
validate_excel_range
Validate if a range exists and is properly formatted.

Comments