Skip to main content

Excel MCP Server

High-performance Model Context Protocol (MCP) server for programmatic Excel (.xlsx) spreadsheet generation and manipulation

PyPI Version Python Version uv CodeQL Security Policy Rules for AI License MCP Compatible

Excel MCP Server (excel-mcp, PyPI: luiccian-excel-mcp) is a high-performance Python server implementing the Model Context Protocol (MCP) to provide advanced, token-optimized Excel spreadsheet (.xlsx) creation, batch synthesis, formula automation, and inspection capabilities for AI assistants (Claude, Cursor, Copilot, Cline).

Designed from the ground up for maximum token efficiency, it replaces chatty micro-iterations with single-pass workbook construction—saving over 90% of model tokens and conversational turns.


Key Architectural Highlights

  • Single-Pass Workbook Builder: Create complete, multi-sheet, publication-ready workbooks (title banners, table headers, alternating row colors, accounting borders, auto-calculated totals, currency formatting, and native charts) in one single MCP call (excel_build_workbook).
  • Visual Design Presets: Built-in typography and visual standards (corporate, financial, modern, compact).
  • Lightweight Outline Inspection: Extract sheet names, populated dimensions (A1:H50), column headers, and formula summaries without dumping massive cell grids (excel_get_workbook_outline), saving thousands of context tokens.
  • Batch Data Ingestion: Append or overwrite 2D matrices of values into existing sheets in a single atomic operation (excel_batch_write_data).
  • Formula & Analytics Engine: Apply validated formulas (SUM, AVERAGE, VLOOKUP), generate native bar/line/pie charts, and build analytical pivot tables.
  • Zero-Install Execution: Instant launch with uvx luiccian-excel-mcp.

No manual clone or virtual environment management required. You can run the server directly using uv:

# Run with stdio transport (default for AI IDEs)
uvx luiccian-excel-mcp

MCP Client Configuration

1. Claude Desktop

Add this configuration to your claude_desktop_config.json:

{
  "mcpServers": {
    "excel-mcp": {
      "command": "uvx",
      "args": ["luiccian-excel-mcp"],
      "env": {
        "MCP_ALLOWED_DIRECTORIES": "/path/to/your/spreadsheets"
      }
    }
  }
}

2. Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "excel-mcp": {
      "command": "uvx",
      "args": ["luiccian-excel-mcp"],
      "env": {
        "MCP_ALLOWED_DIRECTORIES": "${workspaceFolder}"
      }
    }
  }
}

Visual Design Presets

Preset Header Fill Header Text Zebra Row Fill Typography Borders / Totals Best For
corporate (Default) Navy Blue (#1F4E79) White Ice Blue (#EDF2F8) Calibri 11pt Thin gray, soft blue total Business proposals, management reports, executive summaries
financial Forest Green (#1E4620) White Pale Mint (#F0F6F1) Calibri 11pt, currency format Double bottom line on totals Balance sheets, P&L statements, budgeting, cash flow
modern Slate / Charcoal (#2F3542) White Cool Gray (#F8F9FA) Segoe UI 10.5pt Minimalist soft borders SaaS metrics, tech product analytics, modern dashboards
compact Steel Gray (#4A6572) White Off-White (#F5F5F5) Arial 9.5pt Dense grid, high data density Inventory lists, master catalogs, high-volume exports

Modular Agent Skills

The repository includes pre-built agent skills under skills/:

  • excel-tools-reference: Authoritative encyclopedia and decision matrix covering all 33 canonical tools, types, signatures, and safety rules.
  • excel-spreadsheet-creator: Direct single-pass synthesis for reports, budgets, and financial statements (excel_build_workbook).
  • excel-spreadsheet-editor: Lightweight structural inspection, atomic batch matrix writes, row appending, table formatting, and in-place sorting.
  • excel-spreadsheet-analyzer: Context-efficient sampling, statistical column profiling (excel_profile_sheet), and cell discovery (excel_find_cells).

Tool Taxonomy

All tools use the standard excel_* canonical prefix. Legacy unprefixed aliases can optionally be enabled via EXCEL_MCP_LEGACY_ALIASES=1. For complete signatures and parameter schemas, see docs/TOOLS.md.

Category Canonical Tool Name Type Description
Batch & Single-Pass excel_build_workbook Write Build full multi-sheet workbooks with styles, formulas, and charts in 1 call
excel_get_workbook_outline Read-Only Lightweight outline inspection without loading entire cell matrices
excel_batch_write_data Write Write 2D matrix of values or formulas into a sheet range atomically
excel_append_rows Write Append batch rows below existing data automatically detecting last row
Search & Profiling excel_profile_sheet Read-Only Column data types, null counts, min/max, and distinct samples
excel_find_cells Read-Only Search cells by text, exact match, or regex without full grid dump
Formatting & Tables excel_create_table Write Convert cell range into native Excel Table with filter drop-downs
excel_format_sheet Write Configure freeze panes, autofilter, gridlines, and custom column widths
excel_sort_range Write Sort 2D cell range in-place by key column with header preservation
excel_format_range Write Apply fonts, fills, borders, alignments, and number formats
excel_merge_cells Write Merge rectangular cell range
excel_unmerge_cells Write Unmerge cell range
excel_copy_range Write Copy cells, formats, and formulas across ranges
excel_delete_range Destructive Delete range of cells with optional cell shifting
excel_validate_range Read-Only Validate range coordinate syntax
Worksheet Management excel_create_workbook Write Create a new Excel workbook file
excel_create_worksheet Write Add a new worksheet to a workbook
excel_copy_worksheet Write Duplicate a worksheet within a workbook
excel_delete_worksheet Destructive Permanently delete a worksheet
excel_rename_worksheet Write Rename an existing worksheet
excel_insert_rows_columns Write Insert empty rows or columns at 1-based index
excel_delete_rows_columns Destructive Delete rows or columns starting at 1-based index
excel_list_documents Read-Only List available Excel files in allowed directories
excel_get_workbook_metadata Read-Only Retrieve sheet names, dimensions, and named ranges
Formulas & Analytics excel_validate_formula_syntax Read-Only Validate formula syntax before applying
excel_apply_formula Write Apply calculation formulas to specific cells
excel_create_chart Write Generate native bar, line, or pie charts from data
excel_create_pivot_table Write Create analytical pivot tables from ranges
Content I/O excel_read_data Read-Only Read tabular data from worksheet range
excel_write_data Write Write data starting at target cell
Validation & Print Layout excel_add_data_validation Write Add list, numeric, date, or custom validation rules to a cell range
excel_protect_sheet Write Protect or unprotect a worksheet with action-level permissions
excel_configure_page_setup Write Configure print orientation, scaling, area, headers, footers, and centering

Security

  • Restricted Directories: Access is strictly limited to paths listed in MCP_ALLOWED_DIRECTORIES (or DIRECTORY).
  • Formula Sanitization: Formula inputs are validated to avoid dangerous injection patterns.
  • Trusted Publishing: Automated PyPI releases use GitHub Actions OIDC and PEP 740 artifact attestation.

Development

# Clone the repository
git clone https://github.com/LuiccianDev/excel-mcp.git
cd excel-mcp

# Install dependencies with Astral uv
uv sync --all-groups

# Run linting and formatting
uv run ruff check .
uv run ruff format --check .

# Run static type checking
uv run mypy src

# Run test suite with coverage gate (80% minimum)
uv run pytest --cov --cov-report=term-missing

# Build the wheel and source distribution
uv run python -m build

Performance Baseline

The repository keeps deterministic workbook-operation benchmarks in tests/benchmarks/test_workbook_benchmarks.py. The initial local baseline is recorded in docs/benchmarks/workbook-baseline.json. Run the benchmark tests before changing batch writes, workbook construction, or format-and-save behavior; do not accept an optimization without comparing the functional result, runtime, and peak memory.


License

This project is licensed under the Apache License 2.0.

Metadata

Release files for luiccian-excel-mcp 2.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for luiccian-excel-mcp 2.1.4
File Size Uploaded Provenance Actions
luiccian_excel_mcp-2.1.4.tar.gz 70.6 kB With provenance Details for luiccian_excel_mcp-2.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for luiccian-excel-mcp 2.1.4
File Interpreter ABI Platform Actions
luiccian_excel_mcp-2.1.4-py3-none-any.whl Python 3 none any Details for luiccian_excel_mcp-2.1.4-py3-none-any.whl

Total release size: 164.5 kB

Release files / luiccian_excel_mcp-2.1.4.tar.gz

Download URL luiccian_excel_mcp-2.1.4.tar.gz
Size 70.6 kB
Tags Source
SHA-256 checksum
How to use checksums
926435c370372deadf3b73ae3da54dc04953030dc206a10c87f03636d7367f8e
BLAKE2b-256 checksum
How to use checksums
baceaaebe2db30235239da61afe40d5a81509bf06abc1167febff693d4de9885
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / luiccian_excel_mcp-2.1.4-py3-none-any.whl

Download URL luiccian_excel_mcp-2.1.4-py3-none-any.whl
Size 93.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65dc81500ed87c37a906125943c8472209cd39d5134e9d533046c9c2f590b36b
BLAKE2b-256 checksum
How to use checksums
df97334c344b7f4d962f7b4a8d1f5b4a6074ec0b860d0061e6ec8cd2cc0ab6d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for luiccian-excel-mcp 2.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for luiccian_excel_mcp-2.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page