Sezzlee XML

io.github.sezzlee由 GitHub 账号 sezzlee 发布v0.5.1更新于 Oct 24, 2026

Query local XML documents with XPath, paged and sandboxed to one folder. Read-only.

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

概览

AI 生成的概览

一个本地、只读的 MCP 服务器,让助手在单个沙箱文件夹内列出、检查并用 XPath 和结构化投影查询 XML 文档。

可以做什么
列出指定根目录下可读取的 XML 文档,不进行解析;描述文档的根元素、命名空间和结构计数,并给出可供读取节点的地址。以扁平深度优先记录的形式读取文档树中有界、有序的片段。在文本节点、属性值或两者中搜索字面文本。执行单条 XPath 1.0 表达式并返回带类型的结果。把重复元素投影为行和命名列,并为每个单元格给出状态;按分组统计计数、去重计数,以及可选的求和与平均值。
适用场景
适合助手需要回答关于本地 XML、XSD、XHTML、SVG、项目或配置文件的问题,又不想把整份文档载入上下文时;也适合希望把这类访问限制在一个文件夹内并保持只读的场景。
运行要求
通过 npx 从 npm 包 @sezzlee/xml-mcp 以本地 stdio 进程运行。需要 Node.js 22 或 24,支持 macOS(x64、arm64)、glibc Linux(x64、arm64)或 Windows x64。XML 根文件夹的绝对路径作为唯一参数传入,没有对应的环境变量。仅限桌面端。
安装前请注意
只读且限定在给定根文件夹内,但助手可以读取其中任何可读的 XML 类文件,因此应把根目录指向范围较窄的目录。DOCTYPE 声明和不支持的编码会在解析前被拒绝。超过 8 MiB 上限的文档会切换到精简模式,此时 XPath、文本搜索和聚合不可用。内存占用是预算而非硬性限制,超大文档可能导致进程崩溃。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@sezzlee/xml-mcp

A read-only, sandboxed MCP server that reads local XML documents. It builds on @sezzlee/file-core; it does not depend on @sezzlee/core and imports nothing from packages/lab/xml-lab.

Documentation: https://docs.sezzlee.app/docs/xml-mcp/introduction — a tutorial, task guides, and the tool, error-code and limit reference generated from this package.

Quick start

The root is the only argument, as an absolute path; there is no environment variable for it.

json
{  "mcpServers": {    "xml": {      "command": "npx",      "args": ["-y", "@sezzlee/xml-mcp", "/path/to/xml/root"]    }  }}

With Claude Code:

bash
claude mcp add xml -- npx -y @sezzlee/xml-mcp /path/to/xml/root

Readable extensions: .xml, .xsd, .xhtml, .svg, .csproj, .props, .targets, .config, .resx. An extension like .config is not a guarantee of XML — a parse error there is expected behavior. Requires Node.js 22 or 24 on macOS (x64, arm64), glibc Linux (x64, arm64) or Windows x64.

Tools

ToolWhat it does
list_documentsLists readable XML documents under the root without parsing them
describe_documentDocument element, every namespace with a stable alias, structure counts, repeated-element candidates, and an address read_node takes
read_nodeA bounded, ordered slice of the tree as flat depth-first records
find_in_documentLiteral text in text nodes, attribute values or both
select_xpathOne XPath 1.0 expression, exactly as written, with a typed result
project_recordsA repeated element as rows and named columns, with a status per cell
aggregate_documentCounts, distinct counts and, with numericMode: binary64, sums and averages per group

Every argument, error code and limit is listed in the reference.

A document over the 8 MiB resident ceiling is read in a reduced-capability chunked mode: select_xpath, find_in_document and aggregate_document are unavailable there, while project_records still works.

Configuration

createXmlMcpServer(root, options) takes two optional settings; the CLI always uses the defaults.

OptionDefaultMeaning
documentCacheSize4Documents kept resident in memory at once (1–64)
maxConcurrentListings4Concurrent list_documents calls
ts
createXmlMcpServer(root, {  documentCacheSize: 4,  maxConcurrentListings: 4,});

documentCacheSize (S) is the single knob; the worker pool's capacity is derived as W = 2S, and the invariant W >= 2S-1 is pinned by a test — the worker keeps a document alive while the store still holds it, so its map must fit every store entry plus the one being adopted. This is a budget, not enforcement: worker.resourceLimits bounds the JS heap, not WASM linear memory, so exceeding the budget is a process crash rather than a clean resource_limit error. Measured cost is 9.25-10.08x the source byte count, so roughly 81 MiB resident per document at the 8 MiB ceiling; the default S=4 is safe on the smallest supported host.

Rules

Parsing happens in the worker. The main process only ever holds a serializable handle; a WASM pointer never crosses the boundary. No disposal hook was needed on @sezzlee/file-core's document store because of this.

Layout follows the worker/host boundary. engine/ is the worker-side graph and never names host/ or tools/; model/ and primitives/ are the shared vocabulary between the two sides. index.ts, cli.ts, xml-worker.ts and server.ts stay at the root — the tarball entry point, bin, the CI tarball check and the ../package.json read respectively tie them there.

The worker entry never imports the host surface. src/xml-worker.ts only sees node:worker_threads, node:buffer, libxml2-wasm and a type-only protocol; a lint rule enforces this. A worker returns a code string, and the host side constructs the error object.

DOCTYPE is refused before parsing. The prolog scanner runs in the main process; doc.dtd is only the second check. Measured: XML_PARSE_NO_XXE does not block the internal DTD subset.

The worker's stdout never mixes into the parent's fd 1. It is isolated with stdout: true; on stdio MCP, a single stray line breaks JSON-RPC.

diag is off in production and cannot be turned on through an environment variable: it costs 24.9% and its raw report carries an engine pointer.

Unsupported encodings are refused before parsing. The prolog scanner applies the XML 1.0 Appendix F four-byte autodetection; the UCS-4 and EBCDIC families get unsupported_encoding. Measured: the previous scanner missed DOCTYPE in these families.

libxml2-wasm is pinned to exact 0.7.2. A caret would silently invalidate the F0-01 integrity record; the CI tarball checker enforces this.

Development

bash
pnpm turbo run build --filter=@sezzlee/xml-mcppnpm turbo run test --filter=@sezzlee/xml-mcppnpm turbo run check-types --filter=@sezzlee/xml-mcp

Run tests through Turbo, not pnpm --filter @sezzlee/xml-mcp test: the bare filter skips dependsOn: ["^build"].

A change to a tool's arguments, an error code or a limit changes the generated reference in apps/docs; run pnpm --filter @sezzlee/docs gen and commit the result, or pnpm turbo run validate --filter=@sezzlee/docs fails.

Large-document tests are opt-in and skipped by default; set SEZZLEE_XML_LARGE=1 to run them.

来源:packages/servers/xml-mcp/README.md,提交 2614421

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.5.1最新Oct 11, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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