mcp-word-bridge 3.2.2 → 3.2.4

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.
Files changed (3) hide show
  1. package/README.md +163 -46
  2. package/index.js +11 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -5,7 +5,7 @@ MCP server for live Word document editing via Office Add-in. Enables programmati
5
5
  ## Architecture
6
6
 
7
7
  ```
8
- MCP Client ←stdio→ index.js ←WebSocket→ Taskpane (Office Add-in) ←→ Word JS API ←→ Word Document
8
+ MCP Client←stdio→index.js←WebSocket→Taskpane (Office Add-in)←→Word JS API←→Word Document
9
9
  ```
10
10
 
11
11
  Single process. The MCP client spawns `index.js`, which starts both the HTTPS bridge server (for the add-in) and the MCP server (on stdio). Everything starts and stops together.
@@ -24,15 +24,14 @@ Restart Word → Home → Add-ins → **MCP Word Bridge**
24
24
 
25
25
  ### 2. Add MCP config
26
26
 
27
- Add to your MCP client configuration (e.g. `.kiro/settings/mcp.json`):
27
+ Add to your MCP client configuration:
28
28
 
29
29
  ```json
30
30
  {
31
31
  "mcpServers": {
32
32
  "word-bridge": {
33
33
  "command": "npx",
34
- "args": ["-y", "mcp-word-bridge"],
35
- "disabled": false
34
+ "args": ["-y", "mcp-word-bridge"]
36
35
  }
37
36
  }
38
37
  }
@@ -69,39 +68,155 @@ mcp-word-bridge/
69
68
 
70
69
  ## Tools (82)
71
70
 
72
- **Document:** get_text, get_document_properties, set_document_properties, save, get_word_count, get_styles, get_coauthors, set_change_tracking
73
-
74
- **Paragraphs:** get_paragraphs, get_paragraph_by_index, insert_paragraph, delete_paragraph, set_paragraph_style, set_paragraph_spacing
75
-
76
- **Search & Text:** search, search_and_replace, insert_text, get_selection_info, insert_text_at_selection, insert_line_break
77
-
78
- **Formatting:** format_text, clear_formatting, get_font_info
79
-
80
- **Tables:** insert_table, get_tables, get_table_data, set_table_cell, add_table_row, delete_table_row, merge_table_cells, split_table_cell, set_table_style, set_table_cell_shading
81
-
82
- **Lists:** insert_list, get_list_info, set_list_level
83
-
84
- **Comments:** add_comment, get_comments, get_comment_replies, reply_to_comment, resolve_comment, delete_comment
85
-
86
- **Footnotes/Endnotes:** insert_footnote, insert_footnote_at_index, insert_endnote, get_footnotes, get_endnotes, delete_footnote, delete_endnote
87
-
88
- **Track Changes:** get_tracked_changes, accept_tracked_change, reject_tracked_change, accept_all_tracked_changes, reject_all_tracked_changes
89
-
90
- **Content Controls:** get_content_controls, insert_content_control, set_content_control_text
91
-
92
- **Bookmarks:** get_bookmarks, insert_bookmark, delete_bookmark, go_to_bookmark, get_bookmark_text
93
-
94
- **Hyperlinks:** insert_hyperlink, get_hyperlinks, remove_hyperlink
95
-
96
- **Headers/Footers:** get_header_footer, set_header_footer
97
-
98
- **Images:** insert_image, get_images, delete_image
99
-
100
- **Page Layout:** get_page_layout, set_page_layout, get_sections, insert_page_break, insert_section_break
101
-
102
- **Custom Properties:** get_custom_properties, set_custom_property, delete_custom_property
103
-
104
- **Advanced:** insert_html, insert_ooxml, insert_table_of_contents, get_fields
71
+ ### Document
72
+ | Tool | Description |
73
+ |------|-------------|
74
+ | `word_get_text` | Get full plain text of the document |
75
+ | `word_get_document_properties` | Get metadata (title, author, path, timestamps) |
76
+ | `word_set_document_properties` | Set metadata fields |
77
+ | `word_save` | Save document to disk |
78
+ | `word_get_word_count` | Get word, character, and paragraph counts |
79
+ | `word_get_styles` | List available styles |
80
+ | `word_get_coauthors` | Get co-authoring status and active authors |
81
+ | `word_set_change_tracking` | Enable/disable track changes |
82
+
83
+ ### Paragraphs
84
+ | Tool | Description |
85
+ |------|-------------|
86
+ | `word_get_paragraphs` | Get paragraphs with style, alignment, TOC flag (paginated) |
87
+ | `word_get_paragraph_by_index` | Get full details of one paragraph (font, spacing, indent) |
88
+ | `word_insert_paragraph` | Insert a styled paragraph at Start or End |
89
+ | `word_delete_paragraph` | Delete a paragraph by index |
90
+ | `word_set_paragraph_style` | Change style or alignment of a paragraph |
91
+ | `word_set_paragraph_spacing` | Set line spacing, before/after, and indentation |
92
+
93
+ ### Search & Text
94
+ | Tool | Description |
95
+ |------|-------------|
96
+ | `word_search` | Find text matches (case-insensitive by default) |
97
+ | `word_search_and_replace` | Find and replace all occurrences |
98
+ | `word_insert_text` | Insert text before or after a search match |
99
+ | `word_get_selection_info` | Get current selection with font details |
100
+ | `word_insert_text_at_selection` | Insert or replace text at cursor |
101
+ | `word_insert_line_break` | Insert a soft line break (Shift+Enter) |
102
+
103
+ ### Formatting
104
+ | Tool | Description |
105
+ |------|-------------|
106
+ | `word_format_text` | Apply bold, italic, color, size, font to a text match |
107
+ | `word_clear_formatting` | Reset formatting to paragraph style defaults |
108
+ | `word_get_font_info` | Inspect font properties of a text match |
109
+
110
+ ### Tables
111
+ | Tool | Description |
112
+ |------|-------------|
113
+ | `word_insert_table` | Insert a table with data and optional style |
114
+ | `word_get_tables` | Get all tables with values and styles |
115
+ | `word_get_table_data` | Get cell values from a specific table |
116
+ | `word_set_table_cell` | Set text in a cell |
117
+ | `word_add_table_row` | Add a row with optional values |
118
+ | `word_delete_table_row` | Delete a row by index |
119
+ | `word_merge_table_cells` | Merge a rectangular range of cells |
120
+ | `word_split_table_cell` | Split a cell into rows/columns |
121
+ | `word_set_table_style` | Apply a built-in table style |
122
+ | `word_set_table_cell_shading` | Set cell background color |
123
+
124
+ ### Lists
125
+ | Tool | Description |
126
+ |------|-------------|
127
+ | `word_insert_list` | Insert a bulleted or numbered list |
128
+ | `word_get_list_info` | Get list level and numbering for a paragraph |
129
+ | `word_set_list_level` | Change indent level of a list item |
130
+
131
+ ### Comments
132
+ | Tool | Description |
133
+ |------|-------------|
134
+ | `word_add_comment` | Add a comment anchored to text |
135
+ | `word_get_comments` | Get all comments with author, date, status |
136
+ | `word_get_comment_replies` | Get replies for a comment |
137
+ | `word_reply_to_comment` | Reply to a comment |
138
+ | `word_resolve_comment` | Mark a comment as resolved |
139
+ | `word_delete_comment` | Delete a comment and its replies |
140
+
141
+ ### Footnotes & Endnotes
142
+ | Tool | Description |
143
+ |------|-------------|
144
+ | `word_insert_footnote` | Insert footnote anchored to a text match |
145
+ | `word_insert_footnote_at_index` | Insert footnote at end of a paragraph |
146
+ | `word_insert_endnote` | Insert endnote anchored to a text match |
147
+ | `word_get_footnotes` | Get all footnotes with index and text |
148
+ | `word_get_endnotes` | Get all endnotes with index and text |
149
+ | `word_delete_footnote` | Delete a footnote by index |
150
+ | `word_delete_endnote` | Delete an endnote by index |
151
+
152
+ ### Track Changes
153
+ | Tool | Description |
154
+ |------|-------------|
155
+ | `word_get_tracked_changes` | Get all tracked changes with type, author, text |
156
+ | `word_accept_tracked_change` | Accept a change by index |
157
+ | `word_reject_tracked_change` | Reject a change by index |
158
+ | `word_accept_all_tracked_changes` | Accept all changes |
159
+ | `word_reject_all_tracked_changes` | Reject all changes |
160
+
161
+ ### Content Controls
162
+ | Tool | Description |
163
+ |------|-------------|
164
+ | `word_get_content_controls` | Get all controls with id, tag, type, text |
165
+ | `word_insert_content_control` | Wrap text in a RichText, PlainText, or CheckBox control |
166
+ | `word_set_content_control_text` | Set text in a control by ID or tag |
167
+
168
+ ### Bookmarks
169
+ | Tool | Description |
170
+ |------|-------------|
171
+ | `word_get_bookmarks` | List all bookmark names |
172
+ | `word_insert_bookmark` | Create a bookmark at a text match |
173
+ | `word_delete_bookmark` | Delete a bookmark by name |
174
+ | `word_go_to_bookmark` | Navigate to a bookmark and select it |
175
+ | `word_get_bookmark_text` | Get text content of a bookmark |
176
+
177
+ ### Hyperlinks
178
+ | Tool | Description |
179
+ |------|-------------|
180
+ | `word_insert_hyperlink` | Add a hyperlink to existing text |
181
+ | `word_get_hyperlinks` | List all hyperlinks with URLs and text |
182
+ | `word_remove_hyperlink` | Remove link from text (keeps the text) |
183
+
184
+ ### Headers & Footers
185
+ | Tool | Description |
186
+ |------|-------------|
187
+ | `word_get_header_footer` | Get header or footer text |
188
+ | `word_set_header_footer` | Set header or footer text |
189
+
190
+ ### Images
191
+ | Tool | Description |
192
+ |------|-------------|
193
+ | `word_insert_image` | Insert image from base64 data |
194
+ | `word_get_images` | List images with dimensions and alt text |
195
+ | `word_delete_image` | Delete an image by index |
196
+
197
+ ### Page Layout & Sections
198
+ | Tool | Description |
199
+ |------|-------------|
200
+ | `word_get_page_layout` | Get margins, orientation, paper size |
201
+ | `word_set_page_layout` | Set margins, orientation, paper size |
202
+ | `word_get_sections` | List all sections with page setup |
203
+ | `word_insert_page_break` | Insert a page break after a paragraph |
204
+ | `word_insert_section_break` | Insert a section break after a paragraph |
205
+
206
+ ### Custom Properties
207
+ | Tool | Description |
208
+ |------|-------------|
209
+ | `word_get_custom_properties` | Get all custom key-value properties |
210
+ | `word_set_custom_property` | Create or update a custom property |
211
+ | `word_delete_custom_property` | Delete a custom property |
212
+
213
+ ### Advanced
214
+ | Tool | Description |
215
+ |------|-------------|
216
+ | `word_insert_html` | Insert HTML converted to native Word formatting |
217
+ | `word_insert_ooxml` | Insert raw Office Open XML |
218
+ | `word_insert_table_of_contents` | Insert a TOC based on headings |
219
+ | `word_get_fields` | Get all fields (hyperlinks, TOC, page numbers) |
105
220
 
106
221
  ## How it works
107
222
 
@@ -112,21 +227,23 @@ mcp-word-bridge/
112
227
  5. Changes go through Word's editing pipeline — cursor follows edits like a human typing
113
228
  6. When the MCP client terminates the process, the bridge server stops automatically
114
229
 
115
- ## Regenerating TLS Certificates
116
-
117
- A self-signed localhost certificate is **auto-generated on first run** if `certs/cert.pem` and `certs/key.pem` don't exist. No manual step needed.
230
+ ## TLS Certificate
118
231
 
119
- To trust the cert (required for Word to connect without warnings):
232
+ A self-signed localhost certificate is **auto-generated on first run** if `certs/cert.pem` and `certs/key.pem` don't exist. The server prints the exact trust command with the resolved path:
120
233
 
121
- **macOS:**
122
- ```bash
123
- sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain node_modules/mcp-word-bridge/certs/cert.pem
124
234
  ```
235
+ [mcp-word-bridge] ✓ Certificate generated.
236
+ [mcp-word-bridge]
237
+ [mcp-word-bridge] To trust the certificate (required once for Word to connect):
238
+ [mcp-word-bridge] security add-trusted-cert -r trustRoot -k ~/Library/Keychains/login.keychain-db "/path/to/certs/cert.pem"
239
+ ```
240
+
241
+ Run the printed command once. No `sudo` required — it adds to your user login keychain.
125
242
 
