Skip to main content

excel-mcp

Python MCP License

Let your AI agent read real, messy Excel files. An MCP server that handles the things LLMs choke on: multiple sheets, title rows sitting above the actual table, and merged cells.

If you paste a spreadsheet into a prompt, the model has to guess where the data starts and what the merged cells mean, and it often gets it wrong. This reads the file properly with deterministic code, so the values are exact and the model never invents cell contents.

The problem it solves

A real spreadsheet almost never starts cleanly at cell A1:

A1:  Quarterly Sales Report 2024      <- title, not data
A2:  Generated by finance             <- note, not data
A3:  (blank)
A4:  Region | Product | Units         <- the actual header
A5:  North  | Widget  | 120
...

Ask an LLM to read that and it'll often treat the title as a column. read_table auto-detects that the header is on row 4 and returns clean records. Merged cells (a value spanning several rows) get forward-filled, so rows don't lose their category.

The tools it gives an agent

Tool What it does
list_sheets(path) Every sheet in the workbook, with its size
preview_sheet(path, sheet, rows) Top rows as a grid, so the agent can see the layout
read_table(path, sheet) The actual data table as records (auto-detects the header row)
sheet_to_csv(path, sheet) The table as clean CSV text

Quickstart

pip install "excel-agent-mcp[mcp]"

Add it to your MCP client (e.g. Claude Desktop):

{
  "mcpServers": {
    "excel": { "command": "excel-agent-mcp" }
  }
}

Now your agent can answer "what's in this spreadsheet?" or "pull the sales table out of sheet 2" by reading the file, not guessing.

Also usable from plain Python

from excel_mcp import reader

reader.list_sheets("report.xlsx")
reader.read_table("report.xlsx", "Sales")     # {'columns': [...], 'rows': [...], 'header_row': 3}
reader.sheet_to_csv("report.xlsx", "Sales")

Tests

python -m unittest discover -s tests     # builds its own messy xlsx, runs anywhere

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

excel_agent_mcp-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

excel_agent_mcp-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file excel_agent_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: excel_agent_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for excel_agent_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8f3d3c55b9484b3f27ddeefc6d82e8db6b20d16c08b3880c2bdaf2861a428b25
MD5 21d2c2734cb0c6605234ee4652991eb9
BLAKE2b-256 15f72477e7be8d2b2e51f9056f135633e02747becc14e3763af89fc9b9dd4aee

See more details on using hashes here.

File details

Details for the file excel_agent_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for excel_agent_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7417a46ac3cfdf10be3c860cbffe319c54a8f4dd32659312094e29694691f43
MD5 57a92d32ff1db8b64fc8bfe17a51bcd4
BLAKE2b-256 394714d9c1f47f6089d00877d843f27273a2f5f0628a5de95ee0bd7347b1d041

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page