Skip to content

iterationlayer/mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

The Iteration Layer API includes a built-in Model Context Protocol (MCP) server. MCP lets AI agents like Claude Desktop, Cursor, and Windsurf call the API directly as tools — no custom integration code required.

Server Endpoint

The MCP server is available via Streamable HTTP transport:

https://api.iterationlayer.com/mcp

Authentication

The MCP endpoint uses OAuth 2.1 — not API keys. Your MCP client handles the authentication flow automatically. When you first use an Iteration Layer tool, a browser window will open for you to log in and authorize access.

Available Tools

The MCP server exposes one tool per Iteration Layer API:

convert_document_to_markdown

Convert a document or image to clean markdown. Supports PDF, DOCX, XLSX, images (PNG, JPG, GIF, WebP), HTML, Markdown, CSV, JSON, and plain text.

Parameters:

  • file (required) — File input with type, name, and either base64 or url

See Document to Markdown for the full API reference.

extract_document

Extract structured data from documents using AI. Supports PDF, DOCX, images (PNG, JPG, GIF, WebP), and text files (MD, TXT, CSV, JSON).

Parameters:

  • files (required) — Array of file inputs (each with type, name, and either base64 or url)
  • schema (required) — Extraction schema with a fields array defining what to extract

See Document Extraction for the full schema reference.

transform_image

Transform and manipulate images. Supported operations: resize, crop, extend, trim, rotate, flip, flop, blur, sharpen, modulate, tint, grayscale, invertColors, autoContrast, gamma, removeTransparency, threshold, denoise, opacity, convert, upscale, smartCrop, compressToSize, removeBackground.

Parameters:

  • file (required) — File input with type, name, and either base64 or url
  • operations (required) — Array of transformation operations to apply in order

See Image Transformation for the full operations reference.

generate_image

Generate images from layer compositions. Layer types: solid-color, gradient, text (with Markdown bold/italic), image, qr-code, barcode, and layout (nested flex-like container with direction, gap, alignment, and padding). Layers are composited by index order with per-layer opacity and rotation.

See Image Generation for the full composition schema.

generate_document

Generate PDF, DOCX, PPTX, or EPUB documents from structured definitions. Documents are composed of metadata, page settings, styles, and content blocks (paragraph, headline, image, table, grid, list, table-of-contents, page-break, separator, QR code, barcode).

See Document Generation for the full document schema.

generate_sheet

Generate XLSX, CSV, or Markdown spreadsheets from structured tabular data. Define columns and positional rows of cells with optional formatting (currency, percentage, number, decimal, date, datetime, time, custom), cell styles, merged cell spans, and Excel formulas. Supports multiple sheets, ISO 4217 currency codes, and custom fonts.

See Sheet Generation for the full schema reference.

Client Setup

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "iterationlayer": {
      "type": "http",
      "url": "https://api.iterationlayer.com/mcp"
    }
  }
}

Cursor

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "iterationlayer": {
      "type": "http",
      "url": "https://api.iterationlayer.com/mcp"
    }
  }
}

Windsurf

Add to your Windsurf MCP configuration:

{
  "mcpServers": {
    "iterationlayer": {
      "type": "http",
      "url": "https://api.iterationlayer.com/mcp"
    }
  }
}

How Input and Output Formats Work

Every tool follows the same file input convention:

{
  "type": "url",
  "name": "document.pdf",
  "url": "https://example.com/document.pdf"
}

Or for inline content:

{
  "type": "base64",
  "name": "document.pdf",
  "base64": "JVBERi0xLjQK..."
}

Every tool that produces binary output (images, documents, spreadsheets) returns the same structure:

{
  "buffer": "base64-encoded-content",
  "mime_type": "application/pdf"
}

This consistency matters for composability. The output format of generate_image matches the input format of generate_document's image blocks. The agent does not need to convert between formats or understand format-specific encoding.

Composability Patterns

All tools share a single endpoint, the same authentication, the same credit pool, and compatible I/O formats. This makes multi-step agent workflows natural.

Extract and Report

Extract structured data from a document, then generate a report from the extracted data.

