slim-sheet

io.github.j4flmao由 GitHub 帳號 j4flmao 發布v0.1.0更新於 Oct 30, 2026

Spreadsheet MCP for any agent: reads xlsx/xls/ods/csv, SQL, cleaning, formulas, safe edits

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理讀取、查詢、清理、編輯與排版試算表(xlsx、xls、ods、csv 等),並產出品牌化儀表板。

可以做什麼
  • 盤點與讀取活頁簿:概覽、依 A1 座標讀取儲存格、尋找文字或正規表示式、描述儲存格並追蹤公式
  • 查詢與分析資料:對工作表執行唯讀 SQL SELECT、欄位統計、異常檢查、檔案差異比對
  • 修改資料:寫入數值、填滿/複製/排序/取代/插入或刪除範圍、清理表格、合併、轉檔或拆分檔案、樞紐分析、復原
  • 產出與美化:一次呼叫產生品牌化儀表板與套用樣式的表格、圖表、表格物件、下拉與醒目提示規則、工作表版面與列印設定
  • 處理公式:解說、離線求值、假設分析與目標搜尋、透過 LibreOffice 重算
  • 管理結構:建立活頁簿、新增/重新命名/複製/刪除工作表、定義名稱、註解、連結與圖片
適用情境
適合助理需要在使用者電腦上檢視或修改真實試算表檔案、而不必撰寫 Python 或 openpyxl 程式碼的情境,例如稽核財務模型、清理混亂的匯出資料、核對兩張表,或產出可直接交付的報告與儀表板。
執行需求
以 stdio 在本機執行,透過 uvx 從 slim-sheet 的 PyPI 套件啟動,因此需要 Python 與 uv。選用附加元件提供離線公式求值、加密活頁簿、Apple Numbers 與插入圖片;只有 recalc 需要安裝 LibreOffice。設定使用 SLIM_SHEET_ROOTS、SLIM_SHEET_TIER、SLIM_SHEET_MAX_TOKENS 等環境變數;加密活頁簿需要 SLIM_SHEET_PASSWORD。
安裝前請注意
編輯類工具會寫入檔案:預設存成新的 .slim.xlsx 副本,除非設定 overwrite=true,undo 可回復上一次寫入。SLIM_SHEET_ROOTS 決定可讀寫哪些資料夾,應盡量縮小範圍。SLIM_SHEET_PASSWORD 是加密活頁簿的密碼,應放在主機設定中而非聊天內容。儲存格文字屬於不可信資料,可能夾帶注入指令。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 slim-sheet,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

slim-sheet

A spreadsheet MCP server that small local models can actually use. It reads xlsx xlsm xltx xltm xlsb xls ods numbers csv tsv parquet json locally (no Office, no network), keeps every response under a token budget, and gives agents SQL, cleaning, anomaly detection, a formula copilot, Excel-correct editing and one-call branded dashboards — through 8, 18 or 30 tools depending on how capable the model is.

Works with Claude Desktop / Claude Code (Free or Pro), OpenCode, Codex, Cursor, Cline, Continue, LM Studio, Ollama (via mcpo or Open WebUI) — and as a plain CLI for agents without MCP.

Install

bash
uvx slim-sheet mcp                          # MCP server over stdiouvx slim-sheet overview sales.xlsx          # or use any tool from the shelluvx --from "slim-sheet[all]" slim-sheet mcp # + offline formula engine, encrypted files, Apple Numbers

Host configuration for every client (Claude, Cursor, OpenCode, Codex, LM Studio, Ollama/mcpo, Open WebUI, Cline, Continue) is in docs/hosts.md.

json
{  "mcpServers": {    "slim-sheet": {      "command": "uvx",      "args": ["slim-sheet", "mcp"],      "env": { "SLIM_SHEET_TIER": "lite", "SLIM_SHEET_ROOTS": "/path/to/your/data" }    }  }}

Tiers

TierToolsFor
full (default)every tool belowany model that should be able to do everything
liteoverview, read, find, query, profile, write, explain_formula, build_report3B–8B local models
standardlite + clean, anomalies (+formula audit), merge, convert (+split), diff, undo, evaluate (+check), describe_cell (+trace), style_sheet, what_ifmid-size and frontier models
fullstandard + create_workbook, sheet_ops, range_ops, name_ops, format_range, set_table, rules, add_chart, sheet_layout, annotate, pivot, split, recalcfrontier models building workbooks

Pick exact tools with SLIM_SHEET_TOOLS=overview,read,query.

Design: professional output with almost no description

