You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
che-word-mcp exposes ~218 OOXML editing tools over MCP stdio JSON-RPC. Two real-world workflows have hit the limits of going through the MCP transport:
Replicable docx-edit pipelines — running the same edit plan against different docx baselines (e.g. template-population, content backfill, batch caption fix-ups) currently means either:
Manually re-driving 30+ MCP calls per run (lossy, error-prone), or
Writing one-off Python/Bash scripts that wrap MCP stdio (fragile, JSON-escape pain especially for CJK anchor text).
che-word-mcp integration testing — RealWorldDocxRoundTripSmokeTests covers open → save round-trip but not edit-path tests with non-trivial sequences (insert+replace+insert with anchors). A scriptable surface that drives the same ooxml-swift API che-word-mcp uses would let us assert end-to-end behaviour declaratively.
Both share the same need: a declarative way to describe a docx edit plan and execute it against ooxml-swift directly (no MCP transport overhead, no JSON escaping). MCP and this CLI become two front-ends on the same library.
Type
feature
Proposal
A new CLI + library inside macdoc/, sibling to mcp/che-word-mcp/:
Why this lives in macdoc/ rather than a separate repo
Same SPM dep graph as che-word-mcp (both depend on ooxml-swift)
CLI changes often co-evolve with ooxml-swift API changes — atomic commits possible
che-word-mcp integration tests can shell out to dxedit for declarative E2E coverage
Workspace-style monorepo already established (macdoc/mcp/, macdoc/lib/, etc.)
A separate repo can be extracted later if the CLI grows beyond docx (e.g. unified dxedit / pxedit / pptedit toolkit), following the same pattern as #78 (NoteCore extraction) and #79 (pdf-to-latex-swift extraction).
Use cases
Template population — given a docx template with anchor markers, populate with structured content from a manifest.
Batch fix-up — apply caption format normalization across many docx files.
Reproducible workflows — a docx-edit pipeline checked into a project repo (scripts/edit/manifest.yaml + dxedit apply) is replayable and version-controlled.
che-word-mcp integration tests — declarative assertions about edit-path behaviour that supplement the existing round-trip XCTest suite.
Manifest format choice (YAML vs JSON): leaning YAML for CJK anchor readability; JSON has stricter parsing but worse for human-edited multi-line strings. Open for discussion.
Priority
P2 — useful for downstream replicable workflows; not blocking any current work.
Related
PsychQuant/che-word-mcp — same ooxml-swift dep, alternate MCP front-end
Problem
che-word-mcpexposes ~218 OOXML editing tools over MCP stdio JSON-RPC. Two real-world workflows have hit the limits of going through the MCP transport:che-word-mcpintegration testing —RealWorldDocxRoundTripSmokeTestscoversopen → saveround-trip but not edit-path tests with non-trivial sequences (insert+replace+insert with anchors). A scriptable surface that drives the sameooxml-swiftAPI che-word-mcp uses would let us assert end-to-end behaviour declaratively.Both share the same need: a declarative way to describe a docx edit plan and execute it against
ooxml-swiftdirectly (no MCP transport overhead, no JSON escaping). MCP and this CLI become two front-ends on the same library.Type
feature
Proposal
A new CLI + library inside
macdoc/, sibling tomcp/che-word-mcp/:CLI surface
Manifest sketch
Why this lives in
macdoc/rather than a separate repoche-word-mcp(both depend onooxml-swift)ooxml-swiftAPI changes — atomic commits possibleche-word-mcpintegration tests can shell out todxeditfor declarative E2E coveragemacdoc/mcp/,macdoc/lib/, etc.)A separate repo can be extracted later if the CLI grows beyond docx (e.g. unified
dxedit / pxedit / pptedittoolkit), following the same pattern as #78 (NoteCoreextraction) and #79 (pdf-to-latex-swiftextraction).Use cases
scripts/edit/manifest.yaml+dxedit apply) is replayable and version-controlled.che-word-mcpintegration tests — declarative assertions about edit-path behaviour that supplement the existing round-trip XCTest suite.Implementation phases
applycommand, supportsinsert_image,replace_text,replace_text_batch,insert_paragraphsteps. YAML manifest. SPM library target.verifycommand with post-condition harness (libxml2 validity, byte-preservation checks, content presence).plan(dry-run),diff(using ooxml-swift compare),archive-firstintegration (auto-snapshot baseline before mutating writes).ooxml-swiftAPI matures —insert_equation,wrap_caption_seq(depends on P2: helper to wrap plain-text captions in SEQ field for downstream TOF/TOT generation che-word-mcp#62), section/header/footer manipulation.Caveats
ooxml-swifttext-anchor support being uniform across all step types. P2: insert_paragraph / insert_equation lack after_text/before_text anchors — paragraph_index alone unreliable in real-world docx che-word-mcp#61 tracks the gap whereinsert_paragraph/insert_equationlackafter_text/before_textanchors thatinsert_image_from_pathalready has. Phase 1 ofdxeditmay have to ship withparagraph_indexonly for those step types until feat: add --full and --css flags to SRT→HTML and MD→HTML output #61 is resolved.Priority
P2 — useful for downstream replicable workflows; not blocking any current work.
Related
ooxml-swiftdep, alternate MCP front-enddxedit verify)insert_paragraph/insert_equation— affectsdxeditstep type completeness)dxeditstep type once available)dxeditcould be extracted similarly later)dxeditis the "reader" half of that pipeline)Current Status
Phase: diagnosed / Spectra proposal ready
Last updated: 2026-05-02 by Codex
Key Decisions
macdoc docx ...subcommands, not a standalonedxeditbinary.build,patch, andapplyworkflows under one command namespace, plusplan,verify, anddiff.DocxWorkflowLibowns manifest decoding, planning, execution, verification, and diff;MacDocCLIstays thin.Spectra Proposal
macdoc-docx-workflow-cliopenspec/changes/macdoc-docx-workflow-cli/proposal.md,design.md,tasks.md, andspecs/docx-workflow-cli/spec.mdspectra analyze macdoc-docx-workflow-cli --json,spectra validate macdoc-docx-workflow-cli, andgit diff --check -- openspec/changes/macdoc-docx-workflow-cliBlocking
/spectra-apply macdoc-docx-workflow-cli.H₀.Commits