---
source: https://carbone.io/integration/grok.html
title: "Grok Document Generation, Generate PDF, DOCX, XLSX from Your Word, Excel, PowerPoint Templates with Carbone"
description: "Connect Grok and the Grok Build CLI to Carbone. Bring your own MCP server and load the Carbone Skill so Grok writes correct Carbone templates and renders branded PDF, DOCX, XLSX, and PPTX from your Word, Excel, and PowerPoint designs."
generated_at: "2026-07-07"
---

# Grok

![grok logo](/integration/grok/logo.svg)

![Carbone logo](/img/carbone_icon_v3_github.png)

Generate branded PDF, Word, Excel and PowerPoint documents from Grok and the Grok Build CLI with the Carbone Skill and MCP server.

**[Set up the Carbone MCP](/documentation/developer/ai/mcp.md)**

## Generate real Office documents with Grok and Carbone

Grok speaks both of Carbone's AI surfaces. Its "bring your own MCP" support connects Grok and the Grok Build CLI to the Carbone MCP server, and it reads the open Agent Skills standard, so the Carbone Skill loads with zero config. Ask Grok for an invoice in DOCX, a contract in PDF, a quarterly report in XLSX, and Carbone renders it from one JSON payload into the template your team designed in Word, Excel, or PowerPoint.

Why Grok users choose Carbone:

-   **Bring your own MCP.** Grok and the Grok Build CLI support the Model Context Protocol. Point Grok at the Carbone MCP server and it can render, convert, and manage documents from the chat or the terminal, alongside your other connectors.
-   **Skill-compatible, zero config.** Grok reads the open Agent Skills standard, the same `SKILL.md` and `.claude` ecosystem as Claude Code. Drop in the Carbone Skill and Grok writes correct Carbone tags on the first try.
-   **Design templates in Word, Excel, or PowerPoint**, or in HTML or Markdown. No proprietary editor, and no code-only templating syntax like Handlebars or Jinja to learn. Your team owns the design; Grok fills in the data.
-   **100+ output formats.** PDF, DOCX, XLSX, PPTX, ODT, ODS, CSV, HTML, Markdown, JPEG, PNG. Real editable Office files, not screenshots embedded in a DOCX wrapper.
-   **Deterministic and predictable at scale.** One Carbone template plus one JSON payload produces the exact same document every time, at predictable subscription pricing, not a per-token bill.
-   **Battle-tested in production.** Carbone powers document workflows in finance, legal, healthcare, and the public sector.

