SuperAPI AI Directory

Kookerella-Ltd/Kookerella.FsOpenXmlDsl

Kookerella.FsOpenXmlDsl.Mcp is a .NET-based MCP (Model Context Protocol) server that wraps the Excel reading, writing, and code generation capabilities of Kookerella.FsOpenXmlDsl into tools that AI agents can call directly. It supports creating and reading .xlsx/.xlsm workbooks, and can decompile existing workbooks into runnable F# or C# source code, or convert them into XML/JSON that conforms to the real schema, and can also build workbooks in reverse from XML/JSON. The tool runs as a local subprocess over stdio, requiring no hosted service, network address, or account, and no Excel installation. The same binary also provides command-line convert/build usage, as well as direct library invocation.

Open website

About this tool

Kookerella.FsOpenXmlDsl.Mcp is an MCP server under the Kookerella.FsOpenXmlDsl project, whose goal is to expose Excel workbook reading, writing, and code generation capabilities to MCP-compatible AI agents, so that agents can build workbooks, read workbooks back, or regenerate their F#, C#, XML, or JSON representations without writing code themselves.

Purpose and positioning Most Excel libraries support only one-way operations: building a workbook from scratch, or modifying an existing file through an imperative object model. This project emphasizes the reverse capability: reading any existing .xlsx/.xlsm and returning runnable idiomatic F# or C# source code, or returning XML/JSON that conforms to the real schema for rebuilding an equivalent file; it can also build a new workbook directly from XML/JSON. It is officially described as "a decompiler for spreadsheets," not merely a writer.

Main capabilities The following capabilities are provided through MCP tools: generate_fsharp_script, generate_csharp_script, generate_xml, create_workbook_from_xml, generate_json, create_workbook_from_json, as well as generate_xml_schema and generate_json_schema for returning the schema itself. There are also two narrower tools, create_workbook and read_workbook, which support only ordinary cell values and formulas, addressed by row-column grid per worksheet.

Beyond code generation, the XML/JSON direction has two specific uses: first, building .xlsx from XML/JSON, which is suitable for XSLT pipelines or any template/generation script to produce Excel directly without writing code; second, converting existing .xlsx to XML/JSON for version control, because .xlsx is a binary ZIP and git diff is essentially useless, whereas the output of generate_xml/generate_json is sorted by cell position or defined name, so content changes produce small, isolated diffs.

Usage The server runs locally and is started as a subprocess by the MCP client over stdio, with no hosted service, network address, or registrationAccount. It is distributed as a .NET tool, and after installation the fsopenxmldsl-mcp command is added to PATH. Users who have not installed .NET can download a self-contained build for their platform from the Releases page, with no installation required. When configuring an MCP client, simply point the client at the installed command, for example by configuring it in a client that reads a JSON configuration containing an mcpServers mapping.

The same binary can also be used as an ordinary CLI: starting it without arguments runs the MCP server; when convert or build is given as the first argument, it runs once and then exits. convert can convert files to F#, C#, XML, or JSON, and supports --lang/-l (required), -o/--output to write to a file, and --rebuild-as to specify the filename under which the generated script is saved when rebuilding the workbook (valid only for F#/C#). build is the inverse of convert --lang xml/json: it reads XML/JSON conforming to Xml.xsd or Json.schema.json and directly generates an .xlsx, with the format inferred from the input file extension.

Use cases and limitations It is suitable for scenarios where an AI agent needs to directly manipulate Excel, decompile a workbook into runnable source code, use XML/JSON for Excel version control, or generate Excel through XSLT/template pipelines. Limitations include: create_workbook/read_workbook cover only ordinary cell values and formulas and do not expose styles, tables, charts, images, pivot tables, sparklines, conditional formatting, etc.; formula cells in create_workbook do not carry cached values because this technology stack has no formula evaluation engine; the JSON direction does not perform JSON Schema validation at runtime in the core library, and the schema is only returned by the MCP tool on request.