dcc-mcp-word 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dcc_mcp_word-0.1.2/.github/workflows/ci.yml +57 -0
- dcc_mcp_word-0.1.2/.github/workflows/release.yml +97 -0
- dcc_mcp_word-0.1.2/.gitignore +10 -0
- dcc_mcp_word-0.1.2/.release-please-manifest.json +3 -0
- dcc_mcp_word-0.1.2/AGENTS.md +86 -0
- dcc_mcp_word-0.1.2/CHANGELOG.md +21 -0
- dcc_mcp_word-0.1.2/LICENSE +21 -0
- dcc_mcp_word-0.1.2/PKG-INFO +169 -0
- dcc_mcp_word-0.1.2/README.md +134 -0
- dcc_mcp_word-0.1.2/examples/call-sheet.docx +0 -0
- dcc_mcp_word-0.1.2/examples/call-sheet.json +22 -0
- dcc_mcp_word-0.1.2/examples/com-verification.json +35 -0
- dcc_mcp_word-0.1.2/pyproject.toml +62 -0
- dcc_mcp_word-0.1.2/release-please-config.json +15 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/__init__.py +48 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/_standalone_entry.py +106 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/capabilities.py +166 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/compiler.py +294 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/host_client.py +188 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/host_matrix.py +112 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/readback.py +204 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/server_launcher.py +88 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/skills/word-capabilities/SKILL.md +73 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/skills/word-capabilities/scripts/capabilities.py +45 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/skills/word-capabilities/scripts/preflight.py +38 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/skills/word-capabilities/tools.yaml +39 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/skills/word-document/SKILL.md +118 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/skills/word-document/scripts/generate_document.py +112 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/skills/word-document/scripts/inspect_document.py +102 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/skills/word-document/scripts/validate_document.py +79 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/skills/word-document/tools.yaml +81 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/validate.py +100 -0
- dcc_mcp_word-0.1.2/src/dcc_mcp_word/word_ir.py +441 -0
- dcc_mcp_word-0.1.2/tests/conftest.py +28 -0
- dcc_mcp_word-0.1.2/tests/test_capabilities.py +85 -0
- dcc_mcp_word-0.1.2/tests/test_compiler.py +183 -0
- dcc_mcp_word-0.1.2/tests/test_e2e.py +123 -0
- dcc_mcp_word-0.1.2/tests/test_host_client.py +101 -0
- dcc_mcp_word-0.1.2/tests/test_host_matrix.py +63 -0
- dcc_mcp_word-0.1.2/tests/test_readback.py +146 -0
- dcc_mcp_word-0.1.2/tests/test_runtime_purity.py +34 -0
- dcc_mcp_word-0.1.2/tests/test_skill_scripts.py +132 -0
- dcc_mcp_word-0.1.2/tests/test_version.py +40 -0
- dcc_mcp_word-0.1.2/tests/test_word_ir.py +147 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
python:
|
|
13
|
+
# Headless by design: the DOCX compile + read-back gate must prove it does
|
|
14
|
+
# NOT depend on a desktop Word installation, so it runs on Linux.
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
python-version: ["3.9", "3.11", "3.12"]
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python-version }}
|
|
25
|
+
- name: Install
|
|
26
|
+
run: python -m pip install -e ".[dev]"
|
|
27
|
+
- name: Ruff
|
|
28
|
+
run: ruff check src tests
|
|
29
|
+
- name: Pytest
|
|
30
|
+
run: pytest -q
|
|
31
|
+
|
|
32
|
+
packaging:
|
|
33
|
+
# Windows-only: dcc-mcp-cli ships as a Windows binary through the
|
|
34
|
+
# dcc-mcp-core release train (not pip), and there is no Linux build to
|
|
35
|
+
# fall back on. The headless gate above already covers the Office-free
|
|
36
|
+
# path, so Windows here adds coverage rather than gating on it.
|
|
37
|
+
runs-on: windows-latest
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v4
|
|
40
|
+
- uses: actions/setup-python@v5
|
|
41
|
+
with:
|
|
42
|
+
python-version: "3.12"
|
|
43
|
+
- name: Install
|
|
44
|
+
run: python -m pip install -e ".[dev]"
|
|
45
|
+
- name: Build wheel from sdist
|
|
46
|
+
run: python -m build
|
|
47
|
+
- name: CLI smoke (version + preflight must work on a clean install)
|
|
48
|
+
shell: pwsh
|
|
49
|
+
run: |
|
|
50
|
+
python -m dcc_mcp_word._standalone_entry --version
|
|
51
|
+
python -m dcc_mcp_word._standalone_entry preflight
|
|
52
|
+
- name: Skill lint (official dcc-mcp-cli validator)
|
|
53
|
+
shell: pwsh
|
|
54
|
+
run: |
|
|
55
|
+
# dcc-mcp-cli ships through the dcc-mcp-core release train, not pip.
|
|
56
|
+
Invoke-WebRequest -Uri "https://github.com/dcc-mcp/dcc-mcp-core/releases/download/v0.20.6/dcc-mcp-cli-windows-x86_64.exe" -OutFile "$env:RUNNER_TEMP\dcc-mcp-cli.exe"
|
|
57
|
+
& "$env:RUNNER_TEMP\dcc-mcp-cli.exe" lint src/dcc_mcp_word/skills --warnings-as-errors --non-interactive
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Automated releases via release-please (conventional commits), mirroring
|
|
4
|
+
# dcc-mcp-office's release flow.
|
|
5
|
+
#
|
|
6
|
+
# Every push to main runs release-please, which keeps a release PR up to date.
|
|
7
|
+
# When that PR is merged, release-please creates the GitHub release and tag;
|
|
8
|
+
# this workflow publishes the wheel to PyPI from that exact tag after
|
|
9
|
+
# verifying the tag, the manifest and pyproject.toml agree on one version.
|
|
10
|
+
#
|
|
11
|
+
# No standalone binary job on purpose: dcc-mcp-word is a headless,
|
|
12
|
+
# Office-free adapter (ADR 004) and ships the same wheel to every platform.
|
|
13
|
+
# The PyOxidizer bundle in dcc-mcp-powerpoint exists to carry the Windows-only
|
|
14
|
+
# C# COM host; nothing here needs it.
|
|
15
|
+
|
|
16
|
+
on:
|
|
17
|
+
push:
|
|
18
|
+
branches: [main]
|
|
19
|
+
|
|
20
|
+
permissions:
|
|
21
|
+
contents: write
|
|
22
|
+
pull-requests: write
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
release-please:
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
outputs:
|
|
28
|
+
release_created: ${{ steps.release.outputs.release_created }}
|
|
29
|
+
tag_name: ${{ steps.release.outputs.tag_name }}
|
|
30
|
+
steps:
|
|
31
|
+
- uses: googleapis/release-please-action@v4
|
|
32
|
+
id: release
|
|
33
|
+
with:
|
|
34
|
+
# A PAT (user-owned) is required: PRs opened with the default
|
|
35
|
+
# GITHUB_TOKEN do not trigger pull_request workflows, so CI would
|
|
36
|
+
# never run on release PRs.
|
|
37
|
+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
|
38
|
+
config-file: release-please-config.json
|
|
39
|
+
manifest-file: .release-please-manifest.json
|
|
40
|
+
|
|
41
|
+
publish-pypi:
|
|
42
|
+
name: Publish to PyPI
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
needs: [release-please]
|
|
45
|
+
if: needs.release-please.outputs.release_created == 'true'
|
|
46
|
+
environment:
|
|
47
|
+
name: pypi
|
|
48
|
+
url: https://pypi.org/p/dcc-mcp-word
|
|
49
|
+
permissions:
|
|
50
|
+
contents: read
|
|
51
|
+
id-token: write
|
|
52
|
+
env:
|
|
53
|
+
RELEASE_TAG: ${{ needs.release-please.outputs.tag_name }}
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@v4
|
|
56
|
+
with:
|
|
57
|
+
ref: ${{ needs.release-please.outputs.tag_name }}
|
|
58
|
+
fetch-depth: 0
|
|
59
|
+
persist-credentials: false
|
|
60
|
+
- name: Verify release identity and version
|
|
61
|
+
env:
|
|
62
|
+
EXPECTED_VERSION: ${{ needs.release-please.outputs.tag_name }}
|
|
63
|
+
shell: bash
|
|
64
|
+
run: |
|
|
65
|
+
set -euo pipefail
|
|
66
|
+
[[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || {
|
|
67
|
+
echo "Release target must be a canonical vMAJOR.MINOR.PATCH tag." >&2
|
|
68
|
+
exit 1
|
|
69
|
+
}
|
|
70
|
+
export EXPECTED_VERSION="${RELEASE_TAG#v}"
|
|
71
|
+
python - <<'PY'
|
|
72
|
+
import json
|
|
73
|
+
import os
|
|
74
|
+
import re
|
|
75
|
+
from pathlib import Path
|
|
76
|
+
|
|
77
|
+
expected = os.environ["EXPECTED_VERSION"]
|
|
78
|
+
manifest = json.loads(Path(".release-please-manifest.json").read_text(encoding="utf-8"))["."]
|
|
79
|
+
source = Path("pyproject.toml").read_text(encoding="utf-8")
|
|
80
|
+
match = re.search(r'^version = "([0-9]+\.[0-9]+\.[0-9]+)"', source, re.MULTILINE)
|
|
81
|
+
if match is None or manifest != expected or match.group(1) != expected:
|
|
82
|
+
raise SystemExit("Checked-out package version does not match the release target.")
|
|
83
|
+
PY
|
|
84
|
+
|
|
85
|
+
- uses: actions/setup-python@v5
|
|
86
|
+
with:
|
|
87
|
+
python-version: "3.12"
|
|
88
|
+
- name: Build package
|
|
89
|
+
run: |
|
|
90
|
+
python -m pip install --upgrade pip build twine
|
|
91
|
+
python -m build
|
|
92
|
+
python -m twine check dist/*
|
|
93
|
+
- name: Publish to PyPI with trusted publishing
|
|
94
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
95
|
+
with:
|
|
96
|
+
verbose: true
|
|
97
|
+
print-hash: true
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# AGENTS.md — dcc-mcp-word
|
|
2
|
+
|
|
3
|
+
> Progressive disclosure: this file is a **map**, not an encyclopedia.
|
|
4
|
+
|
|
5
|
+
## 30-Second Summary
|
|
6
|
+
|
|
7
|
+
`dcc-mcp-word` is the **thin Word adapter** over `dcc-mcp-office`. It owns
|
|
8
|
+
Word application semantics only: the Word IR contract, the headless DOCX
|
|
9
|
+
compile + read-back path, capability grading and the office-host launcher.
|
|
10
|
+
Shared machinery (protocol, IR envelope, C# COM runtime, jobs, security
|
|
11
|
+
policy) comes from `dcc-mcp-office` + `dcc-mcp-core`.
|
|
12
|
+
|
|
13
|
+
**Current status:** v0.1.0 — headless path live. Word IR → Open XML compile →
|
|
14
|
+
read-back verification runs end to end with **no Word installation**, and the
|
|
15
|
+
gate runs headless in CI. Field/TOC refresh, document reflow and
|
|
16
|
+
track-changes inspection are `host_limited`: declared, graded, and never
|
|
17
|
+
claimed as verified.
|
|
18
|
+
|
|
19
|
+
## Repo Map
|
|
20
|
+
|
|
21
|
+
| Path | What it is |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `src/dcc_mcp_word/word_ir.py` | Word IR contract (mirrors dcc-mcp-office-ir `pub mod word`) |
|
|
24
|
+
| `src/dcc_mcp_word/compiler.py` | headless Open XML compiler: Word IR → DOCX (python-docx) |
|
|
25
|
+
| `src/dcc_mcp_word/readback.py` | write-then-read-back verification (the 1.0 gate) |
|
|
26
|
+
| `src/dcc_mcp_word/capabilities.py` | verified / host_limited / unimplemented grading |
|
|
27
|
+
| `src/dcc_mcp_word/host_matrix.py` | host matrix + preflight self-check |
|
|
28
|
+
| `src/dcc_mcp_word/validate.py` | structural validation reports (stdlib-only) |
|
|
29
|
+
| `src/dcc_mcp_word/host_client.py` | stdlib-only JSON-RPC client for the shared office host |
|
|
30
|
+
| `src/dcc_mcp_word/server_launcher.py` | registers the bundled skills with `dcc-mcp-server` |
|
|
31
|
+
| `src/dcc_mcp_word/skills/word-document/` | SKILL.md + tools.yaml + scripts (generate/validate/inspect) |
|
|
32
|
+
| `src/dcc_mcp_word/skills/word-capabilities/` | capability report + preflight scripts |
|
|
33
|
+
| `examples/` | call-sheet Word IR + generated DOCX + COM verification |
|
|
34
|
+
| `tests/` | pytest (headless; COM only via subprocess boundary) |
|
|
35
|
+
|
|
36
|
+
## Upstream Dependencies
|
|
37
|
+
|
|
38
|
+
- `dcc-mcp-core` (pip) — gateway, skills runtime, sidecar lifecycle.
|
|
39
|
+
- `dcc-mcp-office` — Rust crates (`dcc-mcp-office-protocol`,
|
|
40
|
+
`dcc-mcp-office-ir`, `dcc-mcp-office-tools`) + the `office-host` runtime.
|
|
41
|
+
|
|
42
|
+
## Capabilities owned here
|
|
43
|
+
|
|
44
|
+
- `word.document.compile` — Word IR → DOCX (headless) → read-back verification.
|
|
45
|
+
- `word.document.read_back` — reopen the artifact and compare every paragraph
|
|
46
|
+
and table cell.
|
|
47
|
+
- `word.fields.update` / `word.toc.rebuild` / `word.document.reflow` /
|
|
48
|
+
`word.track_changes.inspect` — `host_limited` in v0.1.0 (COM path not wired).
|
|
49
|
+
|
|
50
|
+
## Dependency policy
|
|
51
|
+
|
|
52
|
+
- **Package import is stdlib-only.** python-docx is **opt-in**: `compiler` /
|
|
53
|
+
`readback` import it at module level, but nothing else in the package does.
|
|
54
|
+
Two tests pin this (`tests/test_runtime_purity.py`).
|
|
55
|
+
- Keep the style constants in `word_ir.py`, not `compiler.py`, so stdlib-only
|
|
56
|
+
surfaces such as `validate` can warn about unknown styles without importing
|
|
57
|
+
python-docx. Moving them back breaks the purity tests.
|
|
58
|
+
- One docx implementation only (ADR 004 / ADR 006): no second writer inside
|
|
59
|
+
the adapter, even as a fallback. A missing shared host is reported, not
|
|
60
|
+
worked around.
|
|
61
|
+
|
|
62
|
+
## Grading rules
|
|
63
|
+
|
|
64
|
+
A capability is `verified` only if a headless CI test proves it. Anything
|
|
65
|
+
needing Word's layout engine or COM object model is `host_limited` — the
|
|
66
|
+
distinction is evidence, not confidence. `tests/test_capabilities.py` asserts
|
|
67
|
+
that no `host_limited` capability is graded `verified`.
|
|
68
|
+
|
|
69
|
+
## Test
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pip install -e ".[dev]"
|
|
73
|
+
pytest
|
|
74
|
+
ruff check src tests
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The headless gate must stay green **without Word installed** — that is the
|
|
78
|
+
proof the adapter does not depend on a desktop Word installation.
|
|
79
|
+
|
|
80
|
+
## Gotchas
|
|
81
|
+
|
|
82
|
+
- python-docx exposes `_Header`/`_Footer` objects with **no `.text`**
|
|
83
|
+
attribute; join `part.paragraphs` instead. Hit twice already.
|
|
84
|
+
- `add_page_break()` emits an extra empty body paragraph. The read-back skips
|
|
85
|
+
formatting-only paragraphs (page breaks and the TOC field paragraph) so
|
|
86
|
+
counts line up with the IR.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.2](https://github.com/dcc-mcp/dcc-mcp-word/compare/v0.1.1...v0.1.2) (2026-10-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* avoid duplicate skills in Word wheels ([#5](https://github.com/dcc-mcp/dcc-mcp-word/issues/5)) ([fd38aa9](https://github.com/dcc-mcp/dcc-mcp-word/commit/fd38aa905eaeea1acc7b6e5caa642279f34c5ca0))
|
|
9
|
+
|
|
10
|
+
## [0.1.1](https://github.com/dcc-mcp/dcc-mcp-word/compare/v0.1.0...v0.1.1) (2026-10-17)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* headless Word IR to DOCX adapter with read-back verification ([9a3d7e9](https://github.com/dcc-mcp/dcc-mcp-word/commit/9a3d7e93e838d01993a14b7e7f3459bdd2256f67))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Documentation
|
|
19
|
+
|
|
20
|
+
* refresh the generated DCC-MCP host matrix pointer ([d7e0c68](https://github.com/dcc-mcp/dcc-mcp-word/commit/d7e0c68a5a2763ee94d9294f14407e674a314c3d))
|
|
21
|
+
* refresh the generated DCC-MCP host matrix pointer ([#4](https://github.com/dcc-mcp/dcc-mcp-word/issues/4)) ([113c952](https://github.com/dcc-mcp/dcc-mcp-word/commit/113c952b292b83d8445e82d30d2955b3308892f2))
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: dcc-mcp-word
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Word adapter for the DCC-MCP ecosystem — headless Word IR to DOCX compile with read-back verification over the dcc-mcp-office runtime
|
|
5
|
+
Project-URL: Homepage, https://github.com/dcc-mcp/dcc-mcp-word
|
|
6
|
+
Author-email: Long Hao <hal.long@outlook.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: ai,dcc,docx,llm,mcp,model-context-protocol,office,word
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Office/Business :: Office Suites
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Requires-Dist: dcc-mcp-core<1.0.0,>=0.18.2
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: build; extra == 'dev'
|
|
24
|
+
Requires-Dist: hatchling; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: python-docx>=1.1; extra == 'dev'
|
|
28
|
+
Requires-Dist: pywin32>=306; (sys_platform == 'win32') and extra == 'dev'
|
|
29
|
+
Requires-Dist: ruff>=0.8.0; extra == 'dev'
|
|
30
|
+
Provides-Extra: headless
|
|
31
|
+
Requires-Dist: python-docx>=1.1; extra == 'headless'
|
|
32
|
+
Provides-Extra: sidecar
|
|
33
|
+
Requires-Dist: dcc-mcp-server>=0.17.43; extra == 'sidecar'
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# dcc-mcp-word
|
|
37
|
+
|
|
38
|
+
Word adapter for the DCC-MCP ecosystem — thin application layer over
|
|
39
|
+
[dcc-mcp-office](https://github.com/dcc-mcp/dcc-mcp-office).
|
|
40
|
+
|
|
41
|
+
**Status: v0.1.0 — headless compile path live.** Word IR → Open XML compile →
|
|
42
|
+
read-back verification runs end to end with **no Word installation**, and the
|
|
43
|
+
gate runs headless in CI. Field/TOC refresh, document reflow and
|
|
44
|
+
track-changes inspection are `host_limited`: declared, graded, and never
|
|
45
|
+
claimed as verified.
|
|
46
|
+
|
|
47
|
+
> The old blocker note ("blocked on the `dcc-mcp-office` M1 release") is
|
|
48
|
+
> **stale and removed**. `dcc-mcp-office` shipped M1 in v0.2.0 (2026-08-16)
|
|
49
|
+
> and is now at v0.2.3; the Word IR (`crates/office-ir`, `pub mod word`,
|
|
50
|
+
> proposal §13.3) and the `WordBackend.cs` COM backend have been present
|
|
51
|
+
> since then. The three placeholder repos stalled on an unreviewed blocker
|
|
52
|
+
> note, not on a technical wall.
|
|
53
|
+
|
|
54
|
+
<!-- dcc-mcp-coverage-pointer:start -->
|
|
55
|
+
<!-- Generated from dcc-mcp-catalog.yml by scripts/generate_adapter_pointer.py in dcc-mcp/dcc-mcp-core. Do not edit by hand. -->
|
|
56
|
+
## Part of the DCC-MCP host matrix
|
|
57
|
+
|
|
58
|
+
**dcc-mcp-word** — Word adapter for DCC-MCP — headless Word IR to DOCX compile with
|
|
59
|
+
read-back verification over the dcc-mcp-office runtime.
|
|
60
|
+
|
|
61
|
+
It is one of **47 host adapters** in the DCC-MCP catalog. Every adapter speaks the same
|
|
62
|
+
MCP protocol and builds on the same core runtime contract; each one exposes the tools
|
|
63
|
+
its own host needs on top of that.
|
|
64
|
+
|
|
65
|
+
- [All host adapters and install metadata](https://dcc-mcp.github.io/ecosystem)
|
|
66
|
+
- [Host matrix on the core README](https://github.com/dcc-mcp/dcc-mcp-core#readme)
|
|
67
|
+
- [Showcase](https://dcc-mcp.github.io/showcase)
|
|
68
|
+
|
|
69
|
+
This block is generated from the catalog entry in
|
|
70
|
+
[`dcc-mcp-catalog.yml`](https://github.com/dcc-mcp/dcc-mcp-core/blob/main/dcc-mcp-catalog.yml).
|
|
71
|
+
Re-run the generator after changing the catalog.
|
|
72
|
+
<!-- dcc-mcp-coverage-pointer:end -->
|
|
73
|
+
|
|
74
|
+
## What v0.1.0 does
|
|
75
|
+
|
|
76
|
+
| Capability | Grade | Meaning |
|
|
77
|
+
|---|---|---|
|
|
78
|
+
| `word.document.compile` | `verified` | Word IR → DOCX, headless, CI-green |
|
|
79
|
+
| `word.document.read_back` | `verified` | Reopen the artifact; compare every paragraph and table cell |
|
|
80
|
+
| `word.paragraphs.write`, `word.lists.write`, `word.tables.write` | `verified` | Structured content writes |
|
|
81
|
+
| `word.headers_footers.write`, `word.fields.write` | `verified` | Per-section headers/footers; real Word field instructions |
|
|
82
|
+
| `word.fields.update`, `word.toc.rebuild` | `host_limited` | Word computes field results — needs the desktop app |
|
|
83
|
+
| `word.document.reflow`, `word.track_changes.inspect` | `host_limited` | Needs the Word COM object model |
|
|
84
|
+
| `word.content_controls.fill`, `word.figures.inline` | `unimplemented` | Parsed and validated by the IR, not emitted by the writer |
|
|
85
|
+
|
|
86
|
+
Run `dcc-mcp-word capabilities` for the machine-readable report, or
|
|
87
|
+
`dcc-mcp-word preflight` for the per-machine self-check.
|
|
88
|
+
|
|
89
|
+
## Install
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pip install dcc-mcp-word # adapter only (stdlib + dcc-mcp-core)
|
|
93
|
+
pip install "dcc-mcp-word[headless]" # + python-docx, for the compile path
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`python-docx` is an **opt-in extra**, matching how `dcc-mcp-excel` treats
|
|
97
|
+
`openpyxl`: importing the package never pulls it, so the adapter stays
|
|
98
|
+
installable inside DCCs that pin their own version. A test enforces this
|
|
99
|
+
(`tests/test_runtime_purity.py`).
|
|
100
|
+
|
|
101
|
+
## Quick start
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# 1. a Word IR envelope (office-ir/1.0, kind: word)
|
|
105
|
+
cat > call-sheet.json <<'JSON'
|
|
106
|
+
{
|
|
107
|
+
"schema_version": "office-ir/1.0",
|
|
108
|
+
"kind": "word",
|
|
109
|
+
"document_id": "fpt:call-sheet-2026-10-07",
|
|
110
|
+
"metadata": {"title": "Call sheet — 2026-10-07", "author": "pipeline"},
|
|
111
|
+
"document": {
|
|
112
|
+
"sections": [{"title": "Schedule", "paragraphs": [{"text": "Call 07:00"}]}],
|
|
113
|
+
"tables": [{"header": true, "rows": [["Shot", "Status"], ["sh010", "ip"]]}],
|
|
114
|
+
"footers": [{"section_index": 0, "text": "Page"}],
|
|
115
|
+
"fields": [{"kind": "toc"}, {"kind": "page"}]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
JSON
|
|
119
|
+
|
|
120
|
+
# 2. compile + read back
|
|
121
|
+
python -m dcc_mcp_word.skills.word-document.scripts.generate_document \
|
|
122
|
+
--input call-sheet.json --out output
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The script prints JSON: artifact path, read-back verdict (paragraphs and
|
|
126
|
+
cells checked, mismatches), validation checks and warnings.
|
|
127
|
+
|
|
128
|
+
## Input contract
|
|
129
|
+
|
|
130
|
+
The adapter mirrors the Rust `dcc-mcp-office-ir` word schema 1:1 — styles,
|
|
131
|
+
sections, paragraphs, lists, tables, figures, content controls,
|
|
132
|
+
headers/footers, fields and review policy. See
|
|
133
|
+
[`src/dcc_mcp_word/word_ir.py`](src/dcc_mcp_word/word_ir.py) for the
|
|
134
|
+
annotated contract, or `word-document/SKILL.md` for the agent-facing guide.
|
|
135
|
+
|
|
136
|
+
## The honest boundary
|
|
137
|
+
|
|
138
|
+
python-docx writes a valid DOCX but has **no layout engine**. That is why the
|
|
139
|
+
two halves of `word.document.reflow` are graded separately:
|
|
140
|
+
|
|
141
|
+
- *Compiling* (IR → DOCX) is headless and `verified`.
|
|
142
|
+
- *Reflowing, re-paginating, and refreshing field results* needs Word, and is
|
|
143
|
+
`host_limited`.
|
|
144
|
+
|
|
145
|
+
A `TOC` field is written as a real field instruction. Word fills in the
|
|
146
|
+
entries when the document is opened — verified on a Word 365 host: before
|
|
147
|
+
`Fields.Update()` the TOC shows its placeholder, after it shows
|
|
148
|
+
`Schedule→1, Safety→2`. See
|
|
149
|
+
[`examples/com-verification.json`](examples/com-verification.json).
|
|
150
|
+
|
|
151
|
+
## Test
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
pip install -e ".[dev]"
|
|
155
|
+
pytest
|
|
156
|
+
ruff check src tests
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
The headless gate must stay green **without Word installed** — that is the
|
|
160
|
+
proof the adapter does not depend on a desktop Word installation.
|
|
161
|
+
|
|
162
|
+
## Upstream
|
|
163
|
+
|
|
164
|
+
- `dcc-mcp-office` — protocol, IR, C# COM runtime, jobs, security policy
|
|
165
|
+
- `dcc-mcp-core` — gateway, skills runtime, sidecar lifecycle
|
|
166
|
+
|
|
167
|
+
## License
|
|
168
|
+
|
|
169
|
+
MIT
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# dcc-mcp-word
|
|
2
|
+
|
|
3
|
+
Word adapter for the DCC-MCP ecosystem — thin application layer over
|
|
4
|
+
[dcc-mcp-office](https://github.com/dcc-mcp/dcc-mcp-office).
|
|
5
|
+
|
|
6
|
+
**Status: v0.1.0 — headless compile path live.** Word IR → Open XML compile →
|
|
7
|
+
read-back verification runs end to end with **no Word installation**, and the
|
|
8
|
+
gate runs headless in CI. Field/TOC refresh, document reflow and
|
|
9
|
+
track-changes inspection are `host_limited`: declared, graded, and never
|
|
10
|
+
claimed as verified.
|
|
11
|
+
|
|
12
|
+
> The old blocker note ("blocked on the `dcc-mcp-office` M1 release") is
|
|
13
|
+
> **stale and removed**. `dcc-mcp-office` shipped M1 in v0.2.0 (2026-08-16)
|
|
14
|
+
> and is now at v0.2.3; the Word IR (`crates/office-ir`, `pub mod word`,
|
|
15
|
+
> proposal §13.3) and the `WordBackend.cs` COM backend have been present
|
|
16
|
+
> since then. The three placeholder repos stalled on an unreviewed blocker
|
|
17
|
+
> note, not on a technical wall.
|
|
18
|
+
|
|
19
|
+
<!-- dcc-mcp-coverage-pointer:start -->
|
|
20
|
+
<!-- Generated from dcc-mcp-catalog.yml by scripts/generate_adapter_pointer.py in dcc-mcp/dcc-mcp-core. Do not edit by hand. -->
|
|
21
|
+
## Part of the DCC-MCP host matrix
|
|
22
|
+
|
|
23
|
+
**dcc-mcp-word** — Word adapter for DCC-MCP — headless Word IR to DOCX compile with
|
|
24
|
+
read-back verification over the dcc-mcp-office runtime.
|
|
25
|
+
|
|
26
|
+
It is one of **47 host adapters** in the DCC-MCP catalog. Every adapter speaks the same
|
|
27
|
+
MCP protocol and builds on the same core runtime contract; each one exposes the tools
|
|
28
|
+
its own host needs on top of that.
|
|
29
|
+
|
|
30
|
+
- [All host adapters and install metadata](https://dcc-mcp.github.io/ecosystem)
|
|
31
|
+
- [Host matrix on the core README](https://github.com/dcc-mcp/dcc-mcp-core#readme)
|
|
32
|
+
- [Showcase](https://dcc-mcp.github.io/showcase)
|
|
33
|
+
|
|
34
|
+
This block is generated from the catalog entry in
|
|
35
|
+
[`dcc-mcp-catalog.yml`](https://github.com/dcc-mcp/dcc-mcp-core/blob/main/dcc-mcp-catalog.yml).
|
|
36
|
+
Re-run the generator after changing the catalog.
|
|
37
|
+
<!-- dcc-mcp-coverage-pointer:end -->
|
|
38
|
+
|
|
39
|
+
## What v0.1.0 does
|
|
40
|
+
|
|
41
|
+
| Capability | Grade | Meaning |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `word.document.compile` | `verified` | Word IR → DOCX, headless, CI-green |
|
|
44
|
+
| `word.document.read_back` | `verified` | Reopen the artifact; compare every paragraph and table cell |
|
|
45
|
+
| `word.paragraphs.write`, `word.lists.write`, `word.tables.write` | `verified` | Structured content writes |
|
|
46
|
+
| `word.headers_footers.write`, `word.fields.write` | `verified` | Per-section headers/footers; real Word field instructions |
|
|
47
|
+
| `word.fields.update`, `word.toc.rebuild` | `host_limited` | Word computes field results — needs the desktop app |
|
|
48
|
+
| `word.document.reflow`, `word.track_changes.inspect` | `host_limited` | Needs the Word COM object model |
|
|
49
|
+
| `word.content_controls.fill`, `word.figures.inline` | `unimplemented` | Parsed and validated by the IR, not emitted by the writer |
|
|
50
|
+
|
|
51
|
+
Run `dcc-mcp-word capabilities` for the machine-readable report, or
|
|
52
|
+
`dcc-mcp-word preflight` for the per-machine self-check.
|
|
53
|
+
|
|
54
|
+
## Install
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install dcc-mcp-word # adapter only (stdlib + dcc-mcp-core)
|
|
58
|
+
pip install "dcc-mcp-word[headless]" # + python-docx, for the compile path
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`python-docx` is an **opt-in extra**, matching how `dcc-mcp-excel` treats
|
|
62
|
+
`openpyxl`: importing the package never pulls it, so the adapter stays
|
|
63
|
+
installable inside DCCs that pin their own version. A test enforces this
|
|
64
|
+
(`tests/test_runtime_purity.py`).
|
|
65
|
+
|
|
66
|
+
## Quick start
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# 1. a Word IR envelope (office-ir/1.0, kind: word)
|
|
70
|
+
cat > call-sheet.json <<'JSON'
|
|
71
|
+
{
|
|
72
|
+
"schema_version": "office-ir/1.0",
|
|
73
|
+
"kind": "word",
|
|
74
|
+
"document_id": "fpt:call-sheet-2026-10-07",
|
|
75
|
+
"metadata": {"title": "Call sheet — 2026-10-07", "author": "pipeline"},
|
|
76
|
+
"document": {
|
|
77
|
+
"sections": [{"title": "Schedule", "paragraphs": [{"text": "Call 07:00"}]}],
|
|
78
|
+
"tables": [{"header": true, "rows": [["Shot", "Status"], ["sh010", "ip"]]}],
|
|
79
|
+
"footers": [{"section_index": 0, "text": "Page"}],
|
|
80
|
+
"fields": [{"kind": "toc"}, {"kind": "page"}]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
JSON
|
|
84
|
+
|
|
85
|
+
# 2. compile + read back
|
|
86
|
+
python -m dcc_mcp_word.skills.word-document.scripts.generate_document \
|
|
87
|
+
--input call-sheet.json --out output
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The script prints JSON: artifact path, read-back verdict (paragraphs and
|
|
91
|
+
cells checked, mismatches), validation checks and warnings.
|
|
92
|
+
|
|
93
|
+
## Input contract
|
|
94
|
+
|
|
95
|
+
The adapter mirrors the Rust `dcc-mcp-office-ir` word schema 1:1 — styles,
|
|
96
|
+
sections, paragraphs, lists, tables, figures, content controls,
|
|
97
|
+
headers/footers, fields and review policy. See
|
|
98
|
+
[`src/dcc_mcp_word/word_ir.py`](src/dcc_mcp_word/word_ir.py) for the
|
|
99
|
+
annotated contract, or `word-document/SKILL.md` for the agent-facing guide.
|
|
100
|
+
|
|
101
|
+
## The honest boundary
|
|
102
|
+
|
|
103
|
+
python-docx writes a valid DOCX but has **no layout engine**. That is why the
|
|
104
|
+
two halves of `word.document.reflow` are graded separately:
|
|
105
|
+
|
|
106
|
+
- *Compiling* (IR → DOCX) is headless and `verified`.
|
|
107
|
+
- *Reflowing, re-paginating, and refreshing field results* needs Word, and is
|
|
108
|
+
`host_limited`.
|
|
109
|
+
|
|
110
|
+
A `TOC` field is written as a real field instruction. Word fills in the
|
|
111
|
+
entries when the document is opened — verified on a Word 365 host: before
|
|
112
|
+
`Fields.Update()` the TOC shows its placeholder, after it shows
|
|
113
|
+
`Schedule→1, Safety→2`. See
|
|
114
|
+
[`examples/com-verification.json`](examples/com-verification.json).
|
|
115
|
+
|
|
116
|
+
## Test
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pip install -e ".[dev]"
|
|
120
|
+
pytest
|
|
121
|
+
ruff check src tests
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The headless gate must stay green **without Word installed** — that is the
|
|
125
|
+
proof the adapter does not depend on a desktop Word installation.
|
|
126
|
+
|
|
127
|
+
## Upstream
|
|
128
|
+
|
|
129
|
+
- `dcc-mcp-office` — protocol, IR, C# COM runtime, jobs, security policy
|
|
130
|
+
- `dcc-mcp-core` — gateway, skills runtime, sidecar lifecycle
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT
|
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "office-ir/1.0",
|
|
3
|
+
"kind": "word",
|
|
4
|
+
"document_id": "fpt:call-sheet-2026-10-07",
|
|
5
|
+
"metadata": {"title": "Call sheet — 2026-10-07", "author": "pipeline", "language": "en"},
|
|
6
|
+
"document": {
|
|
7
|
+
"styles": ["Heading 1", "Normal"],
|
|
8
|
+
"paragraphs": [{"text": "Unit 2 — exterior night. All crew to base camp by 06:45.", "style": "Normal"}],
|
|
9
|
+
"sections": [
|
|
10
|
+
{"title": "Schedule", "paragraphs": [{"text": "Call time 07:00, lunch 12:30, wrap 19:30", "style": "Normal"}]},
|
|
11
|
+
{"title": "Safety", "page_break_before": true, "paragraphs": [{"text": "Wet conditions overnight; hi-vis required at all times.", "style": "Normal"}]}
|
|
12
|
+
],
|
|
13
|
+
"lists": [{"items": ["Bring rain cover", "Check generator fuel", "Confirm permits"], "style": "List Bullet"}],
|
|
14
|
+
"tables": [
|
|
15
|
+
{"header": true, "rows": [["Shot", "Status", "VFX"], ["sh010", "ip", "yes"], ["sh012", "wip", "no"], ["sh015", "appr", "no"]]}
|
|
16
|
+
],
|
|
17
|
+
"headers": [{"section_index": 0, "text": "CALL SHEET — 2026-10-07"}],
|
|
18
|
+
"footers": [{"section_index": 0, "text": "Page"}],
|
|
19
|
+
"fields": [{"kind": "toc"}, {"kind": "page"}]
|
|
20
|
+
},
|
|
21
|
+
"outputs": ["docx"]
|
|
22
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"artifact": "P:\\monica\\issues\\i-01a110d4b4ac\\agents\\a-a7020420eb91\\workdir\\dcc-mcp-word\\examples\\call-sheet.docx",
|
|
3
|
+
"paragraphs": 28,
|
|
4
|
+
"tables": 1,
|
|
5
|
+
"words": 52,
|
|
6
|
+
"pages": 2,
|
|
7
|
+
"fields_before_update": [
|
|
8
|
+
{
|
|
9
|
+
"code": "TOC \\o \"1-3\" \\h \\z \\u",
|
|
10
|
+
"result": "Right-click and choose 'Update Field' to build the table of contents."
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"fields_after_update": [
|
|
14
|
+
{
|
|
15
|
+
"code": "TOC \\o \"1-3\" \\h \\z \\u",
|
|
16
|
+
"result": "Schedule\t1\rSafety\t2\r"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"code": "HYPERLINK \\l \"_Toc242211723\"",
|
|
20
|
+
"result": "Schedule\t1"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"code": "PAGEREF _Toc242211723 \\h",
|
|
24
|
+
"result": "1"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"code": "HYPERLINK \\l \"_Toc242211724\"",
|
|
28
|
+
"result": "Safety\t2"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"code": "PAGEREF _Toc242211724 \\h",
|
|
32
|
+
"result": "2"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|