EX

Excel MCP Server for AI Workbook Automation

Automate Excel workbook tasks with an MCP server and create, read, and modify Excel files without Microsoft Excel using your AI agent.

Quick Install
npx -y @haris-musa/excel-mcp-server

Overview

Excel MCP Server is a Model Context Protocol (MCP) server that exposes Excel workbook operations as callable tools so AI agents can create, read, and modify Excel files without Microsoft Excel installed. It runs as a local or remote service and supports multiple transport layers so agents can use whichever IPC or HTTP streaming method fits their deployment.

This server is useful when you want to automate workbook tasks from an LLM-based agent: populate templates, run formula updates, generate charts or pivot tables, validate ranges, and persist results back to disk — all via tool calls. Because the service manipulates file objects directly (OpenXML / Python Excel libraries), you avoid installing or licensing Excel on the host.

Features

  • Create, read and update workbooks and worksheets
  • Add and evaluate formulas and named ranges
  • Styling and formatting: fonts, colors, borders, alignment, conditional formatting
  • Table operations: create/manage Excel tables with custom styles
  • Chart generation: line, bar, pie, scatter and more
  • Pivot table creation and basic pivot manipulations
  • Data validation and integrity checks for ranges and formulas
  • Sheet management: copy, rename, delete worksheets
  • Triple transport support: stdio, SSE (deprecated), streamable HTTP (recommended)
  • Works locally (stdio) or as a remote service (streamable HTTP / SSE)
  • Configurable files directory for remote transports

Installation / Configuration

Install from PyPI:

pip install excel-mcp-server

Run the server with one of the supported transports. Replace uvx with your MCP runner if different.

Stdio (local use):

uvx excel-mcp-server stdio

Streamable HTTP (recommended for remote/agent use):

uvx excel-mcp-server streamable-http

SSE (deprecated — not recommended):

uvx excel-mcp-server sse

Client MCP configuration examples:

Stdio transport (local):

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

Streamable HTTP transport (remote):

{
  "mcpServers": {
    "excel": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

Environment variables (server-side) for SSE / Streamable HTTP:

  • EXCEL_FILES_PATH — directory where Excel files are read/written (defaults to ./excel_files)
  • FASTMCP_PORT — port the server listens on (default: 8017)

Windows PowerShell:

$env:EXCEL_FILES_PATH="E:\MyExcelFiles"
$env:FASTMCP_PORT="8007"
uvx excel-mcp-server streamable-http

Linux / macOS:

EXCEL_FILES_PATH=/path/to/excel_files FASTMCP_PORT=8007 uvx excel-mcp-server streamable-http

Transport comparison:

TransportWhen to useNotes
stdioLocal, single-process agentFile path provided per call — no EXCEL_FILES_PATH required
streamable-httpRemote agents, recommendedRequires EXCEL_FILES_PATH on server for file persistence
SSE (deprecated)Legacy remote setupsDeprecated; prefer streamable HTTP

Available Tools / Resources

The server exposes a collection of tool endpoints that represent Excel operations (create workbook, read range, write range, add chart, create pivot, apply formatting, etc.). Full method names, arguments, and response schemas are documented in the repository’s TOOLS.md.

Resources:

  • Repository: https://github.com/haris-musa/excel-mcp-server
  • PyPI package: excel-mcp-server
  • TOOLS.md in the repo — authoritative list of all available tool calls and parameters

Use Cases

  • Template-driven reporting: An LLM fills data into a company report template, the MCP server writes tables, applies formatting, and generates charts before saving a final XLSX file to a shared folder.
  • Data transformation pipeline: An agent ingests CSV data, uses Excel tools to normalize, apply formulas, create pivot summaries, and export an analysis workbook.
  • Automated reconciliation: Periodic tool-calls compare multiple sheets or files, flag inconsistencies, and write a reconciliation worksheet with comments and highlights.
  • Chart and dashboard generation: From raw metrics, an agent can create charts and preformatted dashboards in an Excel workbook for non-technical stakeholders.
  • No-Excel server-side processing: CI/CD jobs or cloud agents that need to manipulate Excel files without installing Microsoft Excel can run this server and operate on files programmatically.

Getting started (quick example)

  1. Start the server (streamable HTTP example):
EXCEL_FILES_PATH=./excel_files uvx excel-mcp-server streamable-http
  1. Point your MCP-capable agent to the streamable endpoint:
{
  "mcpServers": {
    "excel": { "url": "http://localhost:8017/mcp" }
  }
}
  1. From the agent, call a tool like create_workbook or write_range (see TOOLS.md for exact tool names and payloads). For stdio usage, include a target file path in each call so the server knows where to persist the workbook.

Notes and best practices

  • Use streamable HTTP for remote deployments; it’s the recommended transport for stability and performance.
  • Ensure EXCEL_FILES_PATH is writable by the server process for remote transports.
  • Validate and sanitize file paths if the server is exposed to untrusted clients.
  • Refer to TOOLS.md for argument details and sample payloads to integrate with your LLM tool-calling workflow.

This MCP server bridges AI agents and Excel file automation in a server-native way, enabling production-ready workbook automation without depending on a desktop Excel installation.