Parse Documents Inside Claude and Cursor with MCP — No Code Required

8 min read Document Extraction

The Copy-Paste-Parse Loop

You get a PDF from a client. You need three fields out of it — an invoice number, a date, and a total. So you open the PDF, squint at the layout, copy the values, paste them into a spreadsheet, and move on to the next one. Multiply that by fifty documents a week and you’ve got a full afternoon gone.

Developers automate this with API calls. But what if your AI assistant could just do it for you — right inside the tool you’re already using?

That’s what MCP makes possible. The Model Context Protocol is an open standard that lets AI assistants like Claude and Cursor discover and call external tools directly. Instead of writing integration code, you describe what you want in plain language. The assistant figures out which tool to call, sends the request, and hands you the result.

Iteration Layer’s Document Extraction ships as an MCP server. Connect it once, and every conversation with your AI assistant becomes a document parsing session.

What MCP Actually Is

MCP stands for Model Context Protocol. It’s a standard that lets AI clients — Claude Desktop, Cursor, and any MCP-compatible tool — connect to external services as “tools” the model can invoke.

Think of it like USB for AI assistants. You plug in a service, the assistant discovers what it can do, and it starts using it when relevant. No SDK integration, no API wrapper code, no deployment scripts.

When you connect the Document Extraction as an MCP server, your assistant gains the ability to:

  • Accept a document (PDF, DOCX, image, or URL)
  • Define an extraction schema on the fly
  • Return structured JSON with confidence scores

All from a chat prompt.

Setting Up in Claude Code

Claude Code supports MCP servers natively. Add the Iteration Layer server with a single command:

claude mcp add iterationlayer --transport streamablehttp https://api.iterationlayer.com/mcp

The first time you use an Iteration Layer tool, a browser window opens for OAuth authentication. Log in, authorize access, and you’re connected. No API keys to manage.

To verify the server is available, start a conversation and ask Claude Code what MCP tools it has access to. You should see extract_document listed among the available tools.

Setting Up in Cursor

Add to your .cursor/mcp.json:

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

Save and restart. The Document Extraction tool is now available in your Cursor AI conversations. Authentication works the same way — OAuth in the browser on first use.

How Tool Discovery Works

When your AI assistant starts a conversation, it queries all connected MCP servers to learn what tools are available. The Document Extraction MCP server advertises an extract_document tool with a description of its capabilities — accepted file types, schema structure, field types, and limits.

The assistant reads this tool description and knows when to use it. If you mention a document, ask for extraction, or upload a file, the assistant recognizes that the Document Extraction is the right tool. You never need to tell it “use the Document Extraction” — it figures that out from context.

This is the key difference from a traditional API integration. You don’t write code to call the parser. You don’t map fields manually. The assistant handles the translation between your natural language request and the structured API call.

Parsing Documents Conversationally

Once connected, you talk to the parser in natural language. Here’s what that looks like.

You upload a PDF invoice and type:

“Extract the invoice number, vendor name, date, line items with descriptions and amounts, and the total from this invoice.”

The assistant translates that into a schema, calls the Document Extraction API, and returns structured JSON:

{
  "invoiceNumber": {
    "value": "INV-2026-0847",
    "confidence": 0.97
  },
  "vendorName": {
    "value": "Acme Supplies Ltd.",
    "confidence": 0.95
  },
  "invoiceDate": {
    "value": "2026-02-15",
    "confidence": 0.98
  },
  "lineItems": {
    "value": [
      [
        { "value": "Office chairs (x4)", "confidence": 0.94 },
        { "value": 1200.00, "confidence": 0.96 }
      ],
      [
        { "value": "Standing desks (x2)", "confidence": 0.93 },
        { "value": 890.00, "confidence": 0.95 }
      ]
    ],
    "confidence": 0.94
  },
  "total": {
    "value": 2090.00,
    "confidence": 0.97
  }
}

Every field comes with a confidence score between 0.0 and 1.0. You can see at a glance whether the extraction is trustworthy or needs a second look.

More Conversation Examples

The conversational interface handles more than invoices. Here are a few more prompts and what the assistant does with them.

Parsing a contract for key dates and parties:

“I need the effective date, expiration date, and the names and roles of all parties from this contract. Also check if there’s a non-compete clause.”

The assistant builds a schema with DATE fields for the dates, an ARRAY with nested TEXT and ENUM fields for the parties, and a BOOLEAN field for the non-compete check. You get structured data back without touching a line of code.

Extracting data from a receipt photo:

“This is a photo of a grocery receipt. Get me the store name, date, each item with its price, and the total.”

The assistant sends the image to the parser, which runs OCR internally and extracts the fields. No pre-processing, no separate OCR step. The receipt photo goes in, structured JSON comes out.

Processing multiple documents at once:

“Here are 5 vendor invoices. Extract the invoice number, vendor name, total amount, and currency from each one.”

The assistant batches all 5 files into a single API call (up to 20 per request) and returns results for every document. Each field in each document gets its own confidence score.

Iterating on Schemas Conversationally

One of the things that makes MCP particularly useful is the feedback loop. After the first extraction, you can refine your request based on the results.

Say the assistant extracts a total but misses the tax breakdown. You reply:

“That’s good, but I also need the subtotal and tax amount as separate fields.”

The assistant adds CURRENCY_AMOUNT fields for subtotal and tax to the schema and re-runs the extraction. No code to edit, no deployment, no configuration file to update. You iterate on the schema in plain language until the output matches what you need.

This is especially valuable when you’re figuring out the right schema for a new document type. Instead of guessing the field definitions upfront, writing code, running it, and adjusting — you have a conversation. Once the schema produces the right output, you can take that exact schema and use it in your production code via the API or SDK.

What You Can Parse

The Document Extraction handles more than just PDFs. Upload any of these formats and the assistant will extract structured data:

  • PDFs — native text or scanned (built-in OCR)
  • Word documents — DOCX format
  • Images — PNG, JPG, GIF, WEBP (for photos of documents, receipts, whiteboards)
  • Text files — MD, TXT, CSV, JSON

The parser supports 17 field types out of the box: text, numbers, dates, booleans, emails, IBANs, currency amounts, addresses, arrays (for tables and line items), and calculated fields that compute values from other extracted fields.

Beyond One-Off Parsing

The conversational interface is great for ad-hoc work — checking a document, extracting a few fields, validating data. But the same API that powers the MCP server works programmatically too.

When you’re ready to process documents at scale — batch parsing 20 files at once, building automated pipelines, integrating into your backend — the same Document Extraction API is available via direct HTTP calls, TypeScript SDK, and Python SDK.

The MCP setup is the fastest way to try it. The API is how you ship it. The schema you refined conversationally is the same schema you pass to the API endpoint — no translation needed.

Get Started

Sign up for a free account at iterationlayer.com — no credit card required. Run the claude mcp add command above, authenticate in the browser, and start parsing documents from your next Claude Code or Cursor conversation.

The docs cover every field type, every schema option, and every supported format. Start with a simple invoice — it’s the fastest way to see how conversational document extraction works.

Start building in minutes

Free trial included. No credit card required.