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 分