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 分