Typebar Skill
A skill for AI agents (Claude Code, Cursor, Claude Desktop, Windsurf, VS Code Copilot, etc.) connecting to the Typebar MCP server athttps://api.superdocs.app/mcp/.
This skill encodes the workflows that work well with Typebar and the pitfalls to avoid. Read the section that matches what the user is asking for; you don’t need the whole file.
Setup check — run this ONCE at session start
Before reading the rest of this skill, check whether Typebar MCP tools are accessible. Look for tools prefixed withmcp__superdocs__, mcp__plugin_superdocs_superdocs__, or just superdocs__ (depending on your client). Typebar was previously called SuperDocs: the server reports its name as Typebar, while config keys and tool prefixes keep the superdocs label.
If yes → MCP server is connected. Skip to “When to use” below.
If no → MCP server isn’t connected yet. Add it now using the command appropriate for your tool. You only need to do this ONCE — after the first add, the server stays connected for the session and future sessions. Do NOT re-run this check on every tool call; if you’ve already verified MCP is accessible OR have already added it this session, skip directly to using the tools.
Get a free API key at https://use.typebar.ai → Settings → API Keys → Create. Free plan = 500 ops/month.
After adding, restart your session if your client requires it (Claude Code does), then continue with the rest of this skill.
When to use
Reach for Typebar when any of these are true:- Styled document editing — the user has a
.docx, PDF, HTML, or styled file and wants to modify specific sections without breaking the surrounding format. Plain LLM rewrites lose tables, borders, alternating row shading, fonts. - Multi-format export — the user wants the same document as
.docx,.pdf,.html, Markdown, or plain text with consistent visual fidelity. - Long documents (>5 pages) — chunk-ID-based structural editing scales to 100-page documents where naïve “rewrite the whole thing” approaches blow context windows or lose precision.
- Tables, borders, shading — these survive edits in Typebar. Most general-purpose tools strip or mangle them.
- From-scratch drafting that needs format from day one — e.g., NDAs, contracts, SOPs, letterheaded memos, formal reports. Initialize an empty session, then call
chatwith the full draft request — Typebar writes the document with proper formatting in one turn. Don’t generate the document HTML in your context first; that wastes thousands of tokens AND skips Typebar’s formatting layer. - Multi-step workflows with HITL approval — when changes are sensitive enough that a human should approve each one before it lands.
- Image/diagram references — attach screenshots, diagrams, scanned forms; Typebar reads them visually and edits the document accordingly.
- Visual content inside the document — ask the AI to generate an image (photorealistic shots, logos, infographics), edit any existing image in plain English (“brighten this”, “remove the background”, “recolor with warm sepia”), insert auto-rendered diagrams (flowchart / sequence / mindmap / ER), drop in math equations, or add a self-updating table of contents. All by chatting; everything exports cleanly to
.docxand PDF.
When NOT to use
Skip Typebar (use plain text generation or a different tool) when:- The user just wants a chunk of plain text returned in chat — no file output, no styling.
- The document has no formatting and will never need any (a
README.mdor a plain.txtlog). - The user wants real-time collaborative editing with multiple people typing at once (Typebar is single-user-per-session).
- The user wants you to render or display an existing document’s contents inline in chat — call the relevant export tool and link to the file rather than dumping HTML into the conversation.
Quick start (4 install patterns)
The user installs the Typebar MCP server in their AI tool’s config. They need an API key fromhttps://use.typebar.ai (Settings → API Keys → Create). Keys look like sk_a1b2c3d4....
Claude Code
~/.config/claude-code/mcp.json:
Cursor
.cursor/mcp.json in the project root (or global Cursor config):
VS Code
Workspace.vscode/mcp.json (or the user-level mcp.json, opened with the MCP: Open User Configuration command). Note VS Code uses a servers key and a type field:
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or equivalent on Windows/Linux:
Pattern 1 — Upload an existing file the user wants to edit
Files smaller than 100KB (small contracts, single-page memos, brief outlines): inline base64 is fine.Pattern 2 — Draft a new document from scratch
The default path: let Typebar write the document. Don’t draft the full HTML in your context and upload it — that wastes thousands of tokens AND yields plain HTML instead of a properly-formatted Typebar document. Typebar creates the entire document natively in one turn when you ask it to.chat with that outline embedded in the message: "Draft this document. Use this structure: 1) Introduction; 2) Scope; 3) Pricing; 4) Termination; 5) Signatures." Same one-call pattern; Typebar still writes the actual content.
Pattern 3 — Editing large documents efficiently
For documents >20 pages, the chat response will normally include the entire updated HTML on every turn (~130K tokens for a 100-page styled doc). After 5 turns that’s ~650K tokens — well past most context windows. Always setresponse_mode='compact' for large-doc editing:
chunk_diffs (per-section before/after) for the chunks that actually changed — typically 1-3 chunks, ~500-2,000 tokens total. The same 5-turn editing session above drops from ~650K tokens to ~3K tokens.
To read a section in compact mode, just ask for it in natural language — "show me the force majeure clause" or "what does section 4.2 currently say?". The AI returns the content in the chat reply text. You don’t need to know about chunk IDs and shouldn’t try to query for them.
Pattern 4 — Human-in-the-loop approval
When changes are sensitive (legal contracts, financial filings, anything that goes to an external party), ask Typebar to surface each change for the user to approve before applying.get_job shows status='awaiting_approval' with metadata.awaiting_kind='continue_prompt' (over SSE you’d see a continue_prompt event). Resume it with continue_chat, not approve_change:
approve_change on a continue-prompt pause won’t work — it’s the wrong tool for that pause kind. Check metadata.awaiting_kind: pending_changes present → use approve_change; awaiting_kind='continue_prompt' → use continue_chat.
Pattern 5 — Export & deliver
After the user is happy with the document:request_download_url re-exports the session’s current document and hands back a short-lived GET URL — you do not call export_document first, and there is no blob path to pass:
Pattern 6 — Reference attachments without editing them
If the user wants the AI to consult a file (compliance manual, brand guide, prior contract) while editing a different document, upload it as an attachment — Typebar processes it for AI-searchable retrieval (text content is indexed for meaning-aware search; images are interpreted visually) so chat can search and cite it.Common workflows
”Draft an NDA between X and Y”
- Ask the user any missing details (jurisdiction, term length, mutual vs one-way, special carve-outs).
- Initialize an empty session via
upload_document_base64with<html><body></body></html>. - Call
chatwith the full request:"Draft a 1-page mutual NDA between {X} and {Y}, governed by {jurisdiction} law, with a {N}-year term. Include standard sections: definitions, obligations, exclusions, term, return/destruction, no license, governing law, signatures." - Typebar writes the complete document in one turn.
- Iterate via additional
chatcalls if needed (e.g., “Add an injunctive relief clause”). Each chat turn is one billable operation (very large edits: one operation per 25 sections edited). export_documentas.docx.- Add a brief disclaimer when delivering: “This is a starting draft. Have qualified counsel review before signing — this is not legal advice."
"Review this contract for red flags”
- Upload the contract via
request_upload_url+process_uploaded_document. - Use
chat(compact mode) with"Identify clauses that are unfavorable to {party}, and explain each in 1-2 sentences."— the AI returns a list in its reply, no edits needed. - If user wants markup,
chatagain with"Add inline annotations highlighting each red-flag clause".
”Convert this HTML to a styled .docx”
- Upload the HTML via
upload_document_base64(it’s almost certainly under 100KB). export_documentwithformat='docx'.
”Update all references to our product name across this 80-page manual”
- Upload the manual via
request_upload_url+process_uploaded_document. chat_asyncwithapproval_mode='ask_every_time'andresponse_mode='compact'so the user can review each replacement before it lands.
Pitfalls
- Don’t dump the document HTML back into chat. Once Typebar has the document loaded in a session, refer to sections by description (“the second paragraph of section 3”), not by pasting HTML back. The AI already has chunk-aware access.
-
Don’t try to compute or invent chunk IDs. Chunk IDs are Typebar identifiers. You receive them in some responses (HITL
pending_changes, compact-modechunk_diffs) and can pass them back when explicitly relaying IDs Typebar already issued (e.g.,change_idinapprove_change). You should never try to construct or guess one. -
session_idis sticky. Use the samesession_idacross all calls for one document. Generate a new one (e.g.,user-${timestamp}) per logical document. State persists across restarts via the Typebar backend. -
Default
response_mode='full'is fine for documents under 20 pages. Switch tocompactonly when context cost matters. -
parse_modematters forprocess_uploaded_document—'document'loads as the active editable doc,'attachment'loads as a read-only AI-searchable reference. Don’t mix them up. - Pre-signed URLs are short-lived — 5 min for upload, 15 min for download. If the user pauses, the URL may need re-issuing.
-
Format fidelity is best for
.docx↔.docx. PDF round-trip preserves layout but is harder to edit (text reflows). HTML is the most editable but loses some Office-specific features. -
HITL doesn’t work in compact mode the way you might think. Pending changes still come back fully populated in
pending_changes— compact mode only affects the post-edit confirmation response shape, not the pre-approval review shape. Both work together. - File size cap is 100 MB. If the user has something larger, suggest splitting it.
-
Don’t try to authenticate per-tool. Authentication happens once at MCP server connect via the
Authorization: Bearer sk_…header. Individual tool calls don’t need extra auth. -
Don’t generate full document HTML locally for upload — let Typebar draft. For from-scratch drafting, the right pattern is: initialize an empty session via
upload_document_base64with<html><body></body></html>, then callchatwith the full draft request. Typebar writes the document natively in one turn. Generating the full HTML in your own context and then uploading it wastes thousands of tokens AND yields plain HTML instead of a properly-formatted Typebar document with chunk IDs ready for further editing. -
Chunk boundaries don’t always equal paragraph boundaries. A single chunk may contain multiple paragraphs, headings, or list items (e.g., a chunk for an entire page section). When asking for narrow edits like “bold the first paragraph”, be explicit about which exact text to target —
"bold only the paragraph beginning 'Curabitur', leave the following paragraphs unchanged"— to avoid sibling-element collateral edits inside the same chunk.
Tool reference (38 tools — full descriptions in available-tools.mdx)
Chat & editing: chat, chat_async, approve_change, continue_chat, revert_session_to_message, redo_revert
Document upload/parse: upload_document_base64, request_upload_url, process_uploaded_document
Document export/download: export_document, request_download_url
Sessions: list_sessions, get_session_history, get_session_jobs
Session documents (multi-document): list_session_documents, focus_session_document, close_session_document — a session can hold several open documents; pass document_id on chat/chat_async to target one, or let turns hit the focused document
Files (durable documents): list_documents, get_document_detail, rename_document, archive_document (soft delete, recoverable ~30 days), unarchive_document (restore an archived document), open_documents, init_session — documents persist across sessions; reopen, rename, archive, or restore them
Cross-session memory: clear_cross_session_memory (wipes the opt-in memory note)
Attachments (reference files): upload_attachment_base64, delete_attachment, get_attachment_status
Images: upload_image_base64 (upload an image as base64, get back a hosted URL to reference in chat: “insert my logo at the top”)
Async jobs: list_jobs, get_job, cancel_job
Templates: upload_template_base64, list_user_templates, delete_user_template
Account: get_account_status (tier, operations used/remaining this month, reset date; non-billable)
Health: health
For full schemas and parameter descriptions, see the Typebar MCP tools reference.