vespper-docx-mcp server.
The MCP tool descriptions carry the editing rules: complete HTML-block anchors, lazy classes, batching, and Word tracked-change semantics. Use
tools/list descriptions instead of copying those rules into your own prompt.1. Get a key
Create a key in the developer dashboard. Keys start withsk_live_; keep them secret and use them only from server-side code, local tools, or agent config.
2. Connect MCP
Put a local Word file named
sample.docx beside the example script or in the folder opened by your agent, then try:
Read sample.docx, then add the word hello to the end of the document.
3. Pick your stack
- Agent SDK / Framework
- No framework
- Agent client
Tool workflow
There is no server-side document session. Pass the current document bytes on every call. After
edit_document, continue with the returned base64 or decode it to save a .docx.
Editing rules
- Call
read_documentfirst and copyoldanchors from its exact HTML. - Prefer one complete block (
<p>,<li>, heading, row) per edit. - Use
class="..."inoldandnewto keep existing classes unless changing the class is the edit. - Batch independent edits in one
edit_documentcall; they reconcile in parallel. - If an edit fails, nothing is applied. Fix the listed edit and resend the whole batch.
- Successful edits remain visible as tracked changes until a human accepts or rejects them in Word.
Next steps
MCP server
Endpoint, tools, and connection details.
Authentication
API key handling and security notes.