What you'll build
By the end of this guide, your AI agent will be able to:
- Accept a request like "Generate a proposal for Acme Corporation"
- Automatically extract Acme's brand from their website
- Generate a professionally branded proposal document
- Return a PDF link and shareable web URL in under 5 seconds total
This works for Claude, ChatGPT, Cursor, and any MCP-compatible agent framework.
Option A: Claude, ChatGPT, or Cursor (zero code)
If you use Claude, ChatGPT Pro/Business, or Cursor, you can add DocRocket as an MCP connector with no code at all:
- Sign up at app.docrocket.ai (email only, 30-day trial)
- Add the connector: In your AI's settings, add a custom MCP server at
https://mcp.docrocket.ai/v1/mcp-tools/docrocket-control/mcp - Sign in via OAuth when prompted
- Test: "Generate a proposal for Acme Corporation"
See the step-by-step guides: Claude · ChatGPT · Cursor
Option B: Custom agent (LangChain, LlamaIndex, CrewAI, etc.)
For custom agents, connect the DocRocket MCP server programmatically.
Python (MCP SDK)
from mcp import MCPClient import os # Obtain OAuth token via your app's auth flow DR_TOKEN = os.environ["DOCROCKET_OAUTH_TOKEN"] client = MCPClient( "https://mcp.docrocket.ai/v1/mcp-tools/docrocket-control/mcp", token=DR_TOKEN, ) # Extract brand from customer's website (first time only) brand = client.call("docrocket_brand_from_url", url="https://acme.com") brand_id = brand["brand_id"] # store this in your DB # Generate a branded proposal doc = client.call("docrocket_generate_document", brand_id=brand_id, template="proposal", content={ "title": "Partnership Proposal — Acme Corporation", "sections": [ {"heading": "Executive Summary", "body": "..."}, {"heading": "Solution Overview", "body": "..."}, {"heading": "Pricing", "component": "pricing_table"}, ] }) print(doc["web_url"]) # docs.docrocket.ai/d/abc123 print(doc["pdf_url"]) # docs.docrocket.ai/d/abc123.pdf
Best practices
- Cache brand IDs: Store the
brand_idin your database after the first extraction. On subsequent document generation calls for that customer, pass the stored ID — no re-crawling needed. - Re-extract on customer rebrand: If a customer updates their website design, call
docrocket_brand_from_urlagain to get an updated brand profile. - List templates first: Call
docrocket_list_templatesonce at startup to see all available templates and their required content fields. Pass this list to your AI as context so it knows what it can generate. - Use components: Define reusable blocks (pricing tables, signature sections) once in app.docrocket.ai. Your agent references them by name — DocRocket handles rendering.
A complete example: sales proposal agent
Here's a more complete pattern for a sales proposal agent that handles the brand caching correctly:
from mcp import MCPClient from your_db import get_customer, update_customer client = MCPClient("https://mcp.docrocket.ai/v1/mcp-tools/docrocket-control/mcp", token=DR_TOKEN) async def generate_proposal(customer_id: str, ai_content: dict) -> dict: customer = await get_customer(customer_id) # Use cached brand ID or extract for the first time if not customer.docrocket_brand_id: brand = client.call("docrocket_brand_from_url", url=customer.website_url) await update_customer(customer_id, docrocket_brand_id=brand["brand_id"]) brand_id = brand["brand_id"] else: brand_id = customer.docrocket_brand_id # Generate document — AI has already written the content doc = client.call("docrocket_generate_document", brand_id=brand_id, template="proposal", content=ai_content) return {"url": doc["web_url"], "pdf": doc["pdf_url"]}
Ready to start? Sign up for a free 30-day trial at app.docrocket.ai — no credit card. Connect your AI and generate your first branded document in under 5 minutes.