[{"data":1,"prerenderedAt":482},["ShallowReactive",2],{"guide-\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fuse-from-ai":3,"guides-all":418},{"id":4,"title":5,"body":6,"category":407,"description":408,"extension":409,"icon":410,"meta":411,"navigation":412,"order":413,"path":414,"seo":415,"stem":416,"__hash__":417},"guides\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fuse-from-ai.md","Use Transactional from your AI assistant",{"type":7,"value":8,"toc":398},"minimark",[9,13,27,33,40,45,55,59,62,131,141,145,164,174,181,202,206,209,300,304,307,312,318,323,333,356,360,375,381,389],[10,11,5],"h1",{"id":12},"use-transactional-from-your-ai-assistant",[14,15,16,17,21,22,26],"p",{},"Transactional exposes an ",[18,19,20],"strong",{},"MCP server"," at ",[23,24,25],"code",{},"https:\u002F\u002Fmcp.transactional.dev",". Once your assistant is connected, you can ask things like:",[28,29,30],"blockquote",{},[14,31,32],{},"\"Generate the welcome PDF for the customer I just created in Stripe.\"",[14,34,35,36,39],{},"…and it picks the right template, fills the variables, calls ",[23,37,38],{},"generate_pdf",", and hands you the URL — no copy-pasting JSON into a chat window.",[41,42,44],"h2",{"id":43},"what-mcp-is-in-one-sentence","What MCP is, in one sentence",[14,46,47,54],{},[48,49,53],"a",{"href":50,"rel":51},"https:\u002F\u002Fmodelcontextprotocol.io",[52],"nofollow","Model Context Protocol"," is a standard way for AI assistants to call external tools. You set it up once per assistant; the assistant then sees a list of tools (in our case: list documents, generate a PDF, …) and decides when to invoke them.",[41,56,58],{"id":57},"what-transactionals-mcp-server-exposes","What Transactional's MCP server exposes",[14,60,61],{},"Five tools, all scoped to the API token you connect with:",[63,64,65,78],"table",{},[66,67,68],"thead",{},[69,70,71,75],"tr",{},[72,73,74],"th",{},"Tool",[72,76,77],{},"What it does",[79,80,81,92,102,111,121],"tbody",{},[69,82,83,89],{},[84,85,86],"td",{},[23,87,88],{},"list_documents",[84,90,91],{},"List your templates. Useful as a first call so the assistant knows what's available.",[69,93,94,99],{},[84,95,96],{},[23,97,98],{},"get_document",[84,100,101],{},"Fetch the full state of one document — body, variables, fonts, page settings.",[69,103,104,108],{},[84,105,106],{},[23,107,38],{},[84,109,110],{},"Render a document with the variables you provide. Returns the signed PDF URL.",[69,112,113,118],{},[84,114,115],{},[23,116,117],{},"list_folders",[84,119,120],{},"List the folders organizing your documents.",[69,122,123,128],{},[84,124,125],{},[23,126,127],{},"get_usage",[84,129,130],{},"Read the current credit snapshot (generation + AI). Handy for \"how much can I still generate this month?\"",[14,132,133,134,140],{},"See the ",[18,135,136],{},[48,137,139],{"href":138},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Ftools-reference","MCP tools reference"," for the full argument shapes.",[41,142,144],{"id":143},"authentication","Authentication",[14,146,147,148,151,152,155,156,159,160,163],{},"The MCP server uses ",[18,149,150],{},"the same API tokens"," as ",[23,153,154],{},"\u002Fv1\u002Fgenerate",". Create one from ",[18,157,158],{},"API Keys → New key"," in the dashboard, copy the ",[23,161,162],{},"tk_live_…"," value (shown once), and pass it as a Bearer token:",[165,166,171],"pre",{"className":167,"code":169,"language":170},[168],"language-text","Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n","text",[23,172,169],{"__ignoreMap":173},"",[14,175,176,177,180],{},"Every MCP call is logged in your dashboard's ",[18,178,179],{},"Statistics"," view alongside REST calls — same audit trail.",[182,183,196],"aside",{"className":184},[185,186,187,188,189,190,191,192,193,194,195],"not-prose","my-6","rounded-md","border","border-blue-200","bg-blue-50","text-blue-900","px-4","py-3","text-[14px]","leading-relaxed",[14,197,198,201],{},[18,199,200],{},"One token, multiple assistants?"," Yes — you can paste the same token in Claude Desktop, Cursor, and Gemini simultaneously. If you want to revoke access for just one of them, give each its own named key.",[41,203,205],{"id":204},"pick-your-client","Pick your client",[14,207,208],{},"Native MCP support varies by client. Follow the guide that matches yours:",[63,210,211,224],{},[66,212,213],{},[69,214,215,218,221],{},[72,216,217],{},"Client",[72,219,220],{},"Setup guide",[72,222,223],{},"MCP support",[79,225,226,242,257,271,286],{},[69,227,228,233,239],{},[84,229,230],{},[18,231,232],{},"Claude Desktop",[84,234,235],{},[48,236,238],{"href":237},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fclaude-desktop","Setup →",[84,240,241],{},"Native (recommended)",[69,243,244,249,254],{},[84,245,246],{},[18,247,248],{},"Claude Code (CLI)",[84,250,251],{},[48,252,238],{"href":253},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fclaude-code",[84,255,256],{},"Native",[69,258,259,264,269],{},[84,260,261],{},[18,262,263],{},"Cursor",[84,265,266],{},[48,267,238],{"href":268},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fcursor",[84,270,256],{},[69,272,273,278,283],{},[84,274,275],{},[18,276,277],{},"ChatGPT",[84,279,280],{},[48,281,238],{"href":282},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fchatgpt",[84,284,285],{},"Via Custom GPT Actions (no native MCP yet)",[69,287,288,293,298],{},[84,289,290],{},[18,291,292],{},"Gemini Code Assist \u002F Gemini CLI",[84,294,295],{},[48,296,238],{"href":297},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fgemini",[84,299,256],{},[41,301,303],{"id":302},"a-first-prompt-to-try","A first prompt to try",[14,305,306],{},"Once connected, this is the smoke test:",[28,308,309],{},[14,310,311],{},"\"List my Transactional documents and tell me which one looks like an invoice template.\"",[14,313,314,315,317],{},"The assistant will call ",[23,316,88],{},", you'll see the tool invocation in its UI, and it'll summarize what it found. From there:",[28,319,320],{},[14,321,322],{},"\"Generate the invoice for customer 'Acme Corp', invoice number INV-2026-0142, with one line item: 'Pro subscription' at 1200 €.\"",[14,324,325,326,329,330,332],{},"The assistant figures out the document UUID, builds the ",[23,327,328],{},"variables"," object matching your template's sample shape, calls ",[23,331,38],{},", and returns the URL.",[182,334,339],{"className":335},[185,186,187,188,336,337,338,192,193,194,195],"border-amber-200","bg-amber-50","text-amber-900",[14,340,341,344,345,347,348,350,351,355],{},[18,342,343],{},"Heads up on credits."," ",[23,346,38],{}," debits one generation credit per successful call — exactly like ",[23,349,154],{},". Your assistant ",[352,353,354],"em",{},"can"," burn through credits if you ask it to \"regenerate this 10 times with slightly different variables\". Watch the gauges in the dashboard.",[41,357,359],{"id":358},"troubleshooting","Troubleshooting",[14,361,362,367,368,370,371,374],{},[18,363,364],{},[23,365,366],{},"invalid_bearer_token"," — Your ",[23,369,162],{}," token is wrong, revoked, or you forgot the ",[23,372,373],{},"Bearer "," prefix. Regenerate from the dashboard.",[14,376,377,380],{},[18,378,379],{},"Tools don't show up in my assistant"," — Restart the assistant after editing its config. MCP discovery happens at connection time, not per-call.",[14,382,383,388],{},[18,384,385],{},[23,386,387],{},"quota_exceeded"," — You're out of generation or AI credits. Top up or upgrade. The assistant will see this as a tool error and report it back to you in plain text.",[14,390,391,394,395,397],{},[18,392,393],{},"Calls succeed but the PDF looks wrong"," — That's a template problem, not an MCP problem. Use ",[23,396,98],{}," to inspect what the assistant fetched, then iterate on the template in the dashboard editor.",{"title":173,"searchDepth":399,"depth":399,"links":400},2,[401,402,403,404,405,406],{"id":43,"depth":399,"text":44},{"id":57,"depth":399,"text":58},{"id":143,"depth":399,"text":144},{"id":204,"depth":399,"text":205},{"id":302,"depth":399,"text":303},{"id":358,"depth":399,"text":359},"ai-mcp","Connect Transactional to Claude, Cursor, ChatGPT, or Gemini via MCP so your assistant can read your templates and generate PDFs directly.","md","sparkles",{},true,1,"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fuse-from-ai",{"title":5,"description":408},"docs\u002Fguides\u002Fai-mcp\u002Fuse-from-ai","yXR5vqMGMzmRsBsemcctFP7OYFAEj-Ojy0842KvExbU",[419,423,426,428,431,434,437,438,443,447,451,455,460,465,469,473,478],{"path":282,"title":420,"description":421,"category":407,"order":422},"ChatGPT (via Custom GPT Actions)","ChatGPT doesn't speak MCP natively yet — but you can give it the same powers through a Custom GPT pointed at the Transactional REST API.",5,{"path":253,"title":248,"description":424,"category":407,"order":425},"Connect Transactional to Claude Code so it can read your templates and generate PDFs from your terminal.",3,{"path":237,"title":232,"description":427,"category":407,"order":399},"Connect Transactional to Claude Desktop on macOS or Windows so Claude can read your templates and generate PDFs.",{"path":268,"title":263,"description":429,"category":407,"order":430},"Wire Transactional into Cursor's MCP support so you can generate PDFs from inside your editor.",4,{"path":297,"title":292,"description":432,"category":407,"order":433},"Connect Transactional to Google's Gemini agents through their MCP support.",6,{"path":138,"title":139,"description":435,"category":407,"order":436},"Every tool the Transactional MCP server exposes, with arguments, return shapes, and a prompt that typically triggers each one.",7,{"path":414,"title":5,"description":408,"category":407,"order":413},{"path":439,"title":440,"description":441,"category":442,"order":399},"\u002Fdocs\u002Fguides\u002Fauthoring\u002Fdesign-for-pdf","Designing templates that survive PDF rendering","PDFs are static — drop the animations, oversample your canvas charts, lean on vectors. The rules that make a template look sharp at print resolution.","authoring",{"path":444,"title":445,"description":446,"category":442,"order":413},"\u002Fdocs\u002Fguides\u002Fauthoring\u002Fhandlebars","Handlebars cheat sheet","The exact subset of Handlebars supported in Transactional templates — variables, conditionals, loops, and what NOT to reach for.",{"path":448,"title":449,"description":450,"category":442,"order":425},"\u002Fdocs\u002Fguides\u002Fauthoring\u002Fmodeling-variables","Modeling your variables","When to make something a variable vs. inline. Keep the API contract small, your templates portable, and your integration code boring.",{"path":452,"title":453,"description":454,"category":442,"order":430},"\u002Fdocs\u002Fguides\u002Fauthoring\u002Fworking-with-ai","Working with the AI assistant","Prompts and patterns to get good templates fast — what to ask, when to iterate, when to start over.",{"path":456,"title":457,"description":458,"category":459,"order":413},"\u002Fdocs\u002Fguides\u002Fgetting-started\u002Fquickstart","Quickstart — your first PDF in 5 minutes","Sign up, design a template, render your first PDF through the API. End-to-end in five minutes.","getting-started",{"path":461,"title":462,"description":463,"category":464,"order":413},"\u002Fdocs\u002Fguides\u002Fintegrations\u002Fnode-bun","Calling \u002Fv1\u002Fgenerate from Node.js & Bun","Production-grade integration using native fetch — retries, error handling, streaming the PDF to your storage.","integrations",{"path":466,"title":467,"description":468,"category":464,"order":399},"\u002Fdocs\u002Fguides\u002Fintegrations\u002Fphp-laravel","Calling \u002Fv1\u002Fgenerate from PHP & Laravel","cURL extension, Guzzle, or Laravel's HTTP client — render PDFs with retries and proper error handling.",{"path":470,"title":471,"description":472,"category":464,"order":425},"\u002Fdocs\u002Fguides\u002Fintegrations\u002Fpython","Calling \u002Fv1\u002Fgenerate from Python","urllib (stdlib), requests, or httpx with retry — render PDFs from Django, FastAPI, or any Python service.",{"path":474,"title":475,"description":476,"category":477,"order":413},"\u002Fdocs\u002Fguides\u002Foperations\u002Fmonitoring-usage","Monitoring usage & credits","Read the dashboard gauges, set sane alerts, and decide when to top up vs. upgrade.","operations",{"path":479,"title":480,"description":481,"category":477,"order":399},"\u002Fdocs\u002Fguides\u002Foperations\u002Fstoring-pdfs","Storing & serving the generated PDF","The \u002Fv1\u002Fgenerate URL is signed and short-lived. Patterns for keeping the PDF around — your bucket, your CDN, your DB.",1780347733843]