MCP Hub
Back to servers

xlsx-MCP

An MCP server for advanced Excel manipulation featuring a real-time formula evaluation engine. It enables LLMs to read, write, and calculate over 400 Excel functions within .xlsx files without requiring Microsoft Excel installed.

Tools
21
Updated
Jan 14, 2026

Excel MCP Server

A Model Context Protocol (MCP) server for Excel file manipulation with real-time formula calculation.

Why a Formula Engine?

Problem: Both humans and LLMs are inconsistent at math. When an AI writes =SUM(A1:A10) to a spreadsheet, it's just storing a string—the calculation never happens unless Microsoft Excel opens the file.

Solution: This MCP integrates HyperFormula, a headless spreadsheet engine that evaluates formulas in real-time. When you read a cell, you get the calculated result, not just the formula text.

write_cell(wb, "A1", 100)
write_cell(wb, "A2", 200)
write_cell(wb, "A3", "=SUM(A1:A2)")

read_cell(wb, "A3")
→ { calculatedValue: 300, formula: "=SUM(A1:A2)" }

This ensures mathematical accuracy for:

  • Financial calculations
  • Data aggregations
  • Report generation
  • Any workflow where precision matters

Features

  • No Excel Required - Works with .xlsx files using pure JavaScript
  • 400+ Excel Functions - SUM, AVERAGE, VLOOKUP, IF, and more via HyperFormula
  • Multi-Workbook - Open and manipulate multiple workbooks simultaneously

Tools (21 total)

Workbook Management

ToolDescription
create_workbookCreate new workbook in memory, returns ID
open_workbookOpen existing .xlsx file
save_workbookSave workbook to disk
close_workbookClose workbook and free memory
list_workbooksList all open workbooks

Sheet Operations

ToolDescription
list_sheetsList all sheets in workbook
create_sheetAdd new sheet
delete_sheetRemove sheet
rename_sheetRename sheet
get_sheet_infoGet dimensions and metadata

Cell Operations

ToolDescription
read_cellRead cell value (returns calculated result)
write_cellWrite value or formula (prefix with =)
read_rangeRead range of cells
write_rangeWrite 2D array to range
list_columnsList columns with headers

Formula Support

ToolDescription
get_formulaGet raw formula string from cell
recalculateForce recalculation of all formulas

Charts & Pivot Tables

ToolDescription
create_chartCreate bar, line, pie, or scatter chart
delete_chartRemove chart
create_pivot_tableCreate pivot table from data

Import

ToolDescription
import_markdown_tableImport markdown table to Excel

Installation

git clone https://github.com/jauinones/excel-mcp.git
cd excel-mcp
npm install
npm run build

Configuration

Add to your Claude Code MCP settings (~/.claude.json):

{
  "mcpServers": {
    "excel": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/excel-mcp/dist/index.js"]
    }
  }
}

Example Usage

// Create a simple invoice
create_workbook → "wb_1"

write_cell(wb_1, "Sheet1", "A1", "Item")
write_cell(wb_1, "Sheet1", "B1", "Price")
write_cell(wb_1, "Sheet1", "C1", "Qty")
write_cell(wb_1, "Sheet1", "D1", "Total")

write_range(wb_1, "Sheet1", "A2", [
  ["Widget", 25.00, 10, "=B2*C2"],
  ["Gadget", 15.50, 20, "=B3*C3"],
  ["Thing",  8.99,  50, "=B4*C4"]
])

write_cell(wb_1, "Sheet1", "D5", "=SUM(D2:D4)")

read_cell(wb_1, "Sheet1", "D5")
// → { calculatedValue: 1009.5, formula: "=SUM(D2:D4)" }

save_workbook(wb_1, "/path/to/invoice.xlsx")

Tech Stack

  • TypeScript - Type-safe implementation
  • ExcelJS - Read/write .xlsx files
  • HyperFormula - Formula calculation engine (GPLv3)
  • MCP SDK - Model Context Protocol integration

License

GPLv3 (due to HyperFormula dependency)

Reviews

No reviews yet

Sign in to write a review