[{"data":1,"prerenderedAt":444},["ShallowReactive",2],{"guide-\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fclaude-code":3,"guides-all":374},{"id":4,"title":5,"body":6,"category":365,"description":366,"extension":367,"icon":368,"meta":369,"navigation":265,"order":262,"path":370,"seo":371,"stem":372,"__hash__":373},"guides\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fclaude-code.md","Claude Code (CLI)",{"type":7,"value":8,"toc":354},"minimark",[9,14,18,23,49,53,56,100,107,112,119,158,165,169,172,181,184,192,203,207,210,216,223,232,236,306,310,322,328,332,350],[10,11,13],"h1",{"id":12},"claude-code","Claude Code",[15,16,17],"p",{},"Claude Code is Anthropic's CLI agent. It supports MCP natively and is ideal when you want the assistant inside the same terminal as your editor.",[19,20,22],"h2",{"id":21},"prerequisites","Prerequisites",[24,25,26,43],"ul",{},[27,28,29,30,34,35,42],"li",{},"Claude Code installed (",[31,32,33],"code",{},"npm install -g @anthropic-ai\u002Fclaude-code"," or ",[36,37,41],"a",{"href":38,"rel":39},"https:\u002F\u002Fdocs.claude.com\u002Fclaude-code",[40],"nofollow","official installer",")",[27,44,45,46,42],{},"A Transactional API token (",[31,47,48],{},"tk_live_…",[19,50,52],{"id":51},"add-the-server-one-liner","Add the server (one-liner)",[15,54,55],{},"Paste this single line in your terminal, with your token substituted in:",[57,58,63],"pre",{"className":59,"code":60,"language":61,"meta":62,"style":62},"language-bash shiki shiki-themes github-light github-dark","claude mcp add --transport http transactional https:\u002F\u002Fmcp.transactional.dev --header \"Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n","bash","",[31,64,65],{"__ignoreMap":62},[66,67,70,74,78,81,85,88,91,94,97],"span",{"class":68,"line":69},"line",1,[66,71,73],{"class":72},"sScJk","claude",[66,75,77],{"class":76},"sZZnC"," mcp",[66,79,80],{"class":76}," add",[66,82,84],{"class":83},"sj4cs"," --transport",[66,86,87],{"class":76}," http",[66,89,90],{"class":76}," transactional",[66,92,93],{"class":76}," https:\u002F\u002Fmcp.transactional.dev",[66,95,96],{"class":83}," --header",[66,98,99],{"class":76}," \"Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n",[15,101,102,103,106],{},"That's it. The config is written to ",[31,104,105],{},"~\u002F.claude.json"," and the server is connected on the next session.",[108,109,111],"h3",{"id":110},"project-scoped-variant-optional","Project-scoped variant (optional)",[15,113,114,115,118],{},"If multiple teammates work on the same repo and you want to share the connector config (without sharing the token), scope it to the project — it writes ",[31,116,117],{},".mcp.json"," in the current directory:",[57,120,122],{"className":59,"code":121,"language":61,"meta":62,"style":62},"claude mcp add --transport http --scope project transactional https:\u002F\u002Fmcp.transactional.dev --header \"Authorization: Bearer $TRANSACTIONAL_API_TOKEN\"\n",[31,123,124],{"__ignoreMap":62},[66,125,126,128,130,132,134,136,139,142,144,146,148,151,155],{"class":68,"line":69},[66,127,73],{"class":72},[66,129,77],{"class":76},[66,131,80],{"class":76},[66,133,84],{"class":83},[66,135,87],{"class":76},[66,137,138],{"class":83}," --scope",[66,140,141],{"class":76}," project",[66,143,90],{"class":76},[66,145,93],{"class":76},[66,147,96],{"class":83},[66,149,150],{"class":76}," \"Authorization: Bearer ",[66,152,154],{"class":153},"sVt8B","$TRANSACTIONAL_API_TOKEN",[66,156,157],{"class":76},"\"\n",[15,159,160,164],{},[161,162,163],"strong",{},"Don't commit the token."," Read it from an environment variable as shown above.",[19,166,168],{"id":167},"verify","Verify",[15,170,171],{},"Start a session:",[57,173,175],{"className":59,"code":174,"language":61,"meta":62,"style":62},"claude\n",[31,176,177],{"__ignoreMap":62},[66,178,179],{"class":68,"line":69},[66,180,174],{"class":72},[15,182,183],{},"Inside the REPL, run:",[57,185,190],{"className":186,"code":188,"language":189},[187],"language-text","\u002Fmcp\n","text",[31,191,188],{"__ignoreMap":62},[15,193,194,195,198,199,202],{},"You should see ",[31,196,197],{},"transactional"," listed as ",[161,200,201],{},"connected"," with five tools.",[19,204,206],{"id":205},"use-it","Use it",[15,208,209],{},"From the REPL:",[211,212,213],"blockquote",{},[15,214,215],{},"List my Transactional templates.",[15,217,218,219,222],{},"Claude will call ",[31,220,221],{},"list_documents",". Approve the tool call, and you'll see your templates. Same pattern for generating:",[211,224,225],{},[15,226,227,228],{},"Generate the welcome PDF for customer 'Acme Corp' using template ",[229,230,231],"uuid",{},".",[19,233,235],{"id":234},"removing-or-re-keying","Removing or re-keying",[57,237,239],{"className":59,"code":238,"language":61,"meta":62,"style":62},"# Remove the connector entirely\nclaude mcp remove transactional\n\n# Replace the token (remove + re-add, one-liner each)\nclaude mcp remove transactional\nclaude mcp add --transport http transactional https:\u002F\u002Fmcp.transactional.dev --header \"Authorization: Bearer tk_live_NEW\"\n",[31,240,241,247,260,267,273,284],{"__ignoreMap":62},[66,242,243],{"class":68,"line":69},[66,244,246],{"class":245},"sJ8bj","# Remove the connector entirely\n",[66,248,250,252,254,257],{"class":68,"line":249},2,[66,251,73],{"class":72},[66,253,77],{"class":76},[66,255,256],{"class":76}," remove",[66,258,259],{"class":76}," transactional\n",[66,261,263],{"class":68,"line":262},3,[66,264,266],{"emptyLinePlaceholder":265},true,"\n",[66,268,270],{"class":68,"line":269},4,[66,271,272],{"class":245},"# Replace the token (remove + re-add, one-liner each)\n",[66,274,276,278,280,282],{"class":68,"line":275},5,[66,277,73],{"class":72},[66,279,77],{"class":76},[66,281,256],{"class":76},[66,283,259],{"class":76},[66,285,287,289,291,293,295,297,299,301,303],{"class":68,"line":286},6,[66,288,73],{"class":72},[66,290,77],{"class":76},[66,292,80],{"class":76},[66,294,84],{"class":83},[66,296,87],{"class":76},[66,298,90],{"class":76},[66,300,93],{"class":76},[66,302,96],{"class":83},[66,304,305],{"class":76}," \"Authorization: Bearer tk_live_NEW\"\n",[19,307,309],{"id":308},"troubleshooting","Troubleshooting",[15,311,312,317,318,321],{},[161,313,314],{},[31,315,316],{},"MCP server transactional failed to connect"," — Token is wrong or the ",[31,319,320],{},"Authorization"," header isn't escaped properly in your shell. Wrap the value in single quotes if your token contains characters your shell interprets.",[15,323,324,327],{},[161,325,326],{},"Tools call but return empty results"," — The token belongs to an account with no documents. Create one in the dashboard first.",[19,329,331],{"id":330},"next-steps","Next steps",[24,333,334,342],{},[27,335,336],{},[161,337,338],{},[36,339,341],{"href":340},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fuse-from-ai#a-first-prompt-to-try","A first prompt to try →",[27,343,344],{},[161,345,346],{},[36,347,349],{"href":348},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Ftools-reference","MCP tools reference →",[351,352,353],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":62,"searchDepth":249,"depth":249,"links":355},[356,357,360,361,362,363,364],{"id":21,"depth":249,"text":22},{"id":51,"depth":249,"text":52,"children":358},[359],{"id":110,"depth":262,"text":111},{"id":167,"depth":249,"text":168},{"id":205,"depth":249,"text":206},{"id":234,"depth":249,"text":235},{"id":308,"depth":249,"text":309},{"id":330,"depth":249,"text":331},"ai-mcp","Connect Transactional to Claude Code so it can read your templates and generate PDFs from your terminal.","md","terminal",{},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fclaude-code",{"title":5,"description":366},"docs\u002Fguides\u002Fai-mcp\u002Fclaude-code","cvRlz7oHGzC8I4RfCJKBcjaDV2Ctrq9ddE1pULnGHmc",[375,379,380,384,388,392,396,400,405,409,413,417,422,427,431,435,440],{"path":376,"title":377,"description":378,"category":365,"order":275},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fchatgpt","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.",{"path":370,"title":5,"description":366,"category":365,"order":262},{"path":381,"title":382,"description":383,"category":365,"order":249},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fclaude-desktop","Claude Desktop","Connect Transactional to Claude Desktop on macOS or Windows so Claude can read your templates and generate PDFs.",{"path":385,"title":386,"description":387,"category":365,"order":269},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fcursor","Cursor","Wire Transactional into Cursor's MCP support so you can generate PDFs from inside your editor.",{"path":389,"title":390,"description":391,"category":365,"order":286},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fgemini","Gemini Code Assist \u002F Gemini CLI","Connect Transactional to Google's Gemini agents through their MCP support.",{"path":348,"title":393,"description":394,"category":365,"order":395},"MCP tools reference","Every tool the Transactional MCP server exposes, with arguments, return shapes, and a prompt that typically triggers each one.",7,{"path":397,"title":398,"description":399,"category":365,"order":69},"\u002Fdocs\u002Fguides\u002Fai-mcp\u002Fuse-from-ai","Use Transactional from your AI assistant","Connect Transactional to Claude, Cursor, ChatGPT, or Gemini via MCP so your assistant can read your templates and generate PDFs directly.",{"path":401,"title":402,"description":403,"category":404,"order":249},"\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":406,"title":407,"description":408,"category":404,"order":69},"\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":410,"title":411,"description":412,"category":404,"order":262},"\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":414,"title":415,"description":416,"category":404,"order":269},"\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":418,"title":419,"description":420,"category":421,"order":69},"\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":423,"title":424,"description":425,"category":426,"order":69},"\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":428,"title":429,"description":430,"category":426,"order":249},"\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":432,"title":433,"description":434,"category":426,"order":262},"\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":436,"title":437,"description":438,"category":439,"order":69},"\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":441,"title":442,"description":443,"category":439,"order":249},"\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.",1780347733845]