vespper-docx-mcp is the hosted gateway for reading and editing Word
documents. It authenticates requests, meters usage, and exposes three tools
that operate on the current document in a short-lived session.
Server
Clients discover the tools and their schemas with
tools/list.
Tools
Read document
Return a range of pages as HTML.
Search document
Regex-match blocks without loading the whole document.
Edit document
Apply
old → new edits to the document.Pass the descriptions returned by
tools/list through to your model. They
carry the rules for complete-block anchors, lazy classes, disambiguation,
batching, partial-batch recovery, and tracked changes.Document sessions
Upload the.docx once before starting the agent loop. Use the Vespper SDK in
Python or TypeScript; use the HTTP endpoint directly when integrating without
an SDK:
201:
open_session() and openSession() return the session_id string.
Your client then attaches the session ID to each tool call through MCP _meta.
The model sees only the clean tool arguments:
A raw tool call looks like this:
Use Vespper SDK auto-patching when it supports your MCP client. It injects
_meta and retains the latest DOCX automatically. With manual wiring, add
_meta per call or at the transport boundary. The Quickstart
shows both approaches.Control tracked changes behavior
By default,edit_document records new edits as Word tracked changes. Configure
the author and tracking behavior when you patch the MCP client, or pass the
same settings manually through _meta:
- Vespper SDK
- Raw MCP metadata
current_revision, the revision of
the session document used or produced by that call. Each successful edit
updates the session’s canonical document and increments its revision.
When the agent finishes or is cancelled, close the session:
204.
Choosing a primitive
Reading the whole document is rarely the right first move.
Both tools return the same HTML, so an anchor copied from either is equally
valid in
edit_document.
Typical flow
edit_document still returns the latest cumulative DOCX for
saving, downloading, or live display.
Authentication
SendAuthorization: Bearer sk_live_... on the MCP connection and session HTTP
requests. API keys are never tool parameters. Create a key on the
API keys page.
Verify a connection
Calltools/list with your key and confirm that it returns read_document,
search_document, and edit_document. Then open a document session, call
search_document with its session ID, and close the session. This verifies
authentication, document upload, conversion, and cleanup.
