Expand description
oxml-mcp — a Model Context Protocol server for XML.
Five tools: query, validate, check, inspect, and format. The protocol is
handled by rmcp, the official MCP SDK; this crate supplies the
tools and the text a model reads.
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 needs to fit
in the context window.
The five operations are plain functions – query, validate,
check, inspect, format_xml – and XmlServer is the handler that
exposes them as MCP tools. Each answer is returned twice: as text
for the model, and as a structured value for a client that wants to
read it without parsing prose.
Structs§
- Check
Output - A well-formed document.
- Document
Args - Arguments of
xml_checkandxml_inspect. - Format
Args - Arguments of
xml_format. - Format
Output - What formatting a document produced.
- Inspect
Output - The shape of a document.
- Query
Args - Arguments of
xml_query. - Query
Output - What an
XPathexpression selected. - Validate
Args - Arguments of
xml_validate. - Validate
Output - The outcome of validating a document against a schema.
- Violation
- One schema violation.
- XmlServer
- The MCP server: the four tools over
rmcp.
Functions§
- check
- Check whether a document is well-formed.
- format_
xml - Format an XML document with configurable indentation and empty element style, or minify it.
- inspect
- Summarise a document’s structure.
- query
- Evaluate an
XPath1.0 expression against a document. - validate
- Validate a document against an XML Schema.