Flow: extract_document → application logic → generate_document

The extraction returns structured JSON. The document generation accepts structured JSON. No format conversion, no intermediate files. The agent reads the extraction result, builds a document definition from it, and generates the output.

Convert, Extract, and Generate

When the document needs to be understood as a whole, convert it to markdown first, then extract specific data, then generate output.

Flow: convert_document_to_markdownextract_documentgenerate_document or generate_sheet

The markdown conversion gives the agent the full document text for context. The extraction pulls specific structured fields. This pattern works well when the agent needs to both summarize content (from the markdown) and pull precise values (from the extraction).

Extract, Transform, and Compose

Combine document data with processed images to create visual output.

Flow: extract_documenttransform_imagegenerate_image

The extraction provides the data (product name, price, description). The image transformation prepares visual assets (resize, background removal, format conversion). The image generation composites everything into a final visual.

Batch Extract to Spreadsheet

Process multiple documents and aggregate results into a single spreadsheet.

Flow: extract_document (multiple calls) → generate_sheet

Each extraction returns structured data for one document. The agent collects the results and generates a spreadsheet with one row per document. Confidence scores can be included as a column for filtering.

Agent Use Cases

Invoice Processing Pipeline

The agent extracts vendor name, invoice number, line items, totals, and payment terms from supplier invoices. It evaluates confidence scores, generates a PDF summary for approved invoices and a review report for flagged ones, then exports the batch to an XLSX spreadsheet for accounting.

Tools used: extract_document → confidence routing → generate_document (summary or review) → generate_sheet (batch export)

Content Repurposing

The agent converts a long-form PDF whitepaper to markdown, extracts the title, author, key takeaways, and statistics, generates a social card image with the title and a branded gradient, and generates a one-page PDF executive summary.

Tools used: convert_document_to_markdownextract_documentgenerate_image (social card) → generate_document (summary)

Product Catalog Processing

The agent extracts product names, descriptions, prices, and SKUs from a supplier catalog PDF. It takes each product photo, removes the background, resizes to marketplace-required dimensions, and converts to WebP. It then generates product card images with standardized layouts.

Tools used: extract_documenttransform_image (per product) → generate_image (per product)

Contract Review Preparation

The agent converts a contract to markdown for full-text review, extracts structured data (parties, effective date, termination clauses, payment terms, governing law), and generates a review checklist as a DOCX with the extracted terms pre-filled and blank fields for reviewer notes.

Tools used: convert_document_to_markdownextract_documentgenerate_document

How MCP Tools Map to SDK Methods

MCP is ideal for interactive agent workflows — Claude Code sessions, Cursor conversations, ad-hoc processing tasks. For production pipelines, the same tools are available through the TypeScript, Python, and Go SDKs.

MCP Tool TypeScript Python Go
convert_document_to_markdown client.convertToMarkdown() client.convert_to_markdown() client.ConvertToMarkdown()
extract_document client.extract() client.extract() client.Extract()
transform_image client.transform() client.transform() client.Transform()
generate_image client.generateImage() client.generate_image() client.GenerateImage()
generate_document client.generateDocument() client.generate_document() client.GenerateDocument()
generate_sheet client.generateSheet() client.generate_sheet() client.GenerateSheet()

Every method also has an async variant that accepts a webhook_url for non-blocking processing:

TypeScript Python Go
client.extractAsync() client.extract_async() client.ExtractAsync()
client.transformAsync() client.transform_async() client.TransformAsync()
client.generateImageAsync() client.generate_image_async() client.GenerateImageAsync()
client.generateDocumentAsync() client.generate_document_async() client.GenerateDocumentAsync()
client.generateSheetAsync() client.generate_sheet_async() client.GenerateSheetAsync()

The parameters, request shapes, and response shapes are identical between MCP and SDK. A workflow prototyped in Claude Code via MCP translates directly to production code via the SDK.

Listings

Find the Iteration Layer MCP server on these directories:

Billing

MCP tool calls consume credits the same way as direct API calls. See Credits & Pricing for details.

About

Remote MCP server for document extraction, image transformation, image generation, document generation, and sheet generation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors