Skip to content

MCP Server

The Glyph MCP (Model Context Protocol) server enables AI coding assistants to generate and customize PDFs using natural language. It exposes 18 tools across four categories: document generation, discovery, saved templates, and data sources.

Model Context Protocol is an open standard created by Anthropic that lets AI assistants connect to external tools and data sources. Instead of copying code snippets or switching between apps, your AI assistant calls tools directly.

With the Glyph MCP server, you can say:

“Create an invoice for Acme Corp, add a QR code for payment, and save it as invoice.pdf”

Your AI assistant handles the entire flow: creating the session, applying modifications, and generating the final PDF.

Add to ~/.claude/settings.json:

{
"mcpServers": {
"glyph": {
"command": "npx",
"args": ["@glyphpdf/mcp-server"],
"env": {
"GLYPH_API_KEY": "your-api-key"
}
}
}
}

Add to .cursor/mcp.json in your project root:

{
"mcpServers": {
"glyph": {
"command": "npx",
"args": ["@glyphpdf/mcp-server"],
"env": {
"GLYPH_API_KEY": "your-api-key"
}
}
}
}

Add to your Windsurf MCP configuration:

{
"mcpServers": {
"glyph": {
"command": "npx",
"args": ["@glyphpdf/mcp-server"],
"env": {
"GLYPH_API_KEY": "your-api-key"
}
}
}
}
  1. Visit glyph.you
  2. Sign up or log in
  3. Navigate to the Dashboard
  4. Create a new API key

All tools accept an optional apiKey parameter. If omitted, the GLYPH_API_KEY environment variable is used.


The MCP server exposes 18 tools organized into four categories:

CategoryToolsPurpose
Document Generationglyph_preview, glyph_modify, glyph_generate, glyph_create, glyph_analyzeCreate, modify, and export PDFs
Discoveryglyph_schema, glyph_templates, glyph_suggestExplore templates and get recommendations
Saved Templatesglyph_templates_list, glyph_template_save, glyph_template_get, glyph_template_update, glyph_template_deletePersist and manage reusable templates
Data Sourcesglyph_create_source, glyph_list_sources, glyph_generate_from_source, glyph_suggest_mappings, glyph_link_templateConnect Airtable, REST APIs, and webhooks

The fastest path to a PDF. Send any JSON data with an optional natural language intent, and Glyph auto-detects the document type, maps fields, and generates the output.

ParameterTypeRequiredDescription
dataobjectYesYour data in any structure
intentstringNoNatural language description (e.g., “professional invoice”, “modern proposal”)
stylestringNoStyle preset: professional-clean, bold, minimal, corporate, quote-modern (default)
formatstringNoOutput format: pdf (default), png, html
outputPathstringNoFile path to save the output
glyph_create({
data: {
customer: { name: "Acme Corp", email: "billing@acme.com" },
items: [
{ description: "API Integration", quantity: 1, price: 5000, total: 5000 },
{ description: "Support Plan", quantity: 12, price: 200, total: 2400 }
],
subtotal: 7400,
tax: 592,
total: 7992
},
intent: "professional invoice with clean styling",
style: "professional-clean",
outputPath: "./invoice-acme.pdf"
})

The AI automatically detects the document type from your data:

TypeDetection Signals
Invoiceitems, total, tax, dueDate, invoiceNumber
Quoteitems, total, validUntil, quoteNumber
Receiptitems, paid, transactionId, paymentMethod
Contractcontract, agreement, terms, signature, parties
Reportsummary, metrics, analysis, findings

Create a preview session from a template and data. Returns a sessionId used by all subsequent tools.

ParameterTypeRequiredDescription
dataobjectYesData to render into the template
templatestringNoTemplate name or "auto" (default) to auto-detect
glyph_preview({
template: "quote-modern",
data: {
client: { name: "John Doe", email: "john@example.com" },
lineItems: [
{ description: "Website Design", quantity: 1, unitPrice: 3500, total: 3500 }
],
totals: { subtotal: 3500, total: 3500 },
meta: { quoteNumber: "Q-001", date: "January 15, 2025" },
branding: { companyName: "Your Company" }
}
})
// Returns: { sessionId: "abc123", html: "..." }

Modify a document using natural language. Chain multiple calls to build up changes.

ParameterTypeRequiredDescription
sessionIdstringYesSession ID from glyph_preview or glyph_create
instructionstringYesNatural language description of the change
regionstringNoFocus area: header, footer, table, etc.
// Add visual elements
glyph_modify({
sessionId: "abc123",
instruction: "Add a QR code for payment in the footer"
})
// Change styling
glyph_modify({
sessionId: "abc123",
instruction: "Make the header more prominent with a blue gradient",
region: "header"
})
// Add content
glyph_modify({
sessionId: "abc123",
instruction: "Add a watermark that says DRAFT"
})
// Adjust layout
glyph_modify({
sessionId: "abc123",
instruction: "Make the line items table more compact"
})

