$git clone https://github.com/haris-musa/excel-mcp-serverA 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.
| 1 | <p align="center"> |
| 2 | <img src="https://raw.githubusercontent.com/haris-musa/excel-mcp-server/main/assets/logo.png" alt="Excel MCP Server Logo" width="300"/> |
| 3 | </p> |
| 4 | |
| 5 | [](https://pypi.org/project/excel-mcp-server/) |
| 6 | [](https://pepy.tech/project/excel-mcp-server) |
| 7 | [](https://opensource.org/licenses/MIT) |
| 8 | [](https://smithery.ai/server/@haris-musa/excel-mcp-server) |
| 9 | [](https://cursor.com/install-mcp?name=excel-mcp-server&config=eyJjb21tYW5kIjoidXZ4IGV4Y2VsLW1jcC1zZXJ2ZXIgc3RkaW8ifQ%3D%3D) |
| 10 | |
| 11 | 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. |
| 12 | |
| 13 | ## Features |
| 14 | |
| 15 | - 📊 **Excel Operations**: Create, read, update workbooks and worksheets |
| 16 | - 📈 **Data Manipulation**: Formulas, formatting, charts, pivot tables, and Excel tables |
| 17 | - 🔍 **Data Validation**: Built-in validation for ranges, formulas, and data integrity |
| 18 | - 🎨 **Formatting**: Font styling, colors, borders, alignment, and conditional formatting |
| 19 | - 📋 **Table Operations**: Create and manage Excel tables with custom styling |
| 20 | - 📊 **Chart Creation**: Generate various chart types (line, bar, pie, scatter, etc.) |
| 21 | - 🔄 **Pivot Tables**: Create dynamic pivot tables for data analysis |
| 22 | - 🔧 **Sheet Management**: Copy, rename, delete worksheets with ease |
| 23 | - 🔌 **Triple transport support**: stdio, SSE (deprecated), and streamable HTTP |
| 24 | - 🌐 **Remote & Local**: Works both locally and as a remote service |
| 25 | |
| 26 | ## Usage |
| 27 | |
| 28 | The server supports three transport methods: |
| 29 | |
| 30 | ### 1. Stdio Transport (for local use) |
| 31 | |
| 32 | ```bash |
| 33 | uvx excel-mcp-server stdio |
| 34 | ``` |
| 35 | |
| 36 | ```json |
| 37 | { |
| 38 | "mcpServers": { |
| 39 | "excel": { |
| 40 | "command": "uvx", |
| 41 | "args": ["excel-mcp-server", "stdio"] |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | ``` |
| 46 | |
| 47 | ### 2. SSE Transport (Server-Sent Events - Deprecated) |
| 48 | |
| 49 | ```bash |
| 50 | uvx excel-mcp-server sse |
| 51 | ``` |
| 52 | |
| 53 | **SSE transport connection**: |
| 54 | ```json |
| 55 | { |
| 56 | "mcpServers": { |
| 57 | "excel": { |
| 58 | "url": "http://localhost:8000/sse", |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | ``` |
| 63 | |
| 64 | ### 3. Streamable HTTP Transport (Recommended for remote connections) |
| 65 | |
| 66 | ```bash |
| 67 | uvx excel-mcp-server streamable-http |
| 68 | ``` |
| 69 | |
| 70 | **Streamable HTTP transport connection**: |
| 71 | ```json |
| 72 | { |
| 73 | "mcpServers": { |
| 74 | "excel": { |
| 75 | "url": "http://localhost:8000/mcp", |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | ``` |
| 80 | |
| 81 | ## Environment Variables & File Path Handling |
| 82 | |
| 83 | ### SSE and Streamable HTTP Transports |
| 84 | |
| 85 | When running the server with the **SSE or Streamable HTTP protocols**, 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. |
| 86 | - If not set, it defaults to `./excel_files`. |
| 87 | - With these transports, tool `filepath` values must be **relative** to that directory (e.g. `reports/q1.xlsx`); absolute paths and directory traversal are rejected. |
| 88 | |
| 89 | You can also set the `FASTMCP_PORT` environment variable to control the port the server listens on (default is `8017` if not set). |
| 90 | - Example (Windows PowerShell): |
| 91 | ```powershell |
| 92 | $env:EXCEL_FILES_PATH="E:\MyExcelFiles" |
| 93 | $env:FASTMCP_PORT="8007" |
| 94 | uvx excel-mcp-server streamable-http |
| 95 | ``` |
| 96 | - Example (Linux/macOS): |
| 97 | ```bash |
| 98 | EXCEL_FILES_PATH=/path/to/excel_files FASTMCP_PORT=8007 uvx excel-mcp-server streamable-http |
| 99 | ``` |
| 100 | |
| 101 | ### Stdio Transport |
| 102 | |
| 103 | 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. |
| 104 | |
| 105 | ## Available Tools |
| 106 | |
| 107 | The server provides a comprehensive set of Excel manipulation tools. See [TOOLS.md](TOOLS.md) for complete documentation of all available tools. |
| 108 | |
| 109 | ## Star History |
| 110 | |
| 111 | [![Star History Chart](https://api |