Formula-backed WorkPaper tools for workbook readback, input edits, and JSON persistence.
io.github.proompteng/bilig-workpaper MCP Server
The io.github.proompteng/bilig-workpaper Model Context Protocol (MCP) server provides formula-backed WorkPaper tools for workbook readback, input edits, and JSON persistence. It is implemented as a Node.js package (Node.js >= 22) and exposes 8 tools for working with workbook runtime behavior and formula recalculation.
🛠️ Key Features
Formula-engine support for server-side formulas
Workbook readback and workbook automation
Input edits and workbook runtime updates
JSON persistence via workpaper-json
🚀 Use Cases
Recomputing formulas and reflecting workbook-formulas changes
Automating workpaper-runtime workflows
Persisting and restoring workpaper state as JSON
⚡ Developer Benefits
Node.js (>= 22) integration
TypeScript-oriented tooling (topics include typescript)
MCP tooling aligned with model-context-protocol and mcp-server usage
⚠️ Limitations
Only documented tool scope is for WorkPaper readback/edit/persistence; no other domains are indicated
Read calculated values plus serialized formulas/inputs for an A1 range. Use for audit readback after edits; use read_cell for one address.
Parameters2
range
string
required
A1 range such as Summary!A1:B5. If omitted from the range, pass sheetName separately.
sheetName
string
optional
Default sheet name when range omits a sheet name, for example Summary.
Raw schema
{
"type": "object",
"properties": {
"range": {
"type": "string",
"description": "A1 range such as Summary!A1:B5. If omitted from the range, pass sheetName separately."
},
"sheetName": {
"type": "string",
"description": "Default sheet name when range omits a sheet name, for example Summary."
}
},
"required": [
"range"
],
"additionalProperties": false
}
read_cell
Read one cell with calculated value, display text, formula text, formula diagnostics, and serialized content. Use after set_cell_contents to verify readback.
Write raw content to one cell and recalculate dependents in memory only. Start with --writable when the edit should persist to JSON.
Parameters3
sheetName
string
required
Existing sheet name, for example Inputs.
address
string
required
Single A1 cell address such as B3. Ranges are not accepted.
value
string
required
Raw cell content. Formula strings must start with =; plain strings are stored as literals. Strict MCP hosts such as Semantic Kernel require a single parameter type, so pass evaluated numbers/booleans as formulas such as =0.4 or =TRUE(). The server still accepts JSON number, boolean, or null arguments from clients that support them.
Raw schema
{
"type": "object",
"properties": {
"sheetName": {
"type": "string",
"description": "Existing sheet name, for example Inputs."
},
"address": {
"type": "string",
"description": "Single A1 cell address such as B3. Ranges are not accepted."
},
"value": {
"type": "string",
"description": "Raw cell content. Formula strings must start with =; plain strings are stored as literals. Strict MCP hosts such as Semantic Kernel require a single parameter type, so pass evaluated numbers/booleans as formulas such as =0.4 or =TRUE(). The server still accepts JSON number, boolean, or null arguments from clients that support them."
}
},
"required": [
"sheetName",
"address",
"value"
],
"additionalProperties": false
}
set_cell_contents_and_readback
Write raw content to one cell, recalculate dependents, read a dependent range in the same tool call, and return persistence proof. Use this for stateless MCP clients such as hosted Open WebUI integrations.
Parameters5
sheetName
string
required
Existing sheet name for the cell to edit, for example Inputs.
address
string
required
Single A1 cell address to edit, such as B3. Ranges are not accepted.
value
string
required
Raw cell content. Formula strings must start with =; plain strings are stored as literals. Strict MCP hosts require a single parameter type, so pass evaluated numbers/booleans as formulas such as =0.4 or =TRUE(). The server still accepts JSON number, boolean, or null arguments from clients that support them.
readbackRange
string
required
Dependent A1 range to read before and after the edit, for example Summary!A1:B5.
readbackSheetName
string
optional
Default sheet name when readbackRange omits a sheet name.
Raw schema
{
"type": "object",
"properties": {
"sheetName": {
"type": "string",
"description": "Existing sheet name for the cell to edit, for example Inputs."
},
"address": {
"type": "string",
"description": "Single A1 cell address to edit, such as B3. Ranges are not accepted."
},
"value": {
"type": "string",
"description": "Raw cell content. Formula strings must start with =; plain strings are stored as literals. Strict MCP hosts require a single parameter type, so pass evaluated numbers/booleans as formulas such as =0.4 or =TRUE(). The server still accepts JSON number, boolean, or null arguments from clients that support them."
},
"readbackRange": {
"type": "string",
"description": "Dependent A1 range to read before and after the edit, for example Summary!A1:B5."
},
"readbackSheetName": {
"type": "string",
"description": "Default sheet name when readbackRange omits a sheet name."
}
},
"required": [
"sheetName",
"address",
"value",
"readbackRange"
],
"additionalProperties": false
}
get_cell_display_value
Return the formatted display string for one cell. Use when an agent needs what a user would see, not the raw numeric value.
Export the current WorkPaper JSON document for persistence, review, or handoff to another agent. Does not write files by itself.
Parameters1
includeConfig
boolean
optional
Include workbook configuration metadata in the exported JSON. Defaults to true.
Raw schema
{
"type": "object",
"properties": {
"includeConfig": {
"type": "boolean",
"default": true,
"description": "Include workbook configuration metadata in the exported JSON. Defaults to true."
}
},
"additionalProperties": false
}
validate_formula
Validate formula syntax with the WorkPaper parser before writing it to a cell. This checks syntax only; use set_cell_contents plus readback to evaluate.
Parameters1
formula
string
required
Formula string including the leading =, for example =SUM(Inputs!B2:B4).
Raw schema
{
"type": "object",
"properties": {
"formula": {
"type": "string",
"description": "Formula string including the leading =, for example =SUM(Inputs!B2:B4)."
}
},
"required": [
"formula"
],
"additionalProperties": false
}
Bilig is a TypeScript-native, headless WorkPaper runtime for Node.js services,
tests, and AI agents. Set inputs, recalculate formulas, read computed outputs,
persist WorkPaper JSON, restore it, and verify the result—without driving Excel
or a browser grid.
Bilig is a headless workbook runtime, not a visual spreadsheet app or a claim
of full Excel compatibility. If an .xlsx file is your contract, start with
the compatibility report.
For ordinary operations, use set(), setMany(), readMany(), display(),
and saveJson(). Use editManyAndReadback() when multiple inputs must be
committed and verified as one edit. The complete public API is documented in
packages/workpaper/README.md.
Sheets, A1 addresses, formulas, ranges, and named expressions without a spreadsheet UI.
Verified mutations
Before/after computed values plus persistence and restore checks.
Service-owned state
Portable WorkPaper JSON for routes, queues, tests, tools, and audit trails.
Agent-safe tools
Narrow read/write tools with exact cells, computed readback, and writable-sheet boundaries.
Explicit file boundaries
Separate XLSX import, export, risk inspection, and Excel-oracle workflows.
Use Bilig for pricing, quote approval, payouts, forecasts, validation rules,
formula-backed workflows, and tests where a service or tool should own the
model. Choose a spreadsheet application or hosted spreadsheet API when you
need visual editing, collaboration, macros, interactive pivots or charts, or
desktop fidelity.
Agents And MCP
Agents should first ask which system owns state, then run the smallest matching
proof. For a tool host or MCP client:
The MCP evaluator proves tool discovery, mutation, recalculated readback, JSON
export, disk persistence, process restart, and restored readback. For a local,
writable WorkPaper:
Use that local stdio path for private or persistent project state. The hosted
https://bilig.proompteng.ai/mcp endpoint is request-local and only intended
for stateless connector discovery and smoke tests; do not send private workbook
data to it.
The server exposes list_sheets, read_range, read_cell,
set_cell_contents, set_cell_contents_and_readback,
get_cell_display_value, export_workpaper_document, and validate_formula.
It also publishes MCP resources and prompts so capable hosts can discover the
workflow before editing cells.
The published package also carries AGENTS.md and SKILL.md, so an agent can
discover the same proof contract from node_modules. Install or inspect the
public skill with either source:
Use the agent rule chooser or the
host handoff prompt.
The repository includes CLAUDE.md,
.claude/skills/bilig-workpaper/SKILL.md,
.claude/commands/bilig-workpaper-proof.md,
.cursor/rules/bilig-workpaper.mdc, .devin/rules/bilig-workpaper.md,
.windsurf/rules/bilig-workpaper.md, .clinerules/bilig-workpaper.md,
.continue/rules/bilig-workpaper.md, .zed/settings.json, opencode.jsonc,
and .opencode/agents/bilig-workpaper.md.
Integration Recipes After The Proof
Run an evaluator first, then use the recipe owned by your host:
OpenAI Agents SDK: direct tools, MCPServerStdio, and MCPServerStreamableHttp.
OpenAI Responses API: function-call readback with explicit before/after evidence.
Vercel AI SDK: generateText() and streamText() tool loops.
unsupported formulas and workbook risk reasons for that file
Cached .xlsx values look stale
xlsx-cache-doctor workbook.xlsx --json
stale-cache diagnosis, recalculation, and readback for that file
The workbook-compatibility and xlsx-cache evaluator doors use bundled demo
workbooks to smoke-test the published package; they do not inspect your file.
Do not treat any evaluator as proof of desktop Excel parity.
Examples And Deeper Guides
Start with one maintained example, not the whole monorepo:
examples/headless-workpaper: pricing,
invoice, budget, fulfillment, subscription, persistence, and agent examples.
pnpm --dir examples/headless-workpaper run agent:ai-sdk-generate-text
pnpm --dir examples/headless-workpaper run agent:ai-sdk-stream-text
pnpm --dir examples/headless-workpaper run agent:openai-responses
pnpm --dir examples/headless-workpaper run agent:mcp-xlsx-risk-preflight
pnpm --dir examples/serverless-workpaper-api run hono-route
pnpm --dir examples/serverless-workpaper-api run next-server-action
pnpm --dir examples/serverless-workpaper-api run next-server-action-formdata
Bilig can import and export workbook files, but cached formula values inside an
.xlsx are diagnostics—not an accuracy oracle. Inspect the file before trusting
it:
The first command is a package smoke test over a bundled demo. The next two
inspect the named file. The compatibility report identifies unsupported
functions, external links, macros, pivots, volatile formulas, and other risks;
it does not certify Excel compatibility. When correctness matters, compare
against a workbook freshly recalculated by Excel. See the
compatibility limits and
Excel oracle walkthrough.
Read SUPPORT.md for the evidence that makes a report actionable.
Follow SECURITY.md for private vulnerability reporting. Never
attach private workbook data, credentials, or tokens to a public issue.
If Bilig fits one of your services or agent workflows,
star the repository to follow releases
and help other Node developers find it. Tell us what proof or formula is still
missing.