MCP reference

Variant MCP tools reference

The Variant MCP server exposes 20 tools that map directly to deck and slide operations. Agents read the current state, apply a precise change, render the result, and recover from conflicts — all without leaving the MCP loop.

#Deck tools

Whole-deck operations: create, read, update, list, replace all slides, list slide summaries, and export. Use these when the unit of work is the entire presentation.

  • decks.list
  • deck.get
  • deck.create
  • deck.update
  • deck.replaceAllSlides
  • deck.listSlides
  • deck.export

#Slide tools

Slide-level operations cover everything from a one-element style change to a full-deck batched rewrite. slide.edit accepts revision-guarded patches against text, attributes, styles, ordering, and root-level HTML insertion. slides.batchUpdate creates, replaces, updates, or deletes multiple slides in a single call.

  • slide.get
  • slide.duplicate
  • slide.move
  • slide.replace
  • slide.edit
  • slides.batchUpdate

#Preview and selection

Preview closes the loop: agents render a slide as PNG or JPEG before deciding whether the change worked. selection.get reads the user's current highlight in the editor — useful when you ask for help with "this slide" from inside the canvas.

  • slide.preview
  • selection.get

#Assets

asset.upload puts an image into deck storage and returns an asset:// reference. The same tool with scope: "brand" uploads reusable brand assets like logos and wordmarks. Brand assets persist across decks; deck assets are scoped to one deck.

  • asset.upload

#Brand

The brand kit travels into every generated deck. brand.context returns the markdown brand brief, color palette, and asset metadata (logo, wordmark, custom uploads). brand.update writes those back. Agents call brand.context before drafting so the first draft already lands on-brand.

  • brand.context
  • brand.update

#Versions

Variant keeps a server-side version history. Agents list saved versions and restore one as the current revision when an edit goes wrong — no manual undo in the editor required.

  • deck.versions.list
  • deck.version.restore

#Slide source format

Slide content is HTML in the content field. CSS lives in inline styles or style blocks. JavaScript belongs in runtime.script with interactivity set to scripts; raw script tags inside content are sanitized.

Built-in runtime libraries cover Chart.js, D3, GSAP, and Three.js, so agents can produce charts, motion, and 3D scenes without bundling. Tailwind utility classes work without a build step — when class attributes are present, the Tailwind browser runtime is injected automatically.

#Revision conflicts

Write tools accept an optional expectedRevision. If the deck has changed since the agent last read it, the tool fails with STALE_REVISION rather than silently overwriting. The error includes the current deck revision and per-slide revisions, so the client can refresh, rebase, and retry.

Other recoverable errors include INVALID_TOOL_ARGUMENTS (Zod validation), DECK_NOT_FOUND, SLIDE_NOT_FOUND, ASSET_NOT_FOUND, BRAND_ASSET_NOT_FOUND, STALE_BRAND_REVISION, DECK_TRASHED, UNAUTHORIZED, FORBIDDEN, and RATE_LIMITED.

Error response
{
  "code": "STALE_REVISION",
  "data": {
    "toolName": "slide.edit",
    "deckId": "dk_7xm2p",
    "currentDeckRevision": 42,
    "currentSlideRevisions": [
      { "slideNumber": 1, "revision": 11 },
      { "slideNumber": 2, "revision": 7 }
    ]
  }
}

#Tool responses

Every tool returns a short text summary plus a structured JSON payload. Write tools return compact deck or slide summaries instead of full slide HTML — call slide.get when the agent needs full source content. That keeps the agent's working context small even on long-running tasks.

#Schemas

Full input and response JSON Schemas live in the @variant/mcp-contract package. The same schemas come back from an MCP client's tools/list call, so agents can introspect tool shapes without leaving the protocol.

Scopes

ScopeWhat it allows
deck:readList and read decks and slides.
deck:writeCreate and update decks, edit slides, upload assets, and write brand settings.
slide:replaceReplace whole slide content.
slide:previewRender slide previews.
export:runTrigger deck exports.
authenticatedRead brand context — no extra scope required.

#Common questions

How many MCP tools does Variant expose?

20 tools across decks, slides, previews, selection, assets, brand, versions, and exports. Each tool requires the minimum scope it needs, and full schemas are available from the MCP tools/list call.

Can an agent edit one element on a slide?

Yes. slide.edit targets text, attributes, styles, ordering, and other element-level changes, and it can apply slide-level updates for content, interactivity mode, and runtime script settings.

Can an agent preview a slide?

Yes. slide.preview renders a PNG or JPEG so the agent can inspect layout before deciding whether the change worked.

What happens when two agents edit the same deck?

Write tools accept an expectedRevision. If the deck has changed underneath, the tool fails with a recoverable STALE_REVISION error that includes the current deck and slide revisions. The client refreshes, rebases its plan, and retries.

Where are the full tool schemas?

In the @variant/mcp-contract package, and in the JSON Schemas returned by an MCP client's tools/list call.