mcp-server

v7.10.2
@json-to-office/mcp-server Checked 9 hours ago Published 5 days ago

JSON to Office MCP server - author, validate, preview, diff and generate .docx and .pptx over stdio

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

jto_info Server info

Versions, supported formats with each renderer and whether its backend loads here, workspace availability and whether workspaces survive a lost connection, output-root and size limits, and whether the optional host dependencies (LibreOffice and poppler for jto_preview, a Highcharts export server for the DOCX `highcharts` component) are present on this host. Call this first.

ParameterTypeDescription
includePreviewDependenciesbooleanProbe the host for LibreOffice, poppler and the Highcharts export server. Default true.

jto_discover Discover the authoring surface

Formats, component names per format, renderer profiles and their ids, built-in themes, and starter documents you can copy and edit. Deliberately compact: no schemas. Call jto_describe_component for one component’s exact schema.

ParameterTypeDescription
formatstringOffice format to operate on.
includeStartersbooleanInclude the starter documents inline. Default true; they are a few hundred bytes each.

jto_describe_component Describe one component

The exact JSON Schema one component must satisfy under one renderer, plus the children it accepts, the containers that accept it, and which renderers support it. Nested components collapse to their names — describe those separately rather than reading one giant schema.

ParameterTypeDescription
format *stringOffice format to operate on.
name *stringComponent name, as listed by jto_discover (e.g. "paragraph", "slide").
expandPropsarrayProps to return in full even when oversized. Names come from a previous call’s `elided`.
rendererstringRenderer profile to describe the component under. Omit for the format default; profiles differ wherever a backend cannot draw something.

jto_scaffold Scaffold a document from a blueprint

