Purpose
logisheets-mcp is an MCP (Model Context Protocol) server that wraps LogiSheets, a spreadsheet engine written in Rust. Its goal is to give AI agents a spreadsheet they can "really think in": deterministic, Excel-compatible calculation, plus structured memory (blocks), ultimately producing real .xlsx files. It is MIT-licensed, runs on the user's own machine, and is self-hostable.
Main capabilities
- Named blocks: A block is a named table on a worksheet, with rows having keys and columns having names, and everything is addressed by name rather than by position.
- Column-level formulas: A field's formula is declared once for the entire column, rather than cell by cell. New rows are calculated automatically, and there is no problem of "the twentieth formula being written incorrectly."
- Meaningful references: References state their meaning, for example the pv field of row key Y3. Insert a row above it, and the reference's meaning stays the same, because it never said "row 8."
- The engine owns calculated values: Formula fields cannot be overwritten by numbers the model calculates on its own.
- Blocks can be created by the agent on demand: No advance preparation is needed. convert_to_block can turn an ordinary cell range into a block, reading field names from the header and inferring the key column.
- Cold read (second session): The schema is written into the .xlsx, including field names, key columns, engine-calculated fields, and the rules for each entry. A single list_blocks call lets the workbook introduce itself; a single describe_block returns an explanation of rules such as #FIELD("revenue")*BLOCKREF("assum","margin","v"), rather than a new lookup problem. Blocks also carry description text (given at creation time or set afterward with set_block_description), stored in the file and returned from describe_block.
- Chart recalculation: chart_from_block writes a chart into the workbook; the chart stores references rather than values and is a native Excel c:chartSpace. Modify the source cells, and the chart follows; new ranges automatically appear in the chart, because the series are bound to fields rather than cell positions. chart_insert does the same thing for any A1 range.
- Scenarios and goal seeking: preview_changes and goal_seek change how the model explores—each scenario runs on a separate temporary branch and is discarded, a 4×4 sensitivity grid returns sixteen numbers in one call without writing to the workbook, and inverse solving is one call rather than a step-by-step bisection. trace answers "what read it," not "what it read."
- Analysis and pivots: Analysis blocks and pivot tables are engine-derived summaries. The agent declares the recipe (which block, which fields, which function), and the engine generates all formulas accordingly; renaming a source field rebuilds the summary rather than breaking it, and rows added later are already included. Both land in ordinary blocks, so BLOCKREF("by_region", "East", "Q2") can serve as a cross-tab cell and take part in the next calculation.
- File output: save_workbook writes a real .xlsx and returns an MCP resource link (uri, media type, size) instead of bytes. Hosts that support resources can read from workbook://current.xlsx; export_xlsx returns base64 for hosts that do not support resources. Formulas can be written out for human reading in the form BLOCKREF("proj","Y3","pv"), or parsed into ordinary coordinates for Excel to use.
- Session persistence: One MCP session holds one active workbook, kept alive across tool calls, making it memory rather than a calculator.
Usage
Requires Node 20+.
For Claude Desktop, add the following to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json; Windows: %APPDATA%\Claude\claude_desktop_config.json), then restart:
The code content for this configuration block was not provided in the material.
Any MCP host that starts a stdio server is used the same way—Cursor reads the same block from ~/.cursor/mcp.json.
Example prompt:
Build me a three-year revenue model: 100 units at $9.50 growing 40% a year, with a 30% cost of goods. Then save it to ~/model.xlsx.
The numbers are returned by the engine rather than guessed by the model, and the .xlsx contains live formulas: change an assumption in Excel and you will see it recalculate. To see the same effect without an LLM, npm run build && npm run demo drives the real server over stdio and verifies each assertion step by step.
Using it as a library: createServer returns an MCP Server, WorkbookSession, and tool map, so it can be hosted on any transport layer.
Developing in sync with the engine: check out LogiSheets as a sibling directory, build its packages, run npm run link:local, and symlink all three into node_modules so that local engine changes take effect without reinstalling; rerun after each npm install.
Tool set
32 tools are exposed by default. The material notes: tool selection accuracy decreases as the list grows, and every description consumes context on every turn.
Setting LOGISHEETS_MCP_TOOLS=full expands it to 73: undo/redo, formatting, merging, comments, checkpoints, block move/resize, cross-block links, block permissions, chart_suggest, defining and renaming names, and raw row/column structure. Mutating tools carry MCP's readOnlyHint / destructiveHint annotations, so hosts can place them behind approval.
Chart tools keep their namespace prefix, while other tools drop it: within their namespace they are called list, insert, update, and delete.
Formulas are Excel-compatible, plus BLOCKREF(block, key, field) for reading a block cell by name. Inside field rules, #FIELD("name") means the sibling field on the same row, and #FIELD("name", "key") means another row in the same block (the row carrying that key, never a positional offset).
list_names belongs to the core tool surface, while the three tools that write defined names do not; this is intentional: defined names are labeled coordinate ranges, for example Sales = Sheet1!$B$2:$B$20 inAdding rows does not expand it, which is exactly the fragility that blocks are meant to eliminate. But workbooks built by others may be full of defined names, and without figuring out what Sales covers, you cannot read =SUM(Sales), so reading them is orientation, while using them to build is crossing over to a better tool.
A note on pivot tables: the numbers are live, the shape is not. No formula can add rows, so groups that first appear in the source after the pivot table is built will simply be absent—every number is correct, the table is incomplete, and there is no way to see what is wrong. describe_block will point out the missing groups, and refresh_pivot will restore them, so this pair of tools sits on the core tool surface.
Applicable Scenarios
- Let AI agents build, modify, and analyze spreadsheet models in a deterministic way.
- Multi-scenario "what if" analysis and goal seeking, without repeated back-and-forth.
- Real .xlsx output that can be opened, audited, and continued to be used by people.
- Understand existing workbooks across sessions: with saved schemas and block descriptions, later sessions can interpret the model's intent without prior context.
- Scenarios that require local, offline, self-hostable operation.
Limitations and Security
- The read/write scope depends on where the server process can reach, which is the normal state for a local stdio server, the same posture as the official filesystem server. It should be run as a user with only the intended access permissions.
- No sockets, no ports, no telemetry. The host starts it as a subprocess and exchanges newline-delimited JSON-RPC over stdin/stdout; the engine is WASM in the same process, so formulas are function calls rather than requests. Air-gapped machines are a supported way to run it. The material states that it has been checked: after a complete session (creating a block, attaching field rules, evaluating formulas, saving .xlsx), the process holds six pipes and no sockets, and is not listening on any port.
- The performance comparison figures, benchmark tasks and results, and byte overhead of cold-read tests in the material are descriptions of the repository's own measurements and assertions, and are not repeated item by item here; for specific values, refer to the original repository.
- The material does not provide pricing or fee information.
- The material does not provide the specific code content of the configuration block, so it is not shown here.
- The material does not provide specific host configuration details beyond Claude Desktop and Cursor.