126
- **To regenerate manually:**
243
+ **To regenerate:**
127
244
  ```bash
128
245
  rm certs/cert.pem certs/key.pem
129
- node index.js # will regenerate on startup
246
+ # restart the MCP server — it will regenerate and print the trust command again
130
247
  ```
131
248
 
132
249
  ## Known Limitations & Word API Behavior
package/index.js CHANGED
@@ -40,8 +40,17 @@ function ensureCerts() {
40
40
  ].join('\n'));
41
41
  }
42
42
  execSync('openssl req -x509 -newkey rsa:2048 -keyout "' + keyPath + '" -out "' + certPath + '" -days 3650 -nodes -config "' + confPath + '"', { stdio: 'pipe' });
43
- process.stderr.write('[mcp-word-bridge] Certificate generated at ' + CERTS_DIR + '\n');
44
- process.stderr.write('[mcp-word-bridge] NOTE: You may need to trust this cert in your OS keychain for Word to connect.\n');
43
+ process.stderr.write('[mcp-word-bridge] Certificate generated.\n');
44
+ process.stderr.write('[mcp-word-bridge]\n');
45
+ process.stderr.write('[mcp-word-bridge] To trust the certificate (required once for Word to connect):\n');
46
+ if (process.platform === 'darwin') {
47
+ process.stderr.write('[mcp-word-bridge] security add-trusted-cert -r trustRoot -k ~/Library/Keychains/login.keychain-db "' + certPath + '"\n');
48
+ } else if (process.platform === 'win32') {
49
+ process.stderr.write('[mcp-word-bridge] certutil -user -addstore Root "' + certPath + '"\n');
50
+ } else {
51
+ process.stderr.write('[mcp-word-bridge] sudo cp "' + certPath + '" /usr/local/share/ca-certificates/ && sudo update-ca-certificates\n');
52
+ }
53
+ process.stderr.write('[mcp-word-bridge]\n');
45
54
  }
46
55
 
47
56
  ensureCerts();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-word-bridge",
3
- "version": "3.2.2",
3
+ "version": "3.2.4",
4
4
  "description": "MCP server for live Word document editing via Office Add-in",
5
5
  "main": "index.js",
6
6
  "bin": {