Skip to main content

ironcalc-mcp

PyPI Python 3.13+ License: MIT Tests

MCP server for the IronCalc spreadsheet engine. Create, read, edit, and save xlsx files through the Model Context Protocol.

Built on the typed high-level API in IronCalc 0.8.3. It exposes workbook editing, formulas, styles, structure, names, conditional formatting, and xlsx persistence through MCP.

Motivation

I was really inspired by paper.design's real-time MCP workflow, where exposing a design tool via MCP enables custom, extensible agent workflows that feel native rather than bolted on.

Current AI-spreadsheet integrations (like Claude's cowork mode for Excel) add an unnecessary layer of abstraction - the agent writes Python code that manipulates Excel, instead of talking to the spreadsheet directly. This MCP server removes that indirection. Agents read cells, write formulas, and get evaluated results in one hop. No codegen middleman, no openpyxl glue scripts.

Huge thanks to the IronCalc contributors - their Python SDK API is so clean that this entire MCP server is basically thin wrappers. The hard work is all theirs.

Current limitation: the server works with an in-memory workbook - load a file, edit it, save it back. There's no real-time streaming to a running IronCalc UI yet. The engine already has a diff queue for syncing, so the plumbing is there. If IronCalc adds a WebSocket bridge to their web app, we can wire up live sync and get a true reactive workflow - agent edits appearing in the browser as they happen.

Quick start

uvx ironcalc-mcp

Claude Code

claude mcp add ironcalc -- uvx ironcalc-mcp

Claude Desktop / Cursor

Add to your MCP config:

{
  "mcpServers": {
    "ironcalc": {
      "command": "uvx",
      "args": ["ironcalc-mcp"]
    }
  }
}

Examples

Build a spreadsheet from scratch

Create a budget with formulas and save it

Audit an existing xlsx for errors

Load quarterly_report.xlsx and find all #NAME?, #REF!, #VALUE! errors. Tell me which formulas are broken and why.

Fix broken cross-sheet references

The P&L sheet was renamed but formulas in the DCF sheet still reference the old name. Find and fix all broken references.

Build a financial model

Create a 5-year DCF model with revenue assumptions in one sheet, P&L in another, and free cash flow calculation in a third. Use =NPV() and =IRR() for valuation.

Analyze and transform data

Load sales_data.xlsx, add a column with running totals, insert a summary row at the bottom, and save.

Available tools (56)

Workbook

Tool Description
create_workbook Create an empty workbook with locale, timezone, and formula language
load_workbook Load an xlsx file
save_workbook Save to xlsx
get_workbook_info Get metadata, theme, sheets, dimensions, states, and colors
set_workbook_properties Update name, locale, timezone, language, or theme
undo Undo the latest action
redo Redo the latest undone action

Cells and ranges

Tool Description
get_cell Get content, formatted value, and type
get_cells Read non-empty cells from an inclusive range
set_cell Set a value or formula
set_cells Batch-write cells with one evaluation pass
set_array_formula Set an array formula over a result area
clear_range Clear contents, formatting, or everything
paste_csv Paste tab-delimited rows into a range

Sheets

Tool Description
add_sheet Create a sheet
delete_sheet Delete a sheet
rename_sheet Rename a sheet
set_sheet_color Set the tab color
duplicate_sheet Duplicate a sheet
hide_sheet / unhide_sheet Change sheet visibility
move_sheet Reorder a sheet
set_grid_lines Show or hide grid lines

Rows and columns

Tool Description
insert_rows / delete_rows Insert or delete rows
insert_columns / delete_columns Insert or delete columns
move_rows / move_columns Move a contiguous row or column block
set_column_width Size one column or an inclusive range
set_row_height Size one row or an inclusive range
set_rows_hidden / set_columns_hidden Hide or unhide inclusive ranges
set_frozen_rows / set_frozen_columns Set frozen panes
auto_fill_rows / auto_fill_columns Extend values and formulas from a source area

Formatting

Tool Description
get_cell_style Get font, fill, border, alignment, and number format
set_cell_style Update selected style properties on a cell or range
set_range_border Apply inner, outer, side, or full borders

Named styles and conditional formatting

Tool Description
list_named_styles / get_named_style Inspect named styles
create_named_style / update_named_style / delete_named_style Manage named styles
apply_named_style Apply a named style to a range
list_conditional_formats List conditional formatting rules
add_conditional_format / update_conditional_format / delete_conditional_format Manage rules
raise_conditional_format_priority / lower_conditional_format_priority Reorder rules

Defined names

Tool Description
list_defined_names List workbook- and sheet-scoped names
create_defined_name Create a defined name
update_defined_name Rename, re-scope, or update a defined name
delete_defined_name Delete a defined name

Contributing

Prerequisites: uv and just.

git clone https://github.com/yolonir/ironcalc-mcp
cd ironcalc-mcp
just init

just init syncs the locked environment and installs the deterministic prek commit hook.

just test                      # Behavioral tests
just quality-check             # Ruff, mypy, and ty
just quality-check src/path.py # Targeted quality checks
just precommit                 # Run all commit-time hooks
just format                    # Format and apply safe lint fixes

Please create a new branch for your changes and open a focused pull request against main.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ironcalc_mcp-0.2.0.tar.gz (77.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ironcalc_mcp-0.2.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file ironcalc_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: ironcalc_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 77.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ironcalc_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5912d89d257a6915fbe13801d18a35a3ece66a81b2d824c7f8cc3f989dbf7257
MD5 156c75570a0ddeb10c646a60580427b7
BLAKE2b-256 29c7ecb4fa7987449eb9e43c2ad4a1c6d86bbd68baef74ef7d6549147d8d58e7

See more details on using hashes here.

File details

Details for the file ironcalc_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ironcalc_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ironcalc_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bc5e015feec2d19ebaf8e3782fd975c8a55942940805fc2583eab4d609b287a
MD5 7cef13ba81839fde14b5036919d52174
BLAKE2b-256 3fb29334d8fd421a7795cafcf187730a6620efe44463dae07ae86c296eec264e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.3

2 files

0.1.2

2 files

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