Generate the final PDF or PNG from a session.

ParameterTypeRequiredDescription
sessionIdstringYesSession ID
formatstringNopdf (default) or png
outputPathstringNoFile path to save output. If omitted, returns base64 data URL.
optionsobjectNowidth, height (pixels), scale (0.1-3)
glyph_generate({
sessionId: "abc123",
format: "pdf",
outputPath: "./quote-john-doe.pdf"
})
// Returns: { savedTo: "./quote-john-doe.pdf", size: "45.2 KB" }

Analyze a data structure without generating a PDF. Useful for debugging or previewing how Glyph interprets your data.

ParameterTypeRequiredDescription
dataobjectYesData to analyze
intentstringNoOptional intent to influence analysis
glyph_analyze({
data: {
customer: { name: "Jane Smith" },
items: [{ description: "Consulting", hours: 40, rate: 150 }],
total: 6000
},
intent: "invoice"
})
// Returns: {
// documentType: "invoice",
// confidence: "92%",
// suggestedTemplate: "invoice-clean",
// fieldMappings: [
// { detected: "customer", mapsTo: "client", confidence: "95%" },
// { detected: "items", mapsTo: "lineItems", confidence: "98%" }
// ],
// missingFields: [{ field: "invoiceNumber", reason: "Standard invoice identifier" }]
// }

List all available document templates and style presets.

glyph_templates()
// Returns: { templates: [...], styles: [...] }

Get the data schema for a specific template, including field types, required fields, and examples.

ParameterTypeRequiredDescription
templatestringYesTemplate name (e.g., quote-modern, invoice-clean)
glyph_schema({ template: "quote-modern" })
// Returns: { fields: [...], required: [...], example: {...} }

Get AI-powered improvement suggestions for a document session. Analyzes design, content, and professional touches.

ParameterTypeRequiredDescription
sessionIdstringYesSession ID
glyph_suggest({ sessionId: "abc123" })
// Returns suggestions like:
// - "Add a company logo to make the document more professional" (Branding, high)
// - "Add payment terms and conditions" (Legal, high)
// - "Add a QR code for quick mobile payment" (Modern, low)

Save templates for reuse without AI regeneration. Saved templates are faster, consistent, and versioned.

List all saved templates for your API key.

ParameterTypeRequiredDescription
typestringNoFilter by type: invoice, quote, report, certificate, letter, receipt, contract, custom
limitnumberNoMax results (default 50, max 100)
glyph_templates_list({ type: "invoice" })
// Returns: { templates: [{ id: "tmpl_xxx", name: "Invoice v1", type: "invoice", ... }], total: 3 }

Save a template for reuse.

ParameterTypeRequiredDescription
namestringYesTemplate name
htmlstringYesFull HTML with Mustache placeholders (e.g., {{client.name}})
typestringNoTemplate type for organization
descriptionstringNoDescription
stylestringNoStyle preset: professional-clean, professional, minimal, bold, classic, corporate, modern, vibrant
isDefaultbooleanNoMake this the default for its type
glyph_template_save({
name: "Invoice v2",
html: "<html>...{{client.name}}...</html>",
type: "invoice",
style: "professional-clean",
isDefault: true
})
// Returns: { template: { id: "tmpl_xxx", name: "Invoice v2", version: 1 } }

Retrieve a saved template by ID, including full HTML.

ParameterTypeRequiredDescription
idstringYesTemplate ID (UUID from glyph_templates_list)
glyph_template_get({ id: "tmpl_xxx" })
// Returns: { template: { id, name, html, type, schema, ... } }

Update a saved template. Only include fields you want to change.

ParameterTypeRequiredDescription
idstringYesTemplate ID
namestringNoNew name
htmlstringNoUpdated HTML
typestringNoTemplate type
descriptionstringNoDescription
stylestringNoStyle preset
isDefaultbooleanNoSet as default
glyph_template_update({
id: "tmpl_xxx",
html: "<html>...updated...</html>",
isDefault: true
})
// Returns: { template: { id, name, version: 2, updatedAt: "..." } }

Permanently delete a saved template.

ParameterTypeRequiredDescription
idstringYesTemplate ID
glyph_template_delete({ id: "tmpl_xxx" })
// Returns: { deleted: true }

Connect external data sources and generate PDFs directly from your data, without manually passing JSON.

Connect a data source for PDF generation.

ParameterTypeRequiredDescription
typestringYesairtable, rest_api, or webhook
namestringYesHuman-readable name
configobjectYesType-specific configuration (see below)

Airtable config:

