Skip to main content
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:
The underlying request returns HTTP 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:
This setting controls only the new edits made by that call. Existing tracked changes remain unchanged unless an edit explicitly accepts, rejects, or modifies them. Read, search, and edit responses include 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:
A successful close returns HTTP 204.
The session belongs to the user who created it. Missing, closed, or user-mismatched sessions are rejected. Always close sessions in a finally block; abandoned sessions are cleaned up automatically, but explicit cleanup releases their document state immediately.

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

The server owns the current document for the session. Tool calls carry only the session ID, so clients do not resend DOCX bytes or thread returned base64 into the next call. edit_document still returns the latest cumulative DOCX for saving, downloading, or live display.

Authentication

Send Authorization: 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

Call tools/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.