Skip to main content
You bring an agent and a .docx; Vespper gives it three primitives — read_document, search_document, and edit_document — and returns the file with every change recorded as a Word tracked change.

Get set up

1

Create an API key

Create a key in the developer dashboard. Keys start with sk_live_ and the secret is shown only once, so copy it right away.
2

Set your model key

Every example below drives an OpenAI model, so set that key too.
3

Get a sample document

Create a project folder and drop a Word file named sample.docx into it beside the script.

How the document reaches the server

The tools take no base64_data argument. Your client attaches the document to each call’s MCP _meta object under com.vespper/document, and the tracked-change author under com.vespper/author. The model therefore sees clean schemas and never spends context on base64 — but it also means your code, not a turnkey chat client, has to inject it. Both paths below do exactly that.
Use the tool descriptions that come from the MCP server. Don’t override them with your own — they carry the anchoring, batching, and tracked-change rules the model needs to edit well.

Framework

Your framework runs the agent loop; you wire in the three tools and inject the document per call.
Save as main.py, then run python main.py.

Native

No framework — you own the agent loop. List the tools, describe them to the model keeping the server’s descriptions, then run tool calls until the edit lands. Because the server’s schemas are already clean, you can hand them to the model as-is.
Save as main.py, then run python main.py.
Each script writes sample-redlined.docx. Open it in Word and the change is there as a suggestion, attributed to the author you passed.

Editing rules

  • Copy old anchors verbatim from read_document or search_document. Never hand-write them.
  • Prefer one complete block — a <p>, <li>, heading, or row — per edit.
  • Write class="..." in both old and new to keep an element’s existing classes.
  • Batch independent edits into one call; they reconcile in parallel. Never put two edits on the same block.
  • A batch can apply partially. count says how many landed and failed_edits names the rest — the applied ones are already in the returned document, so resend only the listed indexes, never the whole batch.
  • Applied edits stay visible as tracked changes until a human accepts or rejects them in Word.

Next steps

Primitives

Full parameters and return shapes for all three tools.

MCP server

Endpoint, transport, and the _meta document channel.