glyph_create_source({
type: "airtable",
name: "Invoices Table",
config: {
apiKey: "pat...",
baseId: "app...",
tableName: "Invoices"
}
})

REST API config:

glyph_create_source({
type: "rest_api",
name: "Orders API",
config: {
url: "https://api.example.com/orders",
headers: { "Authorization": "Bearer ..." }
}
})

Webhook config:

glyph_create_source({
type: "webhook",
name: "Order Webhook",
config: {}
})

List all connected data sources.

ParameterTypeRequiredDescription
typestringNoFilter by source type: airtable, rest_api, webhook
glyph_list_sources({ type: "airtable" })
// Returns: { sources: [{ id: "src_xxx", type: "airtable", name: "Invoices Table", status: "active" }] }

Get AI-powered field mapping suggestions between a template and data source.

ParameterTypeRequiredDescription
templateIdstringYesTemplate ID
sourceIdstringYesData source ID
glyph_suggest_mappings({
templateId: "tmpl_xxx",
sourceId: "src_xxx"
})
// Returns: {
// suggestions: [
// { templateField: "client.name", sourceField: "Customer Name", confidence: "95%", reason: "Semantic match" },
// { templateField: "total", sourceField: "Invoice Total", confidence: "90%", reason: "Field name similarity" }
// ],
// unmappedTemplateFields: ["meta.terms"],
// unmappedSourceFields: ["Internal Notes"]
// }

Link a template to a data source with field mappings.

ParameterTypeRequiredDescription
templateIdstringYesTemplate ID
sourceIdstringYesData source ID
fieldMappingsobjectYesMap of template placeholder to source field name
isDefaultbooleanNoSet as default source for this template
glyph_link_template({
templateId: "tmpl_xxx",
sourceId: "src_xxx",
fieldMappings: {
"client.name": "Customer Name",
"client.email": "Email Address",
"total": "Invoice Total"
},
isDefault: true
})

Generate PDFs from a saved template and connected data source.

ParameterTypeRequiredDescription
templateIdstringYesSaved template ID
sourceIdstringNoData source ID (uses default if omitted)
recordIdstringNoSpecific record ID for single PDF
filterobjectNoformula (Airtable formula syntax) and limit for batch generation
outputPathstringNoFile path for single-record output
// Single record
glyph_generate_from_source({
templateId: "tmpl_xxx",
recordId: "rec_abc",
outputPath: "./invoice-abc.pdf"
})
// Batch with filter
glyph_generate_from_source({
templateId: "tmpl_xxx",
filter: {
formula: "AND({Status} = 'Pending', {Date} >= '2025-01-01')",
limit: 50
}
})
// Returns: { generated: [...], total: 12 }

The server exposes these read-only resources accessible via resource:// URIs:

ResourceDescription
glyph://templatesList of available templates
glyph://schema/{templateId}Schema for a specific template
glyph://session/{sessionId}/previewCurrent HTML preview of a session
glyph://session/{sessionId}/dataOriginal data passed to the session
glyph://session/{sessionId}/infoSession metadata (template, creation time)

You: Create an invoice for Acme Corp. 3 line items: API integration ($5,000),
custom dashboard ($3,000), training ($1,500). Due in 30 days.
AI: [glyph_create] -> Detects invoice, generates PDF
Saved to ./invoice-acme-corp.pdf (52 KB)
You: Use the quote-modern template for a proposal to Jane Smith.
Make it look clean and professional. Add a QR code.
AI: [glyph_preview] -> Creates session with quote-modern template
[glyph_modify] -> "Apply clean, professional design"
[glyph_modify] -> "Add a QR code for payment in the footer"
[glyph_generate] -> Exports final PDF
You: Connect my Airtable invoices table and generate PDFs for all
pending invoices this month.
AI: [glyph_create_source] -> Connects Airtable
[glyph_templates_list] -> Finds your saved invoice template
[glyph_suggest_mappings] -> Gets field mapping suggestions
[glyph_link_template] -> Links template to source
[glyph_generate_from_source] -> Generates PDFs for matching records
Generated 12 PDFs from 12 records.
You: Save this template as "Invoice v2" so I can reuse it.
AI: [glyph_template_save] -> Saves with name "Invoice v2", type "invoice"
Template saved with ID tmpl_xxx. Use it with glyph_create or
glyph_generate_from_source for instant PDF generation.

Make sure GLYPH_API_KEY is set in your MCP configuration’s env block, or pass apiKey directly to each tool call.

Use glyph_templates() to list available templates, or use "auto" for automatic template detection.

Sessions expire after 1 hour. Create a new session with glyph_preview or glyph_create.

Verify your internet connection and that api.glyph.you is accessible:

Terminal window
curl https://api.glyph.you/health