xlvane: XLSX workbooks

io.github.DevXord由 GitHub 账号 DevXord 发布v1.3.3更新于 Nov 5, 2026

XLSX tools: inspect, read, diff and validate workbooks; write, edit and convert with --allow-write.

已验证STDIO仅桌面文件与存储数据与分析

概览

AI 生成的概览

面向 XLSX 工作簿的本地 MCP 服务器,让助手检查、读取、比对和校验表格,并可选地写入、编辑或转换文件。

可以做什么
  • 检查工作簿:工作表(含隐藏表)、已用区域、表头行、列类型与样例、合并单元格、公式和警告
  • 按表头把工作表行读取为对象,支持分页,日期以 ISO 8601 返回
  • 逐单元格比对两个工作簿,并按列规则校验,指出每个问题所在的单元格
  • 把行写入新的 XLSX 文件(报告预设),或设置单元格、追加行并保持其余内容不变
  • 在 XLSX 与 CSV、TSV、JSON 之间互相转换,CSV 输出会转义类似公式的文本
适用场景
适合助手需要在本机处理表格文件而不写代码的场景:查看工作簿结构、抽取行用于分析、比较两个版本的差异,或生成和更新 XLSX 报表。
运行要求
通过 npx 从 npm 包以 stdio 方式在本地运行,需要 Node.js 22 或更高版本。必须至少指定一个 --root 目录;只有加上 --allow-write 才会注册写入工具。可选限制:--max-file-size、--max-rows、--max-response-chars、--max-cells。无需账号、API 密钥或环境变量。
安装前请注意
写入工具(write_table、edit_cells、convert)仅在 --allow-write 下存在,可在根目录内创建或替换文件,替换需传入 overwrite 为 true。根目录内任意文件名都可被写入,包括 .gitignore 等点文件,因此要谨慎选择根目录。edit_cells 按原样写入公式,只有用表格软件打开文件时才会计算。工作簿中的文本作为数据返回,可能含有试图影响模型的文字;宏不会被执行,外部链接不会被访问。

安装

在 SourceWeft 中

  1. 打开 控制台中的 xlvane: XLSX workbooks,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@xlvane/mcp

An MCP (Model Context Protocol) server for XLSX files, built on xlvane and the official MCP TypeScript SDK (@modelcontextprotocol/server 2.4.0, protocol revision 2026-07-28). An MCP client, such as a coding agent, can inspect, read, compare and validate workbooks, and optionally write, edit and convert them, through tools instead of code.

Requires Node.js 22 or later. Dependencies: xlvane and @modelcontextprotocol/server (which brings @modelcontextprotocol/core and zod).

Start

sh
npx @xlvane/mcp --root ./data                 # read-only, files inside ./datanpx @xlvane/mcp --root ./data --allow-write   # also write_table, edit_cells, convertxlvane mcp --root ./data                      # the same server, through the xlvane CLI

Many MCP clients take a configuration like this one; check your client's documentation for its exact format and file:

json
{  "mcpServers": {    "xlvane": { "command": "npx", "args": ["@xlvane/mcp", "--root", "/absolute/path/to/data"] }  }}
OptionMeaning
--root <dir>A directory the tools may use; repeat for several. Required. Relative paths in tool calls are resolved against the first one.
--allow-writeAlso offer the tools that write files. Without it they are not registered at all.
--max-file-size <bytes>Largest file read or written. Default 64 MiB.
--max-rows <n>Largest number of rows one read_table call returns. Default 1000.
--max-response-chars <n>Largest tool result (also an error), in characters of its JSON text; the message carries the same data again as structuredContent. read_table returns the rows that fit (truncated, nextOffset); other tools return XLV_E_LIMIT_EXCEEDED. Default 1 Mi (1 048 576).
--max-cells <n>Largest number of cells in a workbook a tool reads (the maxCells read limit). Default 5 000 000. Lower it when the server must answer quickly: diff holds both workbooks in memory.

The server speaks MCP over stdin and stdout; messages for people go to stderr.

Tools

ToolWritesWhat it does
inspect_workbooknoSheets (also hidden ones), used ranges, header rows, column types with samples, merged cells, formulas, warnings.
read_tablenoRows of a sheet as objects keyed by the header row; paging with offset and limit; dates as ISO 8601.
diffnoCell-by-cell differences between two workbooks.
validatenoRead warnings, and column rules (name, type, optional) with the cell of each problem.
write_tableyesRows to a new XLSX file (report preset: bold header, frozen row, autofilter, widths).
edit_cellsyesSet cells and append rows, keeping the rest of the file unchanged.
convertyesXLSX to CSV/TSV/JSON and back; CSV output escapes formula-like text.

Every tool has a JSON Schema for its input and returns its result as structuredContent and as JSON text. Errors are tool results with isError: true and the XlvError data: a stable code, the location, a hint and details (docs/errors.md).

Security

  • Directories: files are read and written only inside the --root directories. Paths are checked after symbolic links are resolved, so .., absolute paths and links that lead outside are refused (XLV_E_PATH_NOT_ALLOWED). A file is checked again after it is opened (the path must still lead to the same file), so swapping it for a link meanwhile does not help. Writing through a symbolic link is refused. A path outside the roots gets the same answer whether or not something exists there, also when it is reached through a symbolic link inside a root. Only regular files are read. Messages on stderr show control characters as \uXXXX.
  • Read-only by default: the write tools exist only with --allow-write. They create files exclusively and replace an existing file only when the call passes "overwrite": true, through a temporary file and a rename; the replacement keeps the file's permission bits (not setuid, setgid or sticky), and read-only files are not replaced. edit_cells writes formulas as given (for example HYPERLINK(...)); they are calculated when a spreadsheet application opens the file. Any file name inside a root may be written, also dot files such as .gitignore; choose the roots accordingly.
  • Limits: files above --max-file-size are refused for reading and writing (convert to JSON stops building the text at that size), workbooks above --max-cells cells are refused, and results above --max-response-chars are cut (read_table) or refused. The official MCP SDK closes the connection after a message larger than 10 MiB. The xlvane reader applies its limits for untrusted files (ZIP bombs, XML without DTDs or entities, the budgets of xlvane 1.1.1). validate lists at most 1 000 problems (problemsTotal counts all).
  • File content is data: values, sheet names and other text come from the files and may contain any text, also text meant to influence a model. The server returns it as data and does not interpret it.
  • No code execution: macros are never run, external links are never followed, and formulas are not calculated.

API

ts
import { createServer, runCli } from '@xlvane/mcp';

createServer({ roots, allowWrite, maxFileBytes, maxRows, maxResponseChars, maxCells, cwd }) returns an McpServer to connect to any transport; runCli(args) is the command line.

Links

License: MIT. The MCP SDK is licensed under Apache-2.0.

来源:packages/mcp/README.md,提交 3a56eb8

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

4
  1. v1.3.3最新Nov 5, 2026
  2. v1.3.2Nov 4, 2026
  3. v1.3.0Nov 4, 2026
  4. v1.2.2Nov 3, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分