Skip to main content
Glama
README.md
# SheetCraft MCP — Local Excel (`.xlsx` / `.csv`) Intelligence Server

**100% offline Model Context Protocol (MCP) server & CLI for Excel spreadsheets.**  
Give **Claude Code**, **Cursor**, **Windsurf**, **Claude Desktop**, and **Antigravity** direct local tools to inspect, audit broken formulas & truncated `SUM()` ranges, diff two workbook versions, query/aggregate rows, convert CSVs without stripping leading zeros, and generate styled OOXML `.xlsx` workbooks — **zero cloud uploads, zero Python setup, zero runtime dependencies.**

[![License: MIT](https://img.shields.io/badge/License-MIT-059669.svg)](LICENSE)
[![Node.js >= 18](https://img.shields.io/badge/Node.js-%3E%3D18-339933.svg)](https://nodejs.org)
[![Zero Dependencies](https://img.shields.io/badge/Runtime%20Dependencies-0-0f172a.svg)](package.json)

---

## Quick Start (1 Line — No Install Needed)

Add `sheetcraft-mcp` to your MCP client config (runs instantly via `npx` with Node 18+):

### Claude Desktop / Cursor / Windsurf (`mcpServers`)

```json
{
  "mcpServers": {
    "sheetcraft": {
      "command": "npx",
      "args": ["-y", "github:hoanghoang290393/sheetcraft-mcp"]
    }
  }
}
```

### Claude Code CLI

```bash
claude mcp add sheetcraft -- npx -y github:hoanghoang290393/sheetcraft-mcp
```

### Standalone CLI Mode (Audit or Diff from Terminal)

```bash
# Deep formula & accounting integrity audit (0-100 Health Score)
npx -y github:hoanghoang290393/sheetcraft-mcp --audit ./Q4_Report.xlsx

# Diff two workbook versions matched by a unique key column (SKU / Account ID)
npx -y github:hoanghoang290393/sheetcraft-mcp --diff ./Q3.xlsx ./Q4.xlsx SKU

# Audit every .xlsx workbook in a directory
npx -y github:hoanghoang290393/sheetcraft-mcp --batch-audit ./finance-reports
```

---

## 8 Built-in MCP Tools

| Tool | What it does |
| :--- | :--- |
| **`inspect_workbook`** | Summarizes every sheet: dimensions, headers, formula count, error count, merged regions, and sample rows. |
| **`read_sheet`** | Paginated sheet reader with optional column filtering and raw formula inspection (`=SUM(C2:C10)`). |
| **`audit_workbook`** | Deep integrity audit: detects `#REF!`/`#DIV/0!`/`#VALUE!`/`#NAME?`/`#N/A`, **truncated `SUM`/`AVERAGE` ranges missing bottom rows**, **currencies/numbers stored as text**, exact duplicate rows, and returns a `0–100` Health Score. |
| **`diff_workbooks`** | Compares two `.xlsx` files by cell coordinates or by `key_column` (e.g. `SKU`, `ID`), showing added/removed sheets, rows, numeric `delta`, and `%` change. |
| **`query_sheet`** | Filters (`eq`, `neq`, `contains`, `gt`, `gte`, `lt`, `lte`), groups (`group_by`), aggregates (`count`, `sum`, `avg`), and sorts rows directly without writing code. |
| **`create_styled_workbook`** | Creates clean multi-sheet OOXML `.xlsx` workbooks with bold frozen navy headers (`A2`), `AutoFilter`, auto-fitted widths, native USD/EUR/GBP/percent formatting, preserved leading zeros, and **live Excel formulas** (`=SUM(...)`). |
| **`convert_csv_to_xlsx`** | Converts UTF-8 CSV/TSV files into styled `.xlsx` workbooks while preserving leading-zero ZIP/SKU codes and typing US/EU currencies & percentages. |
| **`batch_audit_folder`** | Scans an entire folder (optional `recursive: true`) of `.xlsx`/`.xlsm`/`.xls` files and ranks them from lowest to highest Health Score. |

---

## Why Local & Zero-Dependency?

- **Safe for confidential financial & HR spreadsheets:** Your files never leave your machine — no external APIs, no telemetry.
- **Catches silent accounting bugs:** Standard readers miss numbers accidentally stored as text (`"$8,500.00"` ignored by `SUM`) and `SUM(C2:C48)` formulas that forgot rows 49–50. `audit_workbook` catches both automatically.
- **Standards-compliant `.xlsx` output:** Generated workbooks pass strict `openpyxl -W error` (zero warnings) and open cleanly in Microsoft Excel, LibreOffice Calc, and Apple Numbers.

---

## Companion Spreadsheet & Automation Tools (by MacAppKit)

Built by the team behind [MacAppKit](https://macappkit.com/):

- **[Fillhand (Chrome Extension)](https://macappkit.com/chrome/fillhand/)** — Fill and submit any web form row by row directly from Excel/CSV in 4 clicks (250 free rows/month; Cyber Week **40% off Pro Lifetime $59.40** with code `CYBER40`).
- **[All 93 Excel Templates ($29)](https://sheets.macappkit.com/)** — 9 complete packs of zero-macro, formula-audited `.xlsx` dashboards for Finance, Business, Projects, HR & Planners (or grab [9 free templates on GitHub](https://github.com/hoanghoang290393/free-excel-templates-2027)).
- **[SheetPull (Chrome Extension)](https://macappkit.com/chrome/sheetpull/)** — Export any web HTML table, ARIA data grid, or paginated list into clean formatted `.xlsx` / UTF-8 CSV locally.
- **[Need a Custom Automation or Excel System in 24h?](https://macappkit.com/custom/)** — Fixed-scope custom Chrome extensions, web-to-Excel workflows, and audited financial dashboards.

---

## Development & Testing

```bash
# Rebuild single-file zero-dependency executable
node scripts/build.mjs

# Run full MCP JSON-RPC 2.0 stdio + openpyxl E2E test suite
node tests/e2e.test.mjs
```

## License

[MIT](LICENSE)