The model names what to show; slim-sheet decides how it looks — layout, colours, fonts, number formats, chart type, sort order and an insight title — from a brand. One call:

text
build_report(path="sales.xlsx", data_sheet="Sales", title="Sales performance 2025",             kpis=["Revenue=sum:Revenue", "Margin=ratio:Profit/Revenue", "Orders=count"],             charts=["trend:Month:Revenue", "rank:Region:Revenue", "share:Product:Revenue"])

gives a one-page dashboard: KPI tiles with live formulas (7.1m · 20.4% · 144), a line titled "Revenue rose 58% from 2025-01 to 2025-12", a sorted bar with the leader highlighted, a labelled doughnut, a source footer. style_sheet(path, sheet, preset="report") does the same for any table and reports the number formats it inferred.

Your company's look, set once. Built-in brands: slim (default), office, modern (Aptos), mono (IBCS-style), gov (UK government statistics style). Or point SLIM_SHEET_BRAND at a JSON file — only name is required:

json
{ "name": "Acme", "primary": "#C8102E", "body_font": "Arial", "currency": "$", "profile": "finance" }

Every workbook then carries the brand as a real Office theme, so Excel's own table and chart styles follow it too. Rules behind the defaults (IBCS, finance colour coding, UK spreadsheet accessibility guidance, chart-choice tables): PLAN.md §16.

What makes it different

  • Reads everything with one interface, including .xls, .xlsb, .ods, Apple Numbers and password-protected xlsx.
  • Budgeted output: Markdown tables with A1 coordinates, ~1,500 tokens per response, next cursors to continue.
  • Errors that teach: every error has a code, a message and a corrected example call.
  • SQL over sheets with DuckDB; messy sheets are split into regions with detected headers ("Report.2").
  • Never destroys data: edits go to <name>.slim.xlsx unless overwrite=true, writes are atomic, every replaced file is journaled, and undo steps back.
  • Excel-correct structure edits: inserting/deleting rows or renaming a sheet rewrites formulas, names, merges, validations, conditional formats, tables and charts the way Excel does.
  • Model checking: anomalies scope='formulas' finds hardcoded numbers, broken patterns, double counting and where an error starts; describe_cell trace= follows formulas across sheets; what_if runs delta, goal seek and sensitivity grids without touching the file.
  • Formula copilot: 514-function catalog, version checks (XLOOKUP in Excel 2016 → suggests INDEX/MATCH), offline evaluation with dependency chasing.
  • Macros, read-only: read sheet='#vba' shows VBA source, anomalies scope='macros' rates risk, and agents redo a macro's job with tools (prompt replace_macro). slim-sheet never runs macros.
  • Excel-exact formulas: newer functions are stored with Excel's _xlfn. prefixes and spilling formulas as real dynamic arrays, with a warning when something blocks the spill.
  • Flexible paths, safe by default: give any folder in chat (no config change); system folders, AppData, dot-folders such as .ssh and non-spreadsheet files are refused. Read-only SQL with file access locked, no model-written code is executed, no network.

Configuration

VariableDefaultMeaning
SLIM_SHEET_TIERfullfull, standard or lite
SLIM_SHEET_TOOLS—explicit comma-separated tool list
SLIM_SHEET_ROOTScurrent directorydefault folders for relative paths and overview() (; on Windows, : elsewhere)
SLIM_SHEET_STRICT_ROOTSoff1 = only paths inside SLIM_SHEET_ROOTS (the old allow-list)
SLIM_SHEET_MAX_TOKENS1500default response budget
SLIM_SHEET_TOKEN—bearer token for --transport streamable-http (required off loopback)
SLIM_SHEET_PASSWORD—password for encrypted workbooks (never passed through chat)
SLIM_SHEET_SOFFICEautodetectLibreOffice binary for recalc
SLIM_SHEET_AUDIT_LOG—JSONL audit log of every tool call (contents redacted)
SLIM_SHEET_RATE_LIMIT120HTTP tool calls per minute per client (0 = off)
SLIM_SHEET_MAX_CELLS3000000refuse workbooks declaring more cells (0 = off)
SLIM_SHEET_BRANDslimbrand name (slim, office, modern, mono, gov) or path to a brand .json

Extras: formula (offline evaluate and what_if), crypto (encrypted xlsx), numbers (Apple Numbers), images (insert pictures with annotate), all.

Prompt library

