Motivation in genspark-ai/genoffice#338: agents asked to produce Word
documents today write python-docx or drive Office over COM. GenOffice
already ships a correct, fast docx engine, but only its in-app AI panel
can reach it. This exposes that capability to Claude Desktop, Cursor and
any MCP client.
The server lives in the shell main process, is off by default, binds
127.0.0.1 only and validates Host/Origin (it has no authentication).
Settings > General gets an enable switch, port, log toggle and a
capability summary.
Two things MCP adds beyond the existing genoffice CLI, one per the
maintainer's reply in #338:
- driving the editor the user has open: create_session opens a real docs
tab and the content tools push editor commands through a renderer
bridge, so the user watches each step instead of writing bytes behind
the UI;
- reaching clients that cannot run a shell: plus a legacy SSE transport
and a stdio bridge for clients that only speak stdio.
Headless generation and reading (create_docx / read_docx) delegate to the
bundled genoffice CLI rather than reimplementing conversion, so there is
one engine, not two.
Checked: npm run typecheck, npm run lint, npm run licenses, npm run
check:english-comments, npm run fixtures; apps/shell/tests/mcp plus
settings-mcp (71 tests) and the mcp-visible-doc e2e spec.
staysVanished missed none, case variants, and single quotes, hiding visible paragraphs.
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
* fix(ai-provider): match vision guard case-insensitively
Uppercase DeepSeek ids bypassed the text-only guard and sent images to a text-only model.
* fix(ai-provider): prettier format vision guard
---------
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
TOKEN_RE only matched double-quoted fldCharType, so single-quoted fields unbalanced on save.
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
Add trailing boundary so o10/o30/gpt-50 do not omit temperature. Guard opencode route against undefined model.
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
B4/B5/Folio/Statement and other ECMA-376 codes fell back to A4, mis-scaling print output. Add explicit inch mappings.
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
Inline a:tab between runs was dropped, collapsing tab-separated columns to joined text. Emit tab character to preserve extraction fidelity.
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
TOC_LINE_RE already handles underscores but hasDotLeaderRun only accepted dot and middle-dot, so underscore index pages never triggered leaderIndexPage path. Include underscore to match.
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
sdtCheckboxGlyphs only matched double-quoted w14:val, falling back to default glyphs for single-quoted producers.
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
Some producers emit single-quoted XML attributes. edit/enforcement already handled both quote styles, but hash/salt/spin/sid and recommended only matched double quotes, dropping credentials and weakening protection verification.
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
spawnSync('npm') without a shell fails with ENOENT on Windows because npm is npm.cmd, not npm.exe. The root dev script also used Unix VAR=value prefixes, which cmd.exe rejects.
Use shell: true when spawning npm on Windows, and set renderer URLs with cross-env.
Clicking a single cell inside a continuous data block and choosing
Insert -> Table (Format as Table) now expands the selection to the
surrounding CurrentRegion, matching Excel. The helper scans outward
from the anchor while edge cells have values, bounded by the used
range, and requires at least header plus one data row.
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
* fix(docx): handle numeric char refs, NBSP edges and empty self-closing runs in field patch
* fix(docx): correct NBSP test expectation for trimmed fieldDisplay
* fix(docx): guard char-ref codepoints and assert NBSP on patched XML only
- decodeXmlText leaves out-of-range (>0x10FFFF) and surrogate (0xD800-0xDFFF) refs untouched instead of throwing RangeError; regression test covers �, � and surrogates.
NBSP edge test now asserts patched XML only (xml:space preserve + NBSP in <w:t>), dropping the fieldDisplay round-trip which normalizes edge whitespace regardless of xml:space.
---------
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>