**[Set up the Carbone MCP](/documentation/developer/ai/mcp.md)** **[Install the Carbone Skill](/documentation/developer/ai/skills.md#installation-grok)**

![Generate real Office documents with Grok and Carbone illustration](/integration/grok/image1.webp)

## Grok document generation workflows: invoices, contracts, and reports

-   **Grok Build automation.** Use xAI's agentic CLI to script document pipelines: Grok structures the data and Carbone renders the batch of branded PDF, DOCX, or XLSX files, end to end from the terminal.
-   **Real-time data to document.** Grok's live data access pulls the latest figures; Carbone renders the statement, report, or rider document from your approved template.
-   **Invoice and quote generation at scale.** "An invoice with line items, a conditional VAT row, the total in euros, and the VAT line hidden for exempt customers." Grok writes valid Carbone tags; Carbone renders thousands per hour.
-   **Migrate from Conga Composer, PDF Butler, JasperReports, Apache POI, Aspose, Docxtemplater, Jinja, or Handlebars.** Grok rewrites legacy template syntax into clean Carbone tags.
-   **Fix and validate templates.** Paste a broken Carbone tag into Grok, get a working one back, checked before you render. No support ticket.
-   **Render directly from the chat.** With the Carbone MCP, Grok calls Carbone and returns the finished PDF, DOCX, XLSX, or PPTX in the same conversation.

**[Browse template examples](/examples/index.md)** **[See all supported formats](/documentation/design/overview/template-feature.md)**

![Grok document generation workflows: invoices, contracts, and reports illustration](/integration/grok/image2.webp)

## Grok to PDF: turn HTML or Markdown into a polished document

Grok and the Grok Build CLI are strong HTML and Markdown authors, and Carbone renders both as native template formats. Ask Grok to draft an investor report, a resume, or a product datasheet in HTML or Markdown, then hand the result to Carbone: one API call returns a print-ready PDF (or DOCX, ODT) with page breaks, headers, footers, loops, conditions, and your brand styles.

Reach for this pattern when you don't need a pre-existing Office template, for example one-off documents, marketing collateral, or technical brochures.

See the [HTML templates](/documentation/design/template-formats/html.md) and [Markdown templates](/documentation/design/template-formats/markdown.md) guides for the syntax and best practices.

![Grok to PDF: turn HTML or Markdown into a polished document illustration](/integration/grok/image3.webp)

## Where AI-native file generation falls short

Letting an AI build the whole file is great for a one-off draft. For production document workflows, three things break, and Carbone fixes each:

✗ **Not repeatable.** The same prompt yields a different file each run, with layout, fonts, and branding drifting from page to page, so testing, versioning, and automation fall apart.  
✓ **Carbone** renders the same document every time from one template and one JSON payload.

✗ **Fragile, locked-down files.** AI output can look fine yet refuse to open cleanly, break its own formulas, or flatten tables and text into images you cannot edit.  
✓ **Carbone** fills a real Office template instead of writing the file from scratch, so every result is structurally valid and fully editable.

✗ **Expensive at scale.** Generating full documents burns tens of thousands of tokens each, and a small edit regenerates large sections.  
✓ **Carbone** uses predictable pricing instead, a fixed document quota, usage-based billing, or a flat rate for unlimited rendering.

Bottom line: Grok helps you draft the template and the wording; Carbone handles the part that has to be exact, merging your data to produce the same document every time.

![Where AI-native file generation falls short illustration](/integration/grok/image4.webp)

## Carbone Skill and MCP: render documents from Grok and Grok Build

The Carbone Skill is the knowledge layer. Because Grok supports the open Agent Skills standard, the Carbone Skill loads without modification and teaches Grok the full Carbone templating language: tag syntax, formatters, conditions, loops, `:set` patterns, HTML and Markdown templates, and best practices. Grok then writes correct Carbone templates on the first try, and knows how to populate yours.

The Carbone MCP server is the action layer, a document generation MCP for AI agents. With Grok's bring-your-own-MCP support, point it at the Carbone MCP server and Grok can upload templates, render documents, convert formats, and manage your template storage, from the chat or the Grok Build CLI.

Use the Skill on its own to design and fix templates. Add the MCP when you want Grok to render the finished document end to end.

**[Learn more about the Carbone Skill](/documentation/developer/ai/skills.md#installation-grok)** **[Learn more about the Carbone MCP](/documentation/developer/ai/mcp.md)**

![Carbone Skill and MCP: render documents from Grok and Grok Build illustration](/integration/grok/image5.webp)

## Document automation at scale

Once your template is ready, plug Carbone into [n8n](/integration/n8n.md), [Make](/integration/make.md), [Zapier](/integration/zapier.md), [Salesforce](/integration/salesforce.md), [HubSpot](/integration/hubspot.md), [Odoo](/integration/odoo.md), or any of our [other integrations](/integration/index.md). Build the template once with Grok, generate documents at scale, automatically.

**[See all integrations](/integration/index.md)**

![Document automation at scale illustration](/integration/grok/image6.webp)

## Carbone works with every AI assistant

Explore the dedicated pages for [Claude](/integration/claude.md), [ChatGPT](/integration/chatgpt.md), [Cursor](/integration/cursor.md), [Microsoft Copilot](/integration/copilot.md), [Google Gemini](/integration/gemini.md), [Vibe by Mistral](/integration/vibe.md), [Meta Llama](/integration/llama.md), and [DeepSeek](/integration/deepseek.md).

![Carbone works with every AI assistant illustration](/integration/grok/image7.webp)

## Trusted by 800+ paid customers in 40+ countries

## Related topics

- [Zapier](/integration/zapier.md)
- [Vibe](/integration/vibe.md)
- [Subnoto](/integration/subnoto.md)
- [Salesforce](/integration/salesforce.md)
- [Retool](/integration/retool.md)
- [Python](/integration/python.md)