Ready-made, data-agnostic prompts — a shared CORE method, thirteen ROLES (nine analyst roles: sales, finance, marketing, customer, operations, HR, reconciliation, data quality, general; plus model auditor, workbook editor, macro migrator and file reviewer) and eight OUTPUT patterns (dashboard, dashboard pack, report workbook, clean dataset, reconciliation report, quick answer, audit report, edited workbook), with filled-in example sets, about 50 one-paste task recipes in 8 packs (finance, sales, HR, operations, data prep, Excel tasks, reporting, Vietnam) and compact blocks for small local models: docs/prompts.

Skill packs

skills/building-client-reports turns the tools into client-ready reports: a report brief, role presets (CFO, board, sales, marketing, operations, HR, market research), a standards checklist and evals. Copy it into ~/.claude/skills/ or attach it to any agent (skills/README.md).

Non-MCP hosts

bash
slim-sheet schema --format openai --tier lite      # function-calling schemas for any OpenAI-compatible APIslim-sheet schema --format anthropic --tier full   # Messages API tool definitionsSLIM_SHEET_TOKEN=... slim-sheet mcp --transport streamable-http --host 0.0.0.0 --port 8765

Development

bash
uv sync --all-extrasuv run pre-commit install                 # ruff, mypy, manifests, commit-message rule, tests on pushuv run python scripts/make_demo.py        # sample workbooks in ~/Documents/slim-sheet-demouv run ruff check . && uv run ruff format --check . && uv run mypy src && uv run pytest -q

Issues and pull requests use the templates in .github/; security reports go through SECURITY.md.

Design and roadmap: PLAN.md · agent rules: AGENTS.md · MIT licensed.

來源:README.md,提交 c9e9976

工具

30

overview

Workbook overview

Map a spreadsheet file (or list the spreadsheets in a folder; no path lists all allowed folders): sheets, used ranges, header row, columns and types. Call this first.

輸入參數path

read

Read cells

Read cells as a table with A1 coordinates (sheet, range 'A1:F50', cursor). sheet='#vba' lists macros; range='Module1' shows its code.

輸入參數path必填rangesheetcursorformatmax_tokens

find

Find cells

Find cells containing text (or a regex) across sheets; returns Sheet!A1 addresses. Example: find(path='sales.xlsx', text='refund')

輸入參數path必填text必填regexsheetmax_results

query

SQL query

Run one read-only SQL SELECT; tables are sheet names, quote names with spaces. Example: sql='SELECT "Region", sum("Total") FROM "Orders" GROUP BY 1'

輸入參數sql必填path必填offsetmax_tokens

profile

Profile columns

Column statistics for a sheet: type, nulls, distinct, min, max, mean, median, top values. Optional columns list.

輸入參數path必填sheetcolumns

write

Write cells

Write a 2-D values array starting at range's top-left cell, e.g. values=[['Total', 120]]. Saves to <name>.slim.xlsx unless overwrite=true.

輸入參數path必填range必填sheet必填values必填out_pathoverwrite

explain_formula

Explain formula

Explain and check an Excel formula: steps, references, syntax/arity errors. Pass formula='=...' or path plus cell like 'Sheet1!C7'.

輸入參數cellpathsheetformula

build_report

Build dashboard

Build a branded, print-ready dashboard from a data sheet. Example: kpis=['Revenue=sum:Rev 2025|vs:Rev 2024:2024'], charts=['trend:Month:Total','table:Region:Total'], messages=['finding']

輸入參數kpispath必填brandsheettitle必填chartsmessagesout_pathsubtitleoverwritedata_sheet必填

clean

Clean table

Clean a table: ops from trim, collapse_spaces, remove_nonprintable, unify_null, numbers_from_text, normalize_dates, drop_empty_rows, drop_empty_cols, dedupe. Previews unless apply=true.

輸入參數ops必填keyspath必填applysheetout_pathoverwrite

anomalies

Find anomalies

Find suspicious cells (duplicates, types, outliers, typos); scope='formulas' audits models; scope='macros' rates VBA risks; scope='client' checks readiness for clients.

輸入參數path必填scopesheetcolumnsmax_results

merge

Join or reconcile tables

Join two tables on keys (how=left|inner|full|anti), or how=reconcile to label rows matched/different/only_left/only_right. keys=['ID'] or ['ID=Order No'].

輸入參數howkeys必填path必填sheetcompareout_pathoverwritetolerancemax_tokensother_path必填other_sheet

convert

Convert or split

Convert to xlsx/csv/tsv/parquet/json by out_path extension; CSV: delimiter=';', encoding='cp1252', decimal=','. split_by='Region' splits; a folder exports VBA.

輸入參數modepath必填sheetdecimalencodingout_pathsplit_bydelimiteroverwrite

diff

Compare files

