xlsx-tools-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| XLSX_MCP_FILES | No | Comma-separated list of alias=absolute/path entries or bare absolute paths to preload workbooks at startup. Example: report=/data/report.xlsx,sales=/data/sales.xlsx | |
| XLSX_MCP_LOCK_TIMEOUT | No | Timeout in seconds for acquiring the per-file lock before failing. Defaults to 10. | 10 |
| XLSX_MCP_RECALC_TIMEOUT | No | Timeout in seconds for the LibreOffice recalculation pass. Defaults to 60. | 60 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Read and write Excel .xlsx/.xlsm workbooks. Writes keep every part of the file a tool does not touch.
Pick a read tool:
New workbook: list_sheets (names, sizes), then profile_sheet (column names, types, min/max).
Need rows: read_sheet with cell_range or max_rows. For large sheets use query_sheet (rows matching a filter) or aggregate_sheet (totals per group) instead of reading everything.
Find where a value is: search_workbook. One cell's formula, style or comment: get_cell. Hidden sheets, exact size, defined names: get_workbook_info.
Pick a write tool:
Set cells at known addresses (values or formulas): write_cells. Add records below the existing data: append_rows.
Make or remove space, shifting other cells: insert_rows, delete_rows, insert_columns, delete_columns. Empty cells but keep the layout: clear_range.
Write responses: {saved, recalculated, errors_found, message}, plus recalc_mode, rules, rolled_back and ripple when relevant. Check errors_found (formula cells showing #REF!, #DIV/0!, ...) before reporting success. rolled_back=true means a rule from set_rules failed and the file is unchanged. ripple lists other formula results the write changed. Read tools return formulas' last computed results; writes recompute them with LibreOffice unless recalculate=false.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_configured_filesA | List workbooks preloaded at startup (XLSX_MCP_FILES) as name -> absolute path. Call this first when unsure which file to use: any tool's |
| list_sheetsA | List every sheet with its approximate row and column count. Fast. For exact dimensions, hidden state and defined names use get_workbook_info. |
| get_workbook_infoA | Get workbook metadata: exact dimensions and visibility of each sheet, active sheet, defined names. Slower than list_sheets on large files. |
| read_sheetA | Return the raw cell values of a sheet or range. Formula cells give their last computed result. Best for small sheets or a known range. On large sheets, filter with query_sheet, summarize with aggregate_sheet, or inspect columns with profile_sheet instead. For a cell's formula text or style use get_cell. |
| get_cellA | Get everything about one cell: computed value, formula text, number format, font, fill, merge state, comment. |
| search_workbookA | Find the cells whose value contains some text. Returns {sheet, cell, value} per match. Use to locate data when you don't know its address; to filter table rows by conditions use query_sheet. |
| profile_sheetA | Summarize each column of a table-shaped sheet (first row = headers): type, empty count, min/max, sample values. Use first on an unfamiliar sheet to learn its column names before query_sheet or aggregate_sheet. Returns no cell data beyond the samples. |
| query_sheetA | Return only the rows of a table-shaped sheet (first row = headers) that match a condition. Returns {columns, records, row_count, limited}; row_count counts all matches. Use instead of read_sheet when you need a subset of a large table. For totals per group use aggregate_sheet. |
| aggregate_sheetA | Group rows and compute totals per group (e.g. sum of Amount by Region). Returns one record per group. Use for summaries of a table; to list individual matching rows use query_sheet. |
| create_workbookB | Create a new, empty workbook file. |
| write_cellsA | Set values or formulas in cells at given addresses, overwriting what is there. To add new records below existing data without computing addresses use append_rows; to make room between rows use insert_rows. |
| append_rowsA | Add rows below the last used row of a sheet. Never overwrites existing cells. To change existing cells use write_cells. |
| clear_rangeA | Empty the cells in a range (values and/or formatting). Rows and columns stay in place. To remove rows or columns and shift the rest, use delete_rows or delete_columns. |
| recalculate_workbookA | Recompute every formula with LibreOffice and report formula errors. Writes already do this. Needed only after writes with recalculate=false or after the file was edited outside this server. |
| restore_backupB | Replace a workbook with one of its .bak backups, atomically. |
| create_sheetA | Add a new empty sheet. To duplicate an existing sheet use copy_sheet. |
| copy_sheetA | Duplicate a sheet with its values, formulas and styles, inside the same workbook. |
| rename_sheetA | Rename a sheet. Formulas in other sheets that use the old name are NOT updated and will break. |
| delete_sheetA | Delete a sheet and everything on it. Refused when it is the only sheet. |
| insert_rowsB | Insert blank rows before start_row; rows below move down. |
| delete_rowsA | Delete rows starting at start_row; rows below move up. To empty cells without shifting use clear_range. |
| insert_columnsB | Insert blank columns before start_column; columns to the right move right. |
| delete_columnsA | Delete columns starting at start_column; columns to the right move left. To empty cells without shifting use clear_range. |
| merge_cellsB | Merge a rectangular range into one cell. Only the top-left value is kept. |
| unmerge_cellsC | Split a merged range back into separate cells. |
| set_cell_styleB | Apply font, fill, alignment, border or number format to every cell in a range. Values are not changed. |
| autofit_columnsA | Set each column's width to fit its longest value, within min_width..max_width. |
| create_tableA | Turn a range into a formatted Excel Table (ListObject) with optional filter buttons. |
| create_chartB | Add a native Excel chart built from ranges on the same sheet. |
| set_rulesA | Replace the workbook's rules and check them once; later value-changing writes are checked automatically. A write that makes a passing rule fail (or a failing one worse) is rolled back; rules already failing never block. Stored as ".rules.json". Each rule has an "id" plus one of: {"type": "cells_equal", "left": "S!B40", "right": "S!C40", "tolerance": 0.01} {"type": "cell_compare", "cell": "S!D4", "op": "<=", "value": 1000} (or "cell_ref") {"type": "column_check", "sheet": "Data", "expr": "Qty >= 0", "cell_range": "A1:F500"} {"type": "column_unique", "sheet": "Data", "column": "Invoice"} {"type": "not_empty", "range": "Data!A2:A500"} {"type": "no_new_errors"} |
| check_rulesA | Check the workbook's rules (from set_rules) against its current values without writing. |
| export_review_copyA | Write a copy for a human reviewer: cells changed since a baseline are highlighted with a Before/After comment. A |
| inspect_for_sharingA | Report hidden or sensitive content to review before sharing a workbook. Covers hidden sheets, rows and columns, comments, document properties, external links, pivot caches, invisible text, embedded objects, macros, custom XML and the change log. Each finding says whether sanitize_copy can remove it. |
| sanitize_copyA | Write a cleaned copy of the workbook for sharing (run inspect_for_sharing first). The source is not modified. |
| get_change_logA | Read the change log stored inside the workbook, newest first: time, tool, cell, before/after, reason. Entries exist only for writes made while XLSX_MCP_CHANGE_LOG=true. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 35 tools
Most tools target a distinct resource+action, and descriptions explicitly route between the overlapping read paths (read_sheet vs query_sheet vs aggregate_sheet vs profile_sheet vs search_workbook vs get_cell). The boundaries are learnable but require reading the prose: six tools return cell/row data in different shapes, and clear_range vs delete_rows/delete_columns, insert_rows vs append_rows need the pairwise hints to stay separate.
Every tool follows a consistent snake_case verb_noun pattern (list_sheets, create_workbook, delete_rows, set_cell_style, inspect_for_sharing). No camelCase or mixed verb styles anywhere, so tool names are predictable from the operation.
35 tools is above the comfortable range and includes pairs that could be consolidated (insert/delete rows and columns into one axis-parameterized tool, clear_range vs delete_rows). Each tool does earn a place in a genuinely broad domain, but the surface is heavy enough to burden tool selection.
Coverage is deep: read/search/profile/query/aggregate, full write lifecycle, structural edits, styling, tables, charts, validation rules, backups, change log, and sharing inspection/sanitization. Minor gaps remain, such as no defined-name management, no workbook copy/delete, no chart or pivot inspection, and no export to CSV/text.