oxml-mcp 0.0.3

Model Context Protocol server exposing oxml's XML parsing, XPath and XSD validation
oxml-mcp-0.0.3 is not a library.
Visit the last successful build: oxml-mcp-0.0.9

Why a model wants this

An LLM asked to pull a value out of a large XML document otherwise has to read the whole thing into its context and pattern-match by eye. An XPath tool turns that into a question with an exact answer, and the document never has to fit in the context window.

Install

cargo install --git https://github.com/sebastienrousseau/oxml-mcp

Configure

{
  "mcpServers": {
    "oxml": {
      "command": "oxml-mcp"
    }
  }
}

Tools

Tool What it does
xml_query Evaluate an XPath 1.0 expression and return the matches
xml_validate Validate against an XSD; returns every violation with its path
xml_check Report whether a document is well-formed, with line and column
xml_inspect Summarise structure — element counts, depth, names present

xml_inspect exists because a model querying an unfamiliar document needs to know its shape before it can write a sensible XPath.

Protocol

JSON-RPC 2.0 over stdio, protocol version 2024-11-05.

$ echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | oxml-mcp
{"jsonrpc":"2.0","id":1,"result":{"tools":[...]}}

Design

JSON is read and written by a small module in this crate rather than a serialisation dependency. The messages are few and their shapes are fixed, and for a server meant to be audited that is a worthwhile trade.

Notifications — requests without an id — get no reply, because answering one is a protocol error rather than merely noise.

The oxml suite

Every member ships the same version number, so there is never a compatibility table to consult. Versions advance in 0.0.1 steps along the 0.0.x line; 0.1.0 follows 0.0.999.

Crate What it is
oxml Core — parser, tree, XPath 1.0
oxml-cli Command-line querying and validation
oxml-lsp Diagnostics for editors
oxml-mcp Model Context Protocol server
oxml-wasm WebAssembly bindings
xmlschema XSD validation

Contributing

See CONTRIBUTING.md. By participating you agree to the Code of Conduct.

License

Licensed under either of

at your option.