Compare two files cell by cell, or row by row with key='ID'. Example: diff(path='a.xlsx', other_path='a.slim.xlsx')

輸入參數keypath必填sheetother_path必填max_results

undo

Undo last write

Undo the last slim-sheet write to a file (every editing tool is journaled).

輸入參數path必填

evaluate

Evaluate or check formula

Calculate a formula offline, or check it with check_only=true (target='2016'). Example: evaluate(path='x.xlsx', cell='Calc!C7')

輸入參數cellpathsheettargetformulacheck_only

describe_cell

Describe and trace cell

Everything about one cell: value, formula, format, note, validation; trace='precedents' or 'dependents' follows formulas across sheets.

輸入參數cell必填path必填depthsheettrace

style_sheet

Style table

Make a table look professional in one call: header, number formats, totals, widths, print setup, and restyles the sheet's charts. preset=report|data|finance|striped|minimal|charts.

輸入參數path必填brandrangesheet必填presetout_pathoverwritetotal_rownumber_format

what_if

What-if analysis

Change inputs in memory and see outputs move: op=delta|goal_seek|grid. Example: inputs=['Inputs!B3=8%'], outputs=['Model!B20']. Never writes.

輸入參數oppath必填sheetinputs必填targetoutputs必填

create_workbook

Create workbook

Create a new empty branded .xlsx with the given sheet names. Example: create_workbook(path='out.xlsx', sheets=['Data','Summary'])

輸入參數path必填brandsheetsoverwrite

sheet_ops

Sheet operations

Add, rename, delete, copy, move, hide or unhide a sheet (op=...). Renames also fix formulas that point to the sheet.

輸入參數op必填path必填sheet必填new_nameout_pathpositionoverwrite

range_ops

Range operations

Edit a block: op=fill|copy|move|transpose|sort|replace|insert|delete|clear|split. Example: op='fill', range='D2:D200'. where="Status='Closed'" filters rows.

輸入參數byop必填todescfindpath必填whatrangesheet必填whereheaderreplace另有 5 個

name_ops

Defined names

List, add or delete defined names. Example: name_ops(path, op='add', name='TaxRate', ref='Rates!B2')

輸入參數op必填refnamepath必填out_pathoverwrite

format_range

Format cells

Style a range: role ('title','header','total'...), bold, colors, number_format ('percent','m'...), align, border, merge, autofit.

輸入參數boldpath必填rolewrapalignmergerange必填sheet必填borderitalicvalignautofit另有 6 個

set_table

Excel table

Turn a range with a header row into a named Excel table; same name again resizes it. Example: set_table(path, sheet='Data', range='A1:D50', name='Sales', totals=true)

輸入參數name必填path必填range必填sheet必填styletotalsout_pathoverwrite

rules

Validation and highlight rules

Add a dropdown/input rule (kind=list|whole|decimal|date|text_length|custom) or highlight rule (greater_than|between|duplicates|top_n|color_scale|data_bar|formula...).

輸入參數kind必填path必填range必填sheet必填valuevalue2valuesformulamessageout_pathoverwritefill_color另有 2 個

add_chart

Add chart

Insert a clean branded chart (type=auto picks one) from data_range: header row + category column + series columns. Optional highlight='North'; replace=true swaps the chart at anchor.

輸入參數path必填type必填brandsheet必填titleanchorreplacex_titley_titleout_pathhighlightoverwrite另有 1 個

pivot

Pivot summary

Summarise a table: rows=['Region'], values=['Total'], agg=sum|count|avg|min|max, columns='Month'. to_sheet saves it; native=true makes a real Excel PivotTable.

輸入參數aggpath必填rows必填sheetnativevalues必填columnsout_pathto_sheetoverwritemax_tokens

recalc

Recalculate

Recalculate every formula with LibreOffice so cached values are fresh (needs LibreOffice installed).

輸入參數path必填out_pathoverwrite

sheet_layout

Sheet layout

Set how a sheet looks and prints: freeze, widths=['A=14'], heights, filter_range, hide, gridlines, zoom, print_area, landscape, fit_width, protect; workbook: calc_mode, protect_structure.

輸入參數hidepath必填zoomsheet必填freezeunhidewidthsheightsprotectout_pathcalc_modefit_width另有 6 個

annotate

Notes, links, images

Add a note, hyperlink or image to a cell, or remove objects: op=note|link|image|remove. Example: op='link', cell='B2', url='https://...'

輸入參數op必填urlcell必填path必填textsheet必填targetout_pathoverwriteimage_path

版本歷史

1
  1. v0.1.0最新Oct 30, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分