# ExStruct

A tool that converts Excel workbooks into structured JSON for LLM and RAG pipelines, and lets an AI agent read and patch-edit Excel files through a CLI and an MCP server.

ExStruct extracts cells, shapes, charts, SmartArt, table candidates, merged-cell ranges and print areas from an Excel workbook into structured JSON, YAML or TOON, by sheet or by area, with a formulas map linking each formula to its cell coordinates. On Windows it uses Excel COM for rich extraction; on Linux and macOS it falls back to direct OOXML parsing, or to a LibreOffice runtime when available, both on a best-effort basis, and it never crashes if neither is present.

A JSON-first editing CLI applies patch-based edits through the same core, and an MCP server exposes the same functionality for host-managed, reviewable editing workflows, tuned for LLM and RAG preprocessing and local automation. Python, BSD-3-Clause licensed, installed with pip.

Website: https://harumiweb.github.io/exstruct/
