Use superdoc_edit with type: "markdown" to insert structured content in a single call. It parses markdown into proper document nodes: headings, paragraphs, bold, italic, and lists.
superdoc_edit({ session_id, action: "insert", type: "markdown", value: "# Background\n\nThis section covers the project history.\n\n# Next steps\n\n1. Review the proposal\n2. Assign owners\n3. Set a deadline"})
Format targets must exist before the batch runs. Node selectors resolve at step execution time using the current document state. If a required target is missing, the step fails and: with atomic: true: the entire batch rolls back.
Every editing tool needs a target telling the API where to apply the change. There are three ways to get one:
From blocks data: Each block has a ref (pass to superdoc_edit or superdoc_format) and a nodeId (for building at positions with superdoc_create).
From superdoc_search: Returns handle.ref covering the matched text. Use search when you need to find text patterns, not when you already know which block to target.
From superdoc_create: Returns nodeId and ref for the new node. For creating multiple sections or blocks at once, prefer superdoc_edit with type: "markdown" instead of multiple superdoc_create calls. Re-fetch blocks after create to get a fresh ref before formatting.
Refs expire after any mutation. Always re-search or re-read blocks before the next operation. Within a superdoc_mutations batch, node selectors resolve automatically at step execution time, so re-fetching between steps is not required.
Use superdoc_mutations when you need multiple changes that must succeed or fail together. Supported step types include text.rewrite, text.delete, format.apply, create.heading, create.paragraph, and create.table.
Actions that support tracked edits use the underlying Document API’s changeMode: "tracked" option. Review or resolve tracked edits with superdoc_track_changes:
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"SuperDoc","description":"Web-based DOCX editor with full Microsoft Word compatibility. Handle tracked changes, complex tables, and document automation. Works with any framework and AI agents.","colors":{"primary":"#6366F1","light":"#8968F6","dark":"#4F46E5"},"logo":{"light":"https://mintcdn.com/superdoc/7ZYpWaCC36-L9yl3/public/images/logo-light.png?fit=max\u0026auto=format\u0026n=7ZYpWaCC36-L9yl3\u0026q=85\u0026s=d12bb868024e11de2d975ef28a389361","dark":"https://mintcdn.com/superdoc/7ZYpWaCC36-L9yl3/public/images/logo-dark.png?fit=max\u0026auto=format\u0026n=7ZYpWaCC36-L9yl3\u0026q=85\u0026s=8485990741fdb814fdcc69825b9cb430","href":"https://docs.superdoc.dev"},"favicon":"https://mintcdn.com/superdoc/7ZYpWaCC36-L9yl3/public/images/favicon.png?fit=max\u0026auto=format\u0026n=7ZYpWaCC36-L9yl3\u0026q=85\u0026s=6e88dc958e94f27066e9754e2ac69445","api":{"playground":{"display":"interactive"}},"background":{"color":{"light":"#f8f8fc","dark":"#0a0a0f"}},"navbar":{"links":[{"href":"https://github.com/superdoc/docx-editor","type":"github"},{"href":"https://discord.com/invite/b9UuaZRyaB","label":"Discord","type":"discord"}],"primary":{"type":"button","label":"Talk to an engineer","href":"https://superdoc.dev/meetings/caio-pizzol"}},"seo":{"metatags":{"description":"Web-based DOCX editor with full Microsoft Word compatibility. Handle tracked changes, complex tables, and document automation. Works with any framework and AI agents.","keywords":"DOCX editor, Microsoft Word web editor, document automation, tracked changes, contract management, document API, Word compatibility, LLM document editing, AI document processing","author":"SuperDoc","og:type":"website","og:url":"https://docs.superdoc.dev","og:image":"public/images/og-image.png","og:description":"DOCX editor that handles real Microsoft Word documents on the web. Tracked changes, complex tables, full Word compatibility. Built for contract management and document automation.","og:site_name":"SuperDoc Documentation","twitter:card":"summary_large_image","twitter:site":"@superdocdev","twitter:title":"SuperDoc - Real Microsoft Word Documents on the Web","twitter:description":"DOCX editor with full Word compatibility. Handle tracked changes, complex tables, and document automation with AI support.","twitter:image":"public/images/twitter-card.png"},"indexing":"all"},"fonts":{"family":"Plus Jakarta Sans"},"icons":{"library":"lucide"},"integrations":{"gtm":{"tagId":"GTM-PHNMQSDL"},"posthog":{"apiKey":"phc_jBYwMLryemk0X6RErATTY6I5GSSIzmErvfMIakkfh24","apiHost":"https://us.i.posthog.com"}},"banner":{"content":"**SuperDoc v2 is available.** [Read the v2 docs](https://docs.superdoc.dev/)","dismissible":true},"contextual":{"options":["copy","chatgpt","claude",{"title":"Ask on Discord","description":"Join our support channel","icon":"/public/icons/discord.svg","href":"https://discord.com/channels/1299087524056010902/1299436491839246409"}],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"versions":[{"version":"v2","href":"https://docs.superdoc.dev"},{"version":"v1","default":true,"href":"https://docs-v1.superdoc.dev"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"superdoc","hasAudioNarration":false,"actualSubdomain":"superdoc","customDomains":["docs.superdoc.dev","docs-v1.superdoc.dev"],"gitSource":{"type":"github","owner":"superdoc","repo":"docx-editor","deployBranch":"stable","contentDirectory":"apps/docs","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a98bec81f42aa9c8f659e61","collectionId":"ea7dd850-7716-49f5-9a89-51a17059bf70","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6a98bec81f42aa9c8f659e61"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6a98bec81f42aa9c8f659e61","clientVersion":"0.0.4067","searchFilterCounts":[{"language":"default","tag":"SuperDoc","count":104},{"language":"default","tag":"Editor","count":45},{"language":"default","tag":"Getting Started","count":16},{"language":"default","tag":"AI","count":14},{"language":"default","tag":"Custom UI","count":13},{"language":"default","tag":"Backend Services","count":10},{"language":"default","tag":"Document Engine","count":10},{"language":"default","tag":"Solutions","count":10},{"language":"default","tag":"Agents","count":9},{"language":"default","tag":"Collaboration","count":9}]},"assistantConfig":{"enableAskAiButton":true,"enableStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@superdoc.dev","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"#page-title{font-size:2.8rem!important;color:#1e74dd}.dark body,[data-theme=\"dark\"] body{background:rgb(var(--background-dark))!important}#search-bar-entry{border-radius:9999px!important}a[href*=\"meetings\"],a[href*=\"meetings\"] *{border-radius:9999px!important}a[href*=\"meetings\"]{background-color:#4f46e5!important;color:#fff!important;padding:0.5rem 1.25rem!important;font-family:Inter, sans-serif!important;font-size:0.875rem!important;font-weight:600!important;border:none!important;box-shadow:0 1px 2px 0 rgba(0, 0, 0, 0.05)!important;transition:background-color 0.15s,\n box-shadow 0.15s!important}a[href*=\"meetings\"]:hover{background-color:#4338ca!important;box-shadow:0 4px 12px rgba(79, 70, 229, 0.25)!important}a[href*=\"meetings\"] svg{display:none!important}a[href*=\"github.com/superdoc-dev\"] .truncate,a[href*=\"github.com/superdoc-dev\"] svg[style*=\"mask-image\"]{display:none!important}"}],"page":{"pagePath":"ai/mcp/how-to-use","slug":"/ai/mcp/how-to-use","pageMetadata":{"title":"How to use","sidebarTitle":"How to use","description":"Workflow patterns, targeting, and common operations for the SuperDoc MCP server","keywords":"mcp, superdoc, workflow, targeting, formatting, document editing, ai agents","href":"/ai/mcp/how-to-use"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Workflow patterns, targeting, and common operations for the SuperDoc MCP server\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`workflow`,children:`Workflow`}),`\n`,_jsx(_components.p,{children:`Every interaction follows the same pattern: open, read or edit, save, close.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_open → superdoc_get_content / superdoc_search → intent tools → superdoc_save → superdoc_close`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`superdoc_open`}),` loads a `,_jsx(_components.code,{children:`.docx`}),` file and returns a `,_jsx(_components.code,{children:`session_id`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`superdoc_get_content`}),` reads the current document and `,_jsx(_components.code,{children:`superdoc_search`}),` finds stable handles or addresses`]}),`\n`,_jsxs(_components.li,{children:[`Intent tools use `,_jsx(_components.code,{children:`session_id`}),` plus `,_jsx(_components.code,{children:`action`}),` to edit, format, create, comment, review track changes, or run batched mutations`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`superdoc_save`}),` writes changes to disk`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`superdoc_close`}),` releases the session`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`efficient-patterns`,children:`Efficient patterns`}),`\n`,_jsx(Heading,{level:`3`,id:`create-multiple-sections-at-once`,children:`Create multiple sections at once`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`superdoc_edit`}),` with `,_jsx(_components.code,{children:`type: \"markdown\"`}),` to insert structured content in a single call. It parses markdown into proper document nodes: headings, paragraphs, bold, italic, and lists.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`7`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_edit({`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` session_id,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` action: \"insert\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` type: \"markdown\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` value: \"# Background\\\\n\\\\nThis section covers the project history.\\\\n\\\\n# Next steps\\\\n\\\\n1. Review the proposal\\\\n2. Assign owners\\\\n3. Set a deadline\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Markdown syntax maps to document styles:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Markdown`}),_jsx(_components.th,{children:`Document node`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`# Heading`})}),_jsx(_components.td,{children:`Heading 1`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`## Heading`})}),_jsx(_components.td,{children:`Heading 2`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`**text**`})}),_jsx(_components.td,{children:`Bold`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`*text*`})}),_jsx(_components.td,{children:`Italic`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`- item`})}),_jsx(_components.td,{children:`Bullet list`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`1. item`})}),_jsx(_components.td,{children:`Numbered list`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`format-multiple-items-at-once`,children:`Format multiple items at once`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`superdoc_mutations`}),` with `,_jsx(_components.code,{children:`format.apply`}),` steps to apply formatting across the document in one atomic call.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`5`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_mutations({session_id, action: \"apply\", atomic: true, changeMode: \"direct\", steps: [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` {id: \"f1\", op: \"format.apply\", where: {by: \"select\", select: {type: \"node\", nodeType: \"heading\", level: 1}, require: \"all\"}, args: {inline: {bold: true}}},`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` {id: \"f2\", op: \"format.apply\", where: {by: \"select\", select: {type: \"node\", nodeType: \"heading\", level: 2}, require: \"all\"}, args: {inline: {italic: true}}}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`]})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Format targets must exist before the batch runs. Node selectors resolve at step execution time using the current document state. If a required target is missing, the step fails and: with `,_jsx(_components.code,{children:`atomic: true`}),`: the entire batch rolls back.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`when-to-use-which-tool`,children:`When to use which tool`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Task`}),_jsx(_components.th,{children:`Best tool`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Insert one paragraph or heading`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`superdoc_create`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Insert multiple sections with structure`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`superdoc_edit`}),` with `,_jsx(_components.code,{children:`type: \"markdown\"`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Replace text across the whole document`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`superdoc_search`}),` + `,_jsx(_components.code,{children:`superdoc_edit`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Rewrite a whole paragraph`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`superdoc_get_content`}),` + `,_jsx(_components.code,{children:`superdoc_edit`}),` with block ref`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Apply formatting to known text`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`superdoc_search`}),` + `,_jsx(_components.code,{children:`superdoc_format`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Apply formatting to all nodes of a type`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`superdoc_mutations`}),` with `,_jsx(_components.code,{children:`format.apply`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Multiple text changes that must succeed together`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`superdoc_mutations`}),` with `,_jsx(_components.code,{children:`atomic: true`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Review or resolve tracked changes`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`superdoc_track_changes`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`targeting`,children:`Targeting`}),`\n`,_jsxs(_components.p,{children:[`Every editing tool needs a `,_jsx(_components.strong,{children:`target`}),` telling the API `,_jsx(_components.em,{children:`where`}),` to apply the change. There are three ways to get one:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`From blocks data`}),`: Each block has a `,_jsx(_components.code,{children:`ref`}),` (pass to `,_jsx(_components.code,{children:`superdoc_edit`}),` or `,_jsx(_components.code,{children:`superdoc_format`}),`) and a `,_jsx(_components.code,{children:`nodeId`}),` (for building `,_jsx(_components.code,{children:`at`}),` positions with `,_jsx(_components.code,{children:`superdoc_create`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`From `,_jsx(_components.code,{children:`superdoc_search`})]}),`: Returns `,_jsx(_components.code,{children:`handle.ref`}),` covering the matched text. Use search when you need to find text patterns, not when you already know which block to target.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`From `,_jsx(_components.code,{children:`superdoc_create`})]}),`: Returns `,_jsx(_components.code,{children:`nodeId`}),` and `,_jsx(_components.code,{children:`ref`}),` for the new node. For creating multiple sections or blocks at once, prefer `,_jsx(_components.code,{children:`superdoc_edit`}),` with `,_jsx(_components.code,{children:`type: \"markdown\"`}),` instead of multiple `,_jsx(_components.code,{children:`superdoc_create`}),` calls. Re-fetch blocks after create to get a fresh ref before formatting.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Refs expire after any mutation.`}),` Always re-search or re-read blocks before the next operation. Within a `,_jsx(_components.code,{children:`superdoc_mutations`}),` batch, node selectors resolve automatically at step execution time, so re-fetching between steps is not required.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`common-operations`,children:`Common operations`}),`\n`,_jsx(Heading,{level:`3`,id:`replace-text-everywhere`,children:`Replace text everywhere`}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_search({session_id, select: {type: \"text\", pattern: \"old word\"}, require: \"all\"})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_edit({session_id, action: \"replace\", ref: \"\u003chandle.ref>\", text: \"new word\"})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`rewrite-a-paragraph`,children:`Rewrite a paragraph`}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_get_content({session_id, action: \"blocks\"})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_edit({session_id, action: \"replace\", ref: \"\u003cblock.ref>\", text: \"Entirely new paragraph text.\"})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`A block ref covers the entire block text. A search ref covers only the matched substring. Use block refs when rewriting whole paragraphs.`}),`\n`,_jsx(Heading,{level:`3`,id:`add-content-after-a-heading`,children:`Add content after a heading`}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_search({session_id, select: {type: \"text\", pattern: \"Introduction\"}, require: \"first\"})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_create({session_id, action: \"paragraph\", text: \"New content.\", at: {kind: \"after\", target: {kind: \"block\", nodeType: \"heading\", nodeId: \"\u003cblockId>\"}}})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`format-text`,children:`Format text`}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_search({session_id, select: {type: \"text\", pattern: \"important phrase\"}, require: \"first\"})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_format({session_id, action: \"inline\", ref: \"\u003chandle.ref>\", inline: {bold: true}})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`create-a-list`,children:`Create a list`}),`\n`,_jsx(_components.p,{children:`Create paragraphs first, then convert:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_create({session_id, action: \"paragraph\", text: \"Item one\", at: {kind: \"documentEnd\"}})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_create({session_id, action: \"paragraph\", text: \"Item two\", at: {kind: \"after\", target: {kind: \"block\", nodeType: \"paragraph\", nodeId: \"\u003cnodeId1>\"}}})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_list({session_id, action: \"create\", mode: \"fromParagraphs\", preset: \"disc\", target: {from: {kind: \"block\", nodeType: \"paragraph\", nodeId: \"\u003cfirst>\"}, to: {kind: \"block\", nodeType: \"paragraph\", nodeId: \"\u003clast>\"}}})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`batch-edits-atomically`,children:`Batch edits atomically`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`superdoc_mutations`}),` when you need multiple changes that must succeed or fail together. Supported step types include `,_jsx(_components.code,{children:`text.rewrite`}),`, `,_jsx(_components.code,{children:`text.delete`}),`, `,_jsx(_components.code,{children:`format.apply`}),`, `,_jsx(_components.code,{children:`create.heading`}),`, `,_jsx(_components.code,{children:`create.paragraph`}),`, and `,_jsx(_components.code,{children:`create.table`}),`.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`5`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_mutations({session_id, action: \"apply\", atomic: true, changeMode: \"direct\", steps: [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` {id: \"s1\", op: \"text.rewrite\", where: {by: \"select\", select: {type: \"text\", pattern: \"old\"}, require: \"all\"}, args: {replacement: {text: \"new\"}}},`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` {id: \"s2\", op: \"text.delete\", where: {by: \"select\", select: {type: \"text\", pattern: \" (deprecated)\"}, require: \"all\"}, args: {}}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`]})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`tracked-changes`,children:`Tracked changes`}),`\n`,_jsxs(_components.p,{children:[`Actions that support tracked edits use the underlying Document API’s `,_jsx(_components.code,{children:`changeMode: \"tracked\"`}),` option. Review or resolve tracked edits with `,_jsx(_components.code,{children:`superdoc_track_changes`}),`:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_track_changes({session_id, action: \"list\"})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`superdoc_track_changes({session_id, action: \"decide\", decision: \"accept\", target: {id: \"\u003cchangeId>\"}})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`tips`,children:`Tips`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Format calls must be sequential.`}),` Each call invalidates all outstanding refs. Format one block, re-fetch, then format the next.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Search patterns are plain text.`}),` Do not include markdown markers like `,_jsx(_components.code,{children:`#`}),` or `,_jsx(_components.code,{children:`**`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Pass structured objects, not JSON strings.`}),` Fields like `,_jsx(_components.code,{children:`at`}),`, `,_jsx(_components.code,{children:`target`}),`, and `,_jsx(_components.code,{children:`inline`}),` expect objects.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`On a blank document`}),`, omit positional `,_jsx(_components.code,{children:`at`}),` on the first `,_jsx(_components.code,{children:`superdoc_create`}),`. Then fetch blocks for nodeIds before subsequent inserts.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/ai/mcp/overview`,children:`MCP overview`}),`: setup and tool reference`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/ai/mcp/debugging`,children:`Debugging`}),`: inspect and troubleshoot MCP tool calls`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/ai/agents/best-practices`,children:`Best practices`}),`: general AI agent patterns`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"How to use","sidebarTitle":"How to use","description":"Workflow patterns, targeting, and common operations for the SuperDoc MCP server","keywords":"mcp, superdoc, workflow, targeting, formatting, document editing, ai agents","href":"/ai/mcp/how-to-use"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Workflow","slug":"workflow","depth":2,"children":[]},{"title":"Efficient patterns","slug":"efficient-patterns","depth":2,"children":[{"title":"Create multiple sections at once","slug":"create-multiple-sections-at-once","depth":3,"children":[]},{"title":"Format multiple items at once","slug":"format-multiple-items-at-once","depth":3,"children":[]},{"title":"When to use which tool","slug":"when-to-use-which-tool","depth":3,"children":[]}]},{"title":"Targeting","slug":"targeting","depth":2,"children":[]},{"title":"Common operations","slug":"common-operations","depth":2,"children":[{"title":"Replace text everywhere","slug":"replace-text-everywhere","depth":3,"children":[]},{"title":"Rewrite a paragraph","slug":"rewrite-a-paragraph","depth":3,"children":[]},{"title":"Add content after a heading","slug":"add-content-after-a-heading","depth":3,"children":[]},{"title":"Format text","slug":"format-text","depth":3,"children":[]},{"title":"Create a list","slug":"create-a-list","depth":3,"children":[]},{"title":"Batch edits atomically","slug":"batch-edits-atomically","depth":3,"children":[]}]},{"title":"Tracked changes","slug":"tracked-changes","depth":2,"children":[]},{"title":"Tips","slug":"tips","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/superdoc/2a25b218b1f621f2/scripts/sync-api-docs.js","/_mintlify/custom/superdoc/e9e42d59a3274a21/scripts/sync-sdk-docs.js","/_mintlify/custom/superdoc/44e55b05cccfd8b5/scripts/add-keywords.js"],"subdomain":"superdoc","siteName":"SuperDoc","title":"How to use - SuperDoc","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-05-01T23:50:48.734Z","originalFileLocation":"ai/mcp/how-to-use.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Workflow patterns, targeting, and common operations for the SuperDoc MCP server\">\u003cmeta data-mint-head name=\"keywords\" content=\"mcp, superdoc, workflow, targeting, formatting, document editing, ai agents\">\u003cmeta data-mint-head name=\"application-name\" content=\"SuperDoc\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/superdoc/AG0BjQtnR-Pw0ape/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/superdoc/AG0BjQtnR-Pw0ape/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/superdoc/AG0BjQtnR-Pw0ape/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/superdoc/AG0BjQtnR-Pw0ape/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/superdoc/AG0BjQtnR-Pw0ape/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/superdoc/AG0BjQtnR-Pw0ape/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/superdoc/AG0BjQtnR-Pw0ape/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/superdoc/AG0BjQtnR-Pw0ape/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/superdoc/AG0BjQtnR-Pw0ape/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"How to use - SuperDoc\">\u003cmeta data-mint-head property=\"og:description\" content=\"DOCX editor that handles real Microsoft Word documents on the web. Tracked changes, complex tables, full Word compatibility. Built for contract management and document automation.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SuperDoc Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.superdoc.dev/ai/mcp/how-to-use\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://superdoc.mintlify.app/public/images/og-image.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"SuperDoc - Real Microsoft Word Documents on the Web\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"DOCX editor with full Word compatibility. Handle tracked changes, complex tables, and document automation with AI support.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://superdoc.mintlify.app/public/images/og-image.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/superdoc/AG0BjQtnR-Pw0ape/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SuperDoc\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6366F1\">\u003cmeta data-mint-head name=\"author\" content=\"SuperDoc\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.superdoc.dev/ai/mcp/how-to-use\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/ai/mcp/how-to-use.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.superdoc.dev/#organization\",\"name\":\"SuperDoc\",\"url\":\"https://docs.superdoc.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/superdoc/7ZYpWaCC36-L9yl3/public/images/logo-light.png?fit=max\u0026auto=format\u0026n=7ZYpWaCC36-L9yl3\u0026q=85\u0026s=d12bb868024e11de2d975ef28a389361\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.superdoc.dev#website\",\"name\":\"SuperDoc\",\"url\":\"https://docs.superdoc.dev\",\"publisher\":{\"@id\":\"https://docs.superdoc.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.superdoc.dev/ai/mcp/how-to-use#webpage\",\"url\":\"https://docs.superdoc.dev/ai/mcp/how-to-use\",\"name\":\"How to use\",\"description\":\"Workflow patterns, targeting, and common operations for the SuperDoc MCP server\",\"dateModified\":\"2026-05-01T23:50:48.734Z\",\"isPartOf\":{\"@id\":\"https://docs.superdoc.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.superdoc.dev/ai/mcp/how-to-use#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.superdoc.dev/ai/mcp/how-to-use#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"AI\",\"item\":\"https://docs.superdoc.dev/ai/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MCP\",\"item\":\"https://docs.superdoc.dev/ai/mcp/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to use\",\"item\":\"https://docs.superdoc.dev/ai/mcp/how-to-use\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.superdoc.dev/ai/mcp/how-to-use#article\",\"headline\":\"How to use\",\"name\":\"How to use\",\"description\":\"Workflow patterns, targeting, and common operations for the SuperDoc MCP server\",\"url\":\"https://docs.superdoc.dev/ai/mcp/how-to-use\",\"mainEntityOfPage\":{\"@id\":\"https://docs.superdoc.dev/ai/mcp/how-to-use#webpage\"},\"image\":\"https://docs.superdoc.dev/public/images/og-image.png\",\"dateModified\":\"2026-05-01T23:50:48.734Z\",\"publisher\":{\"@id\":\"https://docs.superdoc.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.superdoc.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SuperDoc\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"SuperDoc","nav":{"global":{"versions":[{"version":"v2","href":"https://docs.superdoc.dev"},{"version":"v1","default":true,"href":"https://docs-v1.superdoc.dev"}]},"tabs":[{"tab":"SuperDoc","groups":[{"group":"Getting Started","pages":[{"title":"Meet SuperDoc","sidebarTitle":"Introduction","href":"/getting-started/introduction"},{"title":"Quick start","href":"/getting-started/quickstart"},{"group":"Frameworks","pages":[{"title":"React Integration","sidebarTitle":"React","href":"/getting-started/frameworks/react"},{"title":"Vue Integration","sidebarTitle":"Vue","href":"/getting-started/frameworks/vue"},{"title":"Nuxt Integration","sidebarTitle":"Nuxt","href":"/getting-started/frameworks/nuxt"},{"title":"Angular Integration","sidebarTitle":"Angular","href":"/getting-started/frameworks/angular"},{"title":"Laravel Integration","sidebarTitle":"Laravel","href":"/getting-started/frameworks/laravel"},{"title":"Solid Integration","sidebarTitle":"Solid","href":"/getting-started/frameworks/solid"},{"title":"Vanilla JavaScript","sidebarTitle":"Vanilla JS","href":"/getting-started/frameworks/vanilla-js"}]},{"title":"Import and export","sidebarTitle":"Import/Export","href":"/getting-started/import-export"},{"title":"Font support","sidebarTitle":"Font Support","href":"/getting-started/fonts"},{"title":"Theme SuperDoc","sidebarTitle":"Theming","href":"/getting-started/theming"},{"title":"AI","sidebarTitle":"AI","href":"/getting-started/ai"}]},{"group":"Editor","pages":[{"group":"SuperDoc","pages":[{"title":"SuperDoc API","sidebarTitle":"Overview","href":"/editor/superdoc/overview"},{"title":"Configuration","href":"/editor/superdoc/configuration"},{"title":"Import and export reference","sidebarTitle":"Import/Export","href":"/editor/superdoc/import-export"},{"title":"Methods","href":"/editor/superdoc/methods"},{"title":"Surfaces","href":"/editor/superdoc/surfaces"},{"title":"Events","href":"/editor/superdoc/events"}]},{"group":"React","pages":[{"title":"React API","sidebarTitle":"Overview","href":"/editor/react/overview"},{"title":"Configuration","href":"/editor/react/configuration"},{"title":"Methods","href":"/editor/react/methods"},{"title":"Types","href":"/editor/react/types"}]},{"group":"Custom UI","tag":"NEW","pages":[{"title":"Build custom UI with SuperDoc","sidebarTitle":"Overview","href":"/editor/custom-ui/overview"},{"title":"React setup","href":"/editor/custom-ui/react-setup"},{"title":"Controller setup","href":"/editor/custom-ui/controller-setup"},{"title":"Toolbar and commands","sidebarTitle":"Built-in","href":"/editor/custom-ui/toolbar-and-commands"},{"title":"Custom commands","sidebarTitle":"Custom","href":"/editor/custom-ui/custom-commands"},{"title":"Comments","href":"/editor/custom-ui/comments"},{"title":"Custom track changes UI","sidebarTitle":"Track changes","href":"/editor/custom-ui/track-changes"},{"title":"Content controls","href":"/editor/custom-ui/content-controls"},{"title":"Custom right-click menu","sidebarTitle":"Context menu","href":"/editor/custom-ui/context-menu"},{"title":"Selection and viewport","href":"/editor/custom-ui/selection-and-viewport"},{"title":"Document control","sidebarTitle":"Document","href":"/editor/custom-ui/document-control"},{"title":"Navigation","sidebarTitle":"Navigation","href":"/editor/custom-ui/navigation"},{"title":"API reference","href":"/editor/custom-ui/api-reference"}]},{"group":"Built-in UI","pages":[{"title":"Built-in UI","sidebarTitle":"Overview","href":"/editor/built-in-ui/overview"},{"title":"Comments","href":"/editor/built-in-ui/comments"},{"title":"Track changes","sidebarTitle":"Track changes","href":"/editor/built-in-ui/track-changes"},{"title":"Toolbar","sidebarTitle":"Toolbar","href":"/editor/built-in-ui/toolbar"},{"title":"Link popover","sidebarTitle":"Link popover","href":"/editor/built-in-ui/links"},{"title":"Context menu","href":"/editor/built-in-ui/context-menu"}]},{"group":"Collaboration","pages":[{"title":"Collaboration","sidebarTitle":"Overview","href":"/editor/collaboration/overview"},{"title":"Quickstart","sidebarTitle":"Quickstart","href":"/editor/collaboration/quickstart"},{"title":"Upgrade to Collaboration","sidebarTitle":"Upgrade Later","href":"/editor/collaboration/upgrade-to-collaboration"},{"title":"Configuration","sidebarTitle":"Configuration","href":"/editor/collaboration/configuration"},{"title":"Storage","sidebarTitle":"Storage","href":"/editor/collaboration/storage"},{"group":"Guides","pages":[{"title":"Liveblocks","sidebarTitle":"Liveblocks","href":"/guides/collaboration/liveblocks"},{"title":"YHub","sidebarTitle":"YHub","href":"/guides/collaboration/yhub"},{"title":"Hocuspocus","sidebarTitle":"Hocuspocus","href":"/guides/collaboration/hocuspocus"},{"title":"SuperDoc Yjs Collaboration","sidebarTitle":"SuperDoc Yjs","href":"/guides/collaboration/superdoc-yjs"}]}]},{"group":"Spell check","pages":[{"title":"Spell check","sidebarTitle":"Overview","href":"/editor/spell-check/overview"},{"title":"Custom spell-check provider","sidebarTitle":"Custom provider","href":"/editor/spell-check/custom-provider"}]},{"group":"Theming","pages":[{"title":"Theming overview","sidebarTitle":"Overview","href":"/editor/theming/overview"},{"title":"Custom themes","sidebarTitle":"Custom themes","href":"/editor/theming/custom-themes"},{"title":"CSS variable migration","sidebarTitle":"CSS variables","href":"/editor/theming/css-variable-migration"}]},{"group":"PDF","pages":[{"title":"PDF viewer","sidebarTitle":"Viewer","href":"/editor/pdf"},{"title":"Whiteboard","sidebarTitle":"Whiteboard","href":"/editor/pdf/whiteboard"}]}]},{"group":"Document Engine","pages":[{"title":"Document Engine","sidebarTitle":"Overview","href":"/document-engine/overview"},{"group":"Document API","pages":[{"title":"Document API","sidebarTitle":"Overview","href":"/document-api/overview"},{"title":"Common workflows","sidebarTitle":"Common Workflows","href":"/document-api/common-workflows"},{"group":"Features","pages":[{"title":"Content controls","sidebarTitle":"Content controls","href":"/document-api/features/content-controls"}]},{"title":"Document API reference","sidebarTitle":"Reference","href":"/document-api/reference/index"},{"title":"Available operations","sidebarTitle":"Available Operations","href":"/document-api/available-operations"},{"title":"Migrate to the Document API","sidebarTitle":"Migrate to Document API","href":"/document-api/migration"}]},{"title":"SDKs","sidebarTitle":"Overview","href":"/document-engine/sdks"},{"title":"CLI","sidebarTitle":"CLI","href":"/document-engine/cli"},{"title":"Compare documents","sidebarTitle":"Diffing","href":"/document-engine/diffing"}]},{"group":"AI","tag":"NEW","pages":[{"title":"AI","sidebarTitle":"Overview","href":"/ai/overview"},{"group":"MCP","pages":[{"title":"MCP Server","sidebarTitle":"Overview","description":"Give AI agents direct access to .docx files through the Model Context Protocol","href":"/ai/mcp/overview"},{"title":"How to use","sidebarTitle":"How to use","href":"/ai/mcp/how-to-use"},{"title":"Debugging","sidebarTitle":"Debugging","description":"Inspect and troubleshoot SuperDoc MCP tool calls","href":"/ai/mcp/debugging"}]},{"group":"Agents","pages":[{"title":"AI Agents","sidebarTitle":"Overview","href":"/ai/agents/llm-tools"},{"title":"How it works","sidebarTitle":"How it works","href":"/ai/agents/architecture"},{"group":"Presets","pages":[{"title":"Core preset — the action surface","sidebarTitle":"Core preset (recommended)","href":"/ai/agents/core-preset"},{"title":"Legacy preset — grouped intent tools","sidebarTitle":"Legacy preset","href":"/ai/agents/legacy-preset"}]},{"title":"Custom actions","sidebarTitle":"Custom actions","href":"/ai/agents/custom-actions"},{"title":"How to use","sidebarTitle":"How to use","href":"/ai/agents/integrations"},{"title":"Best practices","sidebarTitle":"Best practices","href":"/ai/agents/best-practices"},{"title":"Debugging","sidebarTitle":"Debugging","href":"/ai/agents/debugging"},{"title":"LLM eval results","sidebarTitle":"Eval Results","href":"/ai/agents/eval-results"}]},{"title":"Skills","sidebarTitle":"Skills","href":"/ai/agents/skills"}]},{"group":"Solutions","pages":[{"title":"Solutions","sidebarTitle":"Overview","href":"/solutions/overview"},{"group":"eSign","pages":[{"title":"eSign","sidebarTitle":"Introduction","href":"/solutions/esign/introduction"},{"title":"Quick Start","href":"/solutions/esign/quickstart"},{"title":"Configuration","href":"/solutions/esign/configuration"},{"title":"API Reference","href":"/solutions/esign/api-reference"},{"title":"Backend Implementation","sidebarTitle":"Backend","href":"/solutions/esign/backend"}]},{"group":"Template Builder","pages":[{"title":"Template Builder","sidebarTitle":"Introduction","href":"/solutions/template-builder/introduction"},{"title":"Quick Start Guide","sidebarTitle":"Quick Start","href":"/solutions/template-builder/quickstart"},{"title":"Configuration Options","sidebarTitle":"Configuration","href":"/solutions/template-builder/configuration"},{"title":"API Reference","sidebarTitle":"API Reference","href":"/solutions/template-builder/api-reference"}]}]},{"group":"Resources","pages":[{"title":"Accessibility","href":"/guides/general/accessibility"},{"title":"Telemetry","sidebarTitle":"Telemetry","href":"/resources/telemetry"},{"title":"Trust \u0026 Security","sidebarTitle":"Security","href":"/guides/general/security"},{"title":null,"href":"/resources/license"},{"group":"Upgrade guides","pages":[{"title":"Breaking Changes v1.0.0","sidebarTitle":"Breaking Changes v1","href":"/guides/migration/breaking-changes-v1"},{"title":"Migrate from ProseMirror to SuperDoc","sidebarTitle":"Migrate from ProseMirror","href":"/guides/migration/prosemirror"}]}]}]},{"tab":"Backend Services","pages":[{"title":"Backend Services","href":"/api-reference/introduction"}]}]},"basePath":"","title":"How to use - SuperDoc","buildId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","deploymentId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","dynamics":["10e4515597"],"chunks":["BannerMarkdown-DicSZcaX.js","dist-CIQkMg3R.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-ClVdStUn.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}