The first move for a report: pick a blueprint from jto_discover (or jto://blueprints), name the theme and what you know of the brief, and get back a draft workspace — a handle at revision 1 — plus a fill map listing every `{{…}}` marker still owed: its JSON pointer, kind, budget and the guidance for filling it. The scaffold is schema- and semantic-valid, carries the block definitions it invokes, and names its quality profile, so jto_validate judges it against the archetype from the first call and reports the markers as advisory draft findings with `generationReady: false`; jto_generate r…

ParameterTypeDescription
blueprint *stringA blueprint id from jto_discover, e.g. "client-report", "technical-report" or "consulting-deck".
briefobjectFacts of the brief by name — title, subtitle, client, date, author, confidentiality, and to / from for a memo — written into the metadata field and the cover, running-head or memo-header slot of t…
formatstringDefaults to docx.
outlinestringA markdown outline. `# Title` fills the title (the brief’s title wins); each `## Heading` fills the next section opener in order; the paragraphs and bullets under it fill that section’s body text…
themestringA built-in theme name; the blueprint’s recommended one when omitted. Changes the look, never what validation asks.
titlestringYour own label for the workspace, echoed by jto_workspace_list; the brief’s title when omitted.
variantstringA variant id of that blueprint; the first when omitted.

jto_validate Validate a document

Check a document against its format schema and report every defect as a path-addressed diagnostic. Paths are RFC 6901 JSON Pointers into the document you passed, so they can be used directly as patch targets; codes are the stable `E_`/`W_` vocabulary. `ok` mirrors generation: schema and semantic errors block; design-quality `W_QUALITY_*` findings advise by default and block only when `quality.policy.gate` requests it. What the document points at is checked too: a `props.theme` that names no theme (`W_UNKNOWN_THEME`) and an image file that cannot be read (`E_ASSET_UNREADABLE`), with relative pa…

ParameterTypeDescription
format *stringOffice format to operate on.
baseDirstringDirectory relative image paths resolve against when checking that the files exist — pass the `baseDir` you will generate with. Omit to resolve against the server working directory, as generation doe…
documentobjectThe document JSON, inline. Mutually exclusive with `handle`. This is the portable baseline: it needs no prior state.
handlestringOpaque handle of an open workspace document (from jto_workspace_create). Mutually exclusive with `document`.
includeCompiledbooleanAlso return `compiled`: the document with every block lowered in place, the authored pointers of those blocks, and a source map from each compiled pointer to the slot it came from. Diagnostics already…
maxDiagnosticsintegerCap on returned diagnostics (default 100). Errors are kept ahead of warnings when the cap bites.
qualityobjectOptional design profile plus per-run enforcement policy. `jto_validate` judges by them; `jto_preview` applies the same pair to its rendered pass when `renderedFindings` is set.
rendererstringRenderer profile to validate against. Overrides the document's own `renderer` for this check only; omit to validate the document exactly as written.
revisionintegerRevision the caller believes `handle` is at. When given and stale, the call fails instead of silently operating on newer JSON.

jto_generate Generate a document

Render a document to a real .docx or .pptx. The file is written under the server output root and returned as a path; pass `outputMode: "base64"` only for small artifacts. A document that fails the generation gate comes back with `ok: false` and the same path-addressed diagnostics jto_validate reports, never as an error — an image that cannot be read included, as `E_ASSET_UNREADABLE` at its path (a URL, or a path fed through a block slot, carries no pointer; `context.source` names what the render tried). An unfilled scaffold slot (`{{…}}`) is always refused here even though jto_validate let…

ParameterTypeDescription
format *stringOffice format to operate on.
baseDirstringDirectory that relative asset paths in the document resolve against.
deterministicbooleanStrip nondeterministic metadata (timestamps, ids) so identical JSON yields byte-identical output.
documentobjectThe document JSON, inline. Mutually exclusive with `handle`. This is the portable baseline: it needs no prior state.
filenamestringFile name for the artifact, relative to the output root. Must not escape it: no absolute paths, no `..`.
fontsobjectFont resolution for this render.
generatedAtstringISO 8601 instant to stamp instead of "now"; pairs with `deterministic`.
handlestringOpaque handle of an open workspace document (from jto_workspace_create). Mutually exclusive with `document`.
maxDiagnosticsintegerCap on returned diagnostics (default 100). Repeats of one defect collapse into the first, which then carries `context.occurrences`; errors are kept ahead of warnings when the cap still bites.
outputModestring`path` (default) writes under the server output root and returns the path. `base64` inlines the bytes and is refused — never silently downgraded — above the inline size limit (see jto_info.output.…
rendererstringRenderer id for this format (see jto_info.formats[].rendererIds). Omit for the format default.
revisionintegerRevision the caller believes `handle` is at. When given and stale, the call fails instead of silently operating on newer JSON.
themestringBuilt-in or custom theme name. Omit to keep each document's own `props.theme`.
themePathstringPath to a data-only JSON theme file, resolved against `baseDir` (or the server working directory when `baseDir` is omitted). Executable theme modules are not accepted over MCP.
validationobjectOverrides for the pre-render validation gate.

jto_preview Preview pages

Render a document to PNG pages and look at them. Use this whenever the question is visual — did the table overflow, did the title wrap, is the slide crowded — rather than reasoning about the JSON. Pages are selected with printer syntax, 1-based and inclusive: "all" (default), "3", "2-5", "4-" (to the end), "-3" (from the start), or a comma-separated mix like "1-3,7". At most 50 pages per call. Set renderedFindings: true to also run the rendered-certainty pass over the PDF LibreOffice produced: text past the page edge or its frame, words drawn over each other, authored text that never ren…

ParameterTypeDescription
format *stringOffice format to operate on.
baseDirstringDirectory that relative asset paths in the document resolve against.
contactSheetbooleanReturn one labelled image tiling every selected page instead of the pages themselves. Cross-page consistency — rhythm, alignment, chrome — becomes a single look. Renders at 72 DPI unless `dpi` say…
deterministicbooleanStrip nondeterministic metadata (timestamps, ids) so identical JSON yields byte-identical output.
documentobjectThe document JSON, inline. Mutually exclusive with `handle`. This is the portable baseline: it needs no prior state.
dpiintegerRendering resolution. 150 is legible without being wasteful; higher costs bytes quadratically and usually forces path delivery.
filenamePrefixstringBase name for written PNGs, relative to the output root; each page becomes `<prefix>-pNNN.png`, and a contact sheet becomes `<prefix>-sheet.png`. Must not escape the root.
generatedAtstringISO 8601 instant to stamp instead of "now"; pairs with `deterministic`.
handlestringOpaque handle of an open workspace document (from jto_workspace_create). Mutually exclusive with `document`.
maxDiagnosticsintegerCap on returned diagnostics (default 100). Repeats of one defect collapse into the first, which then carries `context.occurrences`; errors are kept ahead of warnings when the cap still bites.
outputModestring`auto` (default) inlines images when they fit the budget and writes files otherwise. `images` refuses instead of falling back. `path` always writes files under the output root.
pagesstringPages to render, 1-based and inclusive: "all", "3", "2-5", "4-", "-3", or "1-3,7". Defaults to "all".
qualityobjectOptional design profile plus per-run enforcement policy. `jto_validate` judges by them; `jto_preview` applies the same pair to its rendered pass when `renderedFindings` is set.
renderedFindingsbooleanRun the rendered-certainty pass over the converted PDF and return its findings in `diagnostics` (certainty "rendered") with a `rendered` summary. Needs poppler’s pdftotext; pdffonts adds the font ch…
rendererstringRenderer id for this format (see jto_info.formats[].rendererIds). Omit for the format default.
revisionintegerRevision the caller believes `handle` is at. When given and stale, the call fails instead of silently operating on newer JSON.
themestringBuilt-in or custom theme name. Omit to keep each document's own `props.theme`.
themePathstringPath to a data-only JSON theme file, resolved against `baseDir` (or the server working directory when `baseDir` is omitted). Executable theme modules are not accepted over MCP.

jto_critique Inspect a draft, then record the verdict

Review a workspace document the way a person would, and keep the score honestly. `action: "inspect"` renders the workspace at its current revision (or the `revision` you name), and returns: one contact sheet tiling every page, up to 4 full-resolution pages chosen where the rendered pass found something, that pass's findings as diagnostics with certainty "rendered", the rubric as data, and a run id. Look at the images — that is the point of the call — and judge the document against the rubric's five levels and its shipping question. `action: "record"` files that judgement: the `runId` you…

ParameterTypeDescription
action *string`inspect` renders and returns evidence and a run id; `record` files the verdict formed against one.
handle *stringThe workspace being reviewed. Critique is keyed to a workspace revision, so an inline document cannot be critiqued — open one with jto_scaffold or jto_workspace_create.
acceptarrayrecord, ship only: the integrity findings of the inspection you judge wrong about this document, each with why. Matched the way a quality policy suppression is — by `code`, `ruleId` or `path` — an…
evidencePagesintegerinspect: full-resolution pages to inline beside the sheet. Defaults to 4; 0 returns the sheet alone. Every page is written to the output root either way.
formatstringThe workspace’s own when omitted.
levelintegerrecord: the highest rubric level met, with every level below it met. Optional.
maxDiagnosticsintegerCap on returned diagnostics (default 100). Repeats of one defect collapse into the first, which then carries `context.occurrences`; errors are kept ahead of warnings when the cap still bites.
rationalestringrecord: two or three sentences naming the page and the element that decided it, not "the layout".
revisionintegerinspect: the revision to render, current when omitted. record: the revision judged, checked against the run’s.
runIdstringrecord: the run id the inspection returned.
verdictstringrecord: whether you would send this document as it stands.

jto_docx_diff Diff two documents into a Word redline

Compare two DOCX document definitions and produce a redline .docx that opens in Word with native tracked changes, plus a structured summary of what changed. DOCX only. Changes with no native Word revision (tables, images, charts) are reported under `summary.untracked` — read it, because they are invisible as revisions in the file itself. Pass `dryRun: true` for the summary without rendering.

ParameterTypeDescription
after *objectThe revised document: the document JSON itself, or a source wrapper — `{"document": <json>}` or `{"handle": "ws_..."}`.
before *objectThe base document: the document JSON itself, or a source wrapper — `{"document": <json>}` or `{"handle": "ws_..."}`.
authorstringRevision author shown in Word (default "json-to-office").
baseDirstringDirectory that relative asset paths in the document resolve against.
datestringRevision timestamp, ISO 8601. Omit for a deterministic redline: two runs over the same pair then produce the same bytes.
deterministicbooleanStrip nondeterministic metadata (timestamps, ids) so identical JSON yields byte-identical output.
dryRunbooleanCompute the diff and summary without rendering or writing the redline.
filenamestringFile name for the artifact, relative to the output root. Must not escape it: no absolute paths, no `..`.
generatedAtstringISO 8601 instant to stamp instead of "now"; pairs with `deterministic`.
includeRedlineDocumentbooleanAlso return the redline document JSON, so it can be edited before rendering.
outputModestring`path` (default) writes under the server output root and returns the path. `base64` inlines the bytes and is refused — never silently downgraded — above the inline size limit (see jto_info.output.…
rendererstringRenderer id for this format (see jto_info.formats[].rendererIds). Omit for the format default.
themestringBuilt-in or custom theme name. Omit to keep each document's own `props.theme`.
themePathstringPath to a data-only JSON theme file, resolved against `baseDir` (or the server working directory when `baseDir` is omitted). Executable theme modules are not accepted over MCP.

jto_workspace_create Open a document workspace

Hold a document on the server so later calls can name it by `handle` instead of resending the JSON. Returns the handle and revision 1. Omit `document` to start from an empty skeleton and patch content in. Nothing is validated here — call jto_validate when you want it.

ParameterTypeDescription
format *stringOffice format to operate on.
documentobjectThe initial document JSON. Omitted, the workspace opens on an empty skeleton for this format.
titlestringYour own label for the workspace, echoed back by jto_workspace_list. Never read by the renderer.

jto_workspace_inspect Read a workspace document

Read an open document, or — with `paths` — only the JSON Pointers you name, which is the point of a workspace on anything large. Pointers that resolve nowhere come back in `missingPaths` rather than as null, so "absent" stays distinguishable from "present and null".

ParameterTypeDescription
handle *string
includeBlocksbooleanReturn definitions, derived slot schemas and invocation fill pointers from this workspace revision; excludes catalog references.
includeDocumentbooleanReturn the whole document alongside a projection. Default false when `paths` is given, true when it is not.
pathsarrayProject only these locations. Omit to read the whole document.
revisionintegerRead this exact revision: the current one, or one pinned by jto_workspace_snapshot. Anything else fails rather than quietly returning newer JSON.

jto_workspace_patch Patch a workspace document

Apply an RFC 6902 patch atomically: the whole patch is checked, applied to a copy, and committed only if every operation lands — a failure leaves the document exactly as it was and does not burn a revision. Pass `baseRevision` to make the write conditional on the document not having moved. Invalid intermediate states are kept on purpose; validate when you are ready.

ParameterTypeDescription
handle *string
operations *arrayRFC 6902 operations, applied in order.
baseRevisionintegerRevision you built this patch against. When it no longer matches, the write fails with E_STALE_REVISION and nothing is applied.

jto_workspace_snapshot Snapshot a workspace document

Export the authoritative JSON and pin the revision it was taken at, so jto_workspace_inspect can still read that exact tree after later patches. Take one before a restructuring you could not cleanly undo. With `filename` the JSON is written under the server output root and returned as a path instead of inline.

ParameterTypeDescription
handle *string
filenamestringWrite the snapshot here, relative to the output root, instead of returning it inline. Must not escape the root: no absolute paths, no "..".

jto_workspace_list List open workspaces

Every document open on this connection, with its revision and size. Call this to recover handles you no longer have — it is the cheapest way back after losing track of what you opened, including after a reconnect when the server has a workspace directory. An empty list means nothing is open, not that anything failed.

jto_workspace_close Close a workspace

Release a handle and everything behind it — the document, its pinned snapshots, and the durable copy when this connection keeps one. Idempotent: closing a handle that is already gone reports `closed: false` rather than failing. Snapshot anything you still want first — closing is not recoverable.

ParameterTypeDescription
handle *string