xlsx-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@xlsx-mcp-server open sales.xlsx and add a SUM formula for column D in the total row"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
xlsx-mcp-server
A local MCP server for reading and editing Excel (.xlsx) files. Works with Claude Code, Cursor, and any MCP-compatible client.
37 tools for cell data, formatting, formulas, sheet management, row/column operations, data validation, named ranges, and cell merging — all running locally via stdio with no file uploads.
Features
Category | Tools |
Read |
|
Write |
|
Format |
|
Rows & columns |
|
Sheet ops |
|
View |
|
Validation |
|
Structure |
|
Bulk operations
The writing, formatting, and row/column tools have bulk variants (write_cells, write_rows, format_cells_bulk, set_column_widths, set_row_heights) that process multiple targets in a single file read/write cycle. Use these instead of calling the single-target versions in a loop.
Formula support
Write formulas by prefixing the value with =:
write_cell → value: "=SUM(A1:A10)"
write_cells → cells: [{cell: "B1", value: "=A1*2"}, {cell: "B2", value: "=VLOOKUP(...)"}]read_cell returns both the formula and the cached result.
Related MCP server: excel-mcp
Quick start
Option 1: Install from npm
npm install -g @knorq/xlsx-mcp-serverThen add to your MCP config (see Configuration below).
Option 2: Use npx (no install)
Just add the config — npx downloads and runs it automatically:
{
"mcpServers": {
"xlsx-editor": {
"command": "npx",
"args": ["-y", "@knorq/xlsx-mcp-server"]
}
}
}Option 3: Build from source
git clone https://github.com/knorq-ai/xlsx-mcp-server.git
cd xlsx-mcp-server
npm install
npm run build
npm link # makes `xlsx-mcp-server` available globallyConfiguration
Claude Code
Add to your project's .mcp.json (per-project) or ~/.claude/settings.json (global):
{
"mcpServers": {
"xlsx-editor": {
"command": "npx",
"args": ["-y", "@knorq/xlsx-mcp-server"]
}
}
}Cursor
Add to your MCP server configuration in Cursor settings:
{
"mcpServers": {
"xlsx-editor": {
"command": "npx",
"args": ["-y", "@knorq/xlsx-mcp-server"]
}
}
}Using a local build (without npm)
If you built from source and ran npm link:
{
"mcpServers": {
"xlsx-editor": {
"command": "xlsx-mcp-server"
}
}
}Or reference the built file directly:
{
"mcpServers": {
"xlsx-editor": {
"command": "node",
"args": ["/absolute/path/to/xlsx-mcp-server/dist/index.js"]
}
}
}Distributing to others
Via npm (recommended)
npm publishRecipients install with:
npm install -g @knorq/xlsx-mcp-serverOr skip the install entirely — just share the .mcp.json config with the npx setup above and it works out of the box.
Via zip / git
Share the repository. Recipients run:
git clone https://github.com/knorq-ai/xlsx-mcp-server.git
cd xlsx-mcp-server
npm install
npm run build
npm linkThen add the config above.
Tool reference
Reading
get_workbook_info — Sheet list, named range count, file properties.
file_pathread_sheet — Read cell data from a sheet with optional range.
file_path, sheet, range?read_cell — Single cell's value, formula, type, and formatting.
file_path, sheet, cellsearch_cells — Search for text or numbers across cells.
file_path, query, sheet?, case_sensitive?get_sheet_properties — Sheet state, dimensions, freeze panes, auto filter, tab color.
file_path, sheetlist_named_ranges — List all named ranges with names and references.
file_pathlist_data_validations — List data validation rules on a sheet.
file_path, sheetlist_images — List embedded images with names, extensions, and dimensions.
file_path, sheetCell writing
write_cell — Set a cell's value or formula. Prefix with = for formulas.
file_path, sheet, cell, valuewrite_cells — Set multiple cells at once.
file_path, sheet, cells (array of {cell, value})write_row — Write a row of values starting from a position.
file_path, sheet, row, values, start_column?write_rows — Write multiple rows of data at once.
file_path, sheet, start_row, rows (2D array), start_column?clear_cells — Clear values in a range (keeps formatting).
file_path, sheet, rangecreate_workbook — Create a new empty .xlsx workbook.
file_path, sheet_name?Formatting
format_cells — Apply formatting to a cell range: font (bold, italic, underline, strikethrough, name, size, color), fill (color, pattern), borders (style, color, sides), alignment (horizontal, vertical, wrap, rotation), number format.
file_path, sheet, range, formatformat_cells_bulk — Apply different formatting to multiple ranges at once. Single file read/write cycle.
file_path, sheet, groups (array of {range, format})Rows and columns
set_column_width — Set the width of a column (in characters).
file_path, sheet, column, widthset_column_widths — Set widths for multiple columns at once.
file_path, sheet, columns (array of {column, width})set_row_height — Set the height of a row (in points).
file_path, sheet, row, heightset_row_heights — Set heights for multiple rows at once.
file_path, sheet, rows (array of {row, height})insert_rows — Insert empty rows at a position.
file_path, sheet, row, countdelete_rows — Delete rows at a position.
file_path, sheet, row, countinsert_columns — Insert empty columns at a position.
file_path, sheet, column, countdelete_columns — Delete columns at a position.
file_path, sheet, column, countSheet operations
add_sheet — Add a new empty sheet.
file_path, namerename_sheet — Rename an existing sheet.
file_path, sheet, new_namedelete_sheet — Delete a sheet from the workbook.
file_path, sheetcopy_sheet — Copy a sheet within the workbook.
file_path, source_sheet, new_nameView settings
set_freeze_panes — Freeze rows and/or columns. Pass 0 to unfreeze.
file_path, sheet, row, columnset_auto_filter — Enable auto filter on a range.
file_path, sheet, rangeremove_auto_filter — Remove auto filter from a sheet.
file_path, sheetData validation
add_data_validation — Add a validation rule (list, whole, decimal, date, textLength, custom) with operator, messages, and prompts.
file_path, sheet, range, type, formulae, operator?, allow_blank?, show_error_message?, error_title?, error?, show_input_message?, prompt_title?, prompt?remove_data_validation — Remove validation rules from a range.
file_path, sheet, rangeNamed ranges
add_named_range — Add a named range (workbook-scoped or sheet-scoped).
file_path, name, range, sheet?delete_named_range — Delete a named range.
file_path, nameCell merging
merge_cells — Merge a range of cells.
file_path, sheet, rangeunmerge_cells — Unmerge a previously merged range.
file_path, sheet, rangeKnown limitations
Not supported (use Python/openpyxl/xlwings instead)
Feature | Detail |
Formula recalculation | Cached results are read, but formulas are NOT recalculated when values change. Open the file in Excel to recalculate. |
Charts | Cannot read, create, or modify charts. Existing charts are preserved on save. |
Pivot tables | Cannot read or create pivot tables |
Conditional formatting | Cannot read or create conditional formatting rules |
VBA/macros | Macro-enabled workbooks (.xlsm) are not supported |
Formula ref auto-update | Inserting/deleting rows or columns does NOT shift cell references in existing formulas (e.g. |
Other limitations
copy_sheet is partial — Copies cell values, styles, column widths, row heights, and merged cells. Does not copy data validation, conditional formatting, or view settings
Range size limit — Write, format, and validation tools reject ranges exceeding 100,000 cells
File size limit — Files larger than 100 MB cannot be opened
Why MCP tools instead of raw Python?
AI agents can manipulate Excel via raw Python (openpyxl), but MCP tools are significantly more token-efficient:
Metric | MCP tools | Raw Python |
Output tokens per operation | 60–85% less | Baseline (agent must generate full code) |
Cost per operation | 50–80% less | Baseline |
Break-even | 2 operations | — |
Debug iterations | None (validated inputs) | ~1.5 retries/task on average |
The savings come primarily from eliminating code generation — output tokens cost 5× more than input tokens. MCP tool calls are small structured parameters (~30–50 tokens), while equivalent Python code requires ~80–200 output tokens per operation (imports, style objects, iteration, save).
Formatting operations see the largest savings (~75%) because openpyxl's styling API (PatternFill, Border, Side, Font) is particularly verbose. Simple cell read/write sees smaller but still meaningful savings (~60%).
See docs/token-efficiency-analysis.md for detailed scenario breakdowns.
Requirements
Node.js 18+
License
MIT
Available Tools
37 toolsadd_data_validationC
Add a data validation rule to a range (list, whole number, decimal, date, text length, custom).
Inputs: type (required), range (required), sheet (required), formulae (required), +9 more.
add_named_rangeC
Add a named range to the workbook.
Inputs: name (required), range (required), file_path (required), sheet.
add_sheetB
Add a new empty sheet to the workbook.
Inputs: name (required), file_path (required).
clear_cellsA
Clear cell values in a range (keeps formatting).
Inputs: range (required), sheet (required), file_path (required).
copy_sheetA
Copy a sheet within the workbook. Copies cell values, styles, column widths, row heights, and merged cells. Does not copy data validation, conditional formatting, or view settings.
Inputs: new_name (required), file_path (required), source_sheet (required).
create_workbookA
Create a new empty XLSX workbook. Fails if file already exists.
Inputs: file_path (required), sheet_name.
delete_columnsB
Delete columns at the specified position. Remaining columns shift left.
Inputs: count (required), sheet (required), column (required), file_path (required).
delete_named_rangeC
Delete a named range from the workbook.
Inputs: name (required), file_path (required).
delete_rowsB
Delete rows at the specified position. Remaining rows shift up.
Inputs: row (required), count (required), sheet (required), file_path (required).
delete_sheetC
Delete a sheet from the workbook.
Inputs: sheet (required), file_path (required).
format_cellsC
Apply formatting (font, fill, border, alignment, number format) to a cell range.
Inputs: range (required), sheet (required), format (required), file_path (required).
format_cells_bulkB
Apply different formatting to multiple ranges at once (bulk). One file I/O operation.
Inputs: sheet (required), groups (required), file_path (required).
get_sheet_propertiesB
Get sheet properties including freeze panes, auto filter, and tab color.
Inputs: sheet (required), file_path (required).
get_workbook_infoA
Get metadata and structure overview of an XLSX file — sheet list, named range count, and file properties.
Inputs: file_path (required).
insert_columnsB
Insert empty columns at the specified position. Existing columns shift right.
Inputs: count (required), sheet (required), column (required), file_path (required).
insert_rowsA
Insert empty rows at the specified position. Existing rows shift down.
Inputs: row (required), count (required), sheet (required), file_path (required).
list_data_validationsC
List data validation rules on a sheet.
Inputs: sheet (required), file_path (required).
list_imagesC
List images embedded in a sheet.
Inputs: sheet (required), file_path (required).
list_named_rangesB
List all named ranges in the workbook.
Inputs: file_path (required).
merge_cellsC
Merge a range of cells.
Inputs: range (required), sheet (required), file_path (required).
read_cellA
Read a single cell's value, formula, type, and formatting.
Inputs: cell (required), sheet (required), file_path (required).
read_sheetA
Read cell data from a sheet (values, formulas, types). Optionally specify a range like 'A1:C10'. Use compact=true to omit empty cells and merged-cell children for token-efficient output.
Inputs: sheet (required), file_path (required), range, compact.
remove_auto_filterC
Remove auto filter from a sheet.
Inputs: sheet (required), file_path (required).
remove_data_validationC
Remove data validation rules from a range.
Inputs: range (required), sheet (required), file_path (required).
rename_sheetC
Rename an existing sheet.
Inputs: sheet (required), new_name (required), file_path (required).
search_cellsB
Search for text or numbers in cells. Searches all sheets by default, or specify a sheet.
Inputs: query (required), file_path (required), sheet, case_sensitive.
set_auto_filterC
Enable auto filter on a range.
Inputs: range (required), sheet (required), file_path (required).
set_column_widthB
Set the width of a single column.
Inputs: sheet (required), width (required), column (required), file_path (required).
set_column_widthsB
Set widths for multiple columns at once (bulk).
Inputs: sheet (required), columns (required), file_path (required).
set_freeze_panesB
Freeze rows and/or columns. Set both to 0 to unfreeze.
Inputs: row (required), sheet (required), column (required), file_path (required).
set_row_heightC
Set the height of a single row.
Inputs: row (required), sheet (required), height (required), file_path (required).
set_row_heightsB
Set heights for multiple rows at once (bulk).
Inputs: rows (required), sheet (required), file_path (required).
unmerge_cellsB
Unmerge a previously merged range of cells.
Inputs: range (required), sheet (required), file_path (required).
write_cellB
Set a single cell's value or formula. Start value with '=' for formulas (e.g. '=SUM(A1:A10)').
Inputs: cell (required), sheet (required), value (required), file_path (required).
write_cellsB
Set multiple cells at once (bulk). Each entry specifies a cell address and value.
Inputs: cells (required), sheet (required), file_path (required).
write_rowC
Write a row of values starting from a given row number and optional start column.
Inputs: row (required), sheet (required), values (required), file_path (required), +1 more.
write_rowsB
Write multiple rows of data at once (bulk). Ideal for inserting tabular data.
Inputs: rows (required), sheet (required), file_path (required), start_row (required), +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 37 tools
Most tools target a distinct resource+action, and the singular/plural pairs (write_cell vs write_cells, set_column_width vs set_column_widths, format_cells vs format_cells_bulk) are explicitly described as single vs bulk, so an agent can pick correctly. A few read-side tools (read_sheet, read_cell, search_cells, get_workbook_info, get_sheet_properties) sit close together but their scopes are stated clearly enough.
Every tool is snake_case with a leading verb (add_/delete_/set_/get_/list_/read_/write_/format_/insert_/merge_), and the verb choice is semantically consistent across the set. The singular/plural suffixing convention is applied uniformly for bulk variants.
37 tools is well above the practical ceiling for a single MCP server, and the bulk variants double the surface for many operations. The domain is broad enough to justify many tools, but this many choices raises selection cost and context load.
Coverage is strong: workbook/sheet lifecycle, cell read/write/clear, row/column insertion and deletion, formatting, widths/heights, named ranges, data validation, merges, images, and freeze panes. Gaps exist around conditional formatting (notably absent even though copy_sheet mentions it), charts, and hyperlinks/comments.
Maintenance
Related MCP Connectors
The Excel engine for AI agents: read, check and edit Excel models over MCP.
Excel analytics: inspect, query (JSON rows), charts, and JSON-to-xlsx workbook writing.
Read, filter, group and write XLSX, CSV, TSV and JSON data, and convert between the formats.
Convert Apple Numbers (.numbers) to Excel (.xlsx) in the browser — first sheet free. MCP v1.1.0 (Streamable HTTP) exposes four tools: open_numbers2excel (open site / Stripe checkout intents; conversion is browser-local), get_site_info (product overview, pricing, URLs; read-only), get_pro_status (Stripe subscription_id sub_… status), get_unlock_from_session (Checkout session_id cs_… → entitlement). Path A: MCP does not accept or upload files.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for reading and writing Excel (xlsx) files using SheetJS, providing tools to list sheets, read data, create files, add sheets, and update cells.513 npmMIT
- AlicenseAqualityDmaintenanceEnables reading and writing Excel workbooks (.xlsx) through MCP. Supports listing sheets, tables, pivot tables, reading cell data, exporting to CSV/text/Markdown, and creating/modifying Excel files.14GPL 3.0
- FlicenseNot gradedqualityDmaintenanceProvides full read and write access to Excel workbooks (sheets, cell ranges, tables, formulas, formatting, and cross-workbook references) via MCP, running locally or as an HTTP/SSE service.-
- AlicenseAqualityBmaintenanceMCP server for accurately reading and writing Excel .xlsx files while preserving structure, styles, and formulas. Provides tools for inspecting, editing, and aggregating spreadsheet data, with optional LibreOffice recalculation.35137 PyPI4MIT