In this tutorial, we'll walk you through how to build a document processing agent using Claude Code and Lido. Simply follow the steps below.
node --version in your terminal. If you need to install it, grab the LTS release from nodejs.org.npm install -g @anthropic-ai/claude-code and authenticate with your Anthropic API key.Open your terminal and run:
claude mcp add lido -- npx -y @lido-app/mcp-serverThat's the entire installation. This registers Lido as an MCP (Model Context Protocol) tool that Claude Code launches automatically whenever you start a session. No repo to clone, no Docker container to spin up, no YAML to edit. If you're using Claude Desktop or another MCP client instead, see the install options on the MCP page.
To verify it worked, start Claude Code and type:
Show me my available MCP toolsYou should see four Lido tools: authenticate, extract_file_data, extraction_tips, and extractor_usage. If they appear, you're connected. For a deeper walkthrough of what each tool does and alternative installation methods, see the full Lido MCP setup guide.
authenticate and open a browser window at localhost. Paste your Lido API key there. Credentials save to .lido-mcp/credentials.json in your project directory and persist across sessions.Create a folder structure that separates incoming documents from processed output:
mkdir -p ./doc-agent/inbox ./doc-agent/processed ./doc-agent/outputinbox/ is where you drop documents to be processedprocessed/ is where the agent moves files after extractionoutput/ is where results land (CSVs, JSON files, exception reports)Drop some test documents into inbox/. Invoices, purchase orders, receipts, bank statements, insurance certificates, or any document with structured data will work. Five to ten documents is enough to validate the pipeline before running a full batch. Even a fillable or scanned PDF form with labeled fields makes a good test file.
A good agent prompt is specific about the goal, the fields, the rules, and the output format. Start Claude Code in your project directory and paste something like this:
That single prompt gives Claude enough to run the full pipeline. It calls extract_file_data for each document, applies the validation rule, writes the CSV, manages the file moves, and produces a summary report. No code to write.
For non-invoice documents, adjust the prompt accordingly. A certificate of insurance workflow might look like:
Same pattern. Different fields. The agent handles it the same way.
When you hit enter on that prompt, Claude processes the documents sequentially. For each file, you'll see Claude call the extract_file_data tool, get results back, run its validation checks, and move to the next document. A batch of 20 standard invoices typically completes in two to four minutes.
Here's what the output looks like for a batch of five invoices:
| Vendor | Invoice # | Date | Line Item | Grand Total | Status |
|---|---|---|---|---|---|
| Acme Industrial | INV-4521 | 2026-03-15 | Hydraulic Pump HP-200 (2 x $1,250) | $5,130.00 | PASS |
| Acme Industrial | INV-4521 | 2026-03-15 | Replacement Seals Kit (5 x $450) | $5,130.00 | PASS |
| BrightStar Electronics | BS-8834 | 2026-03-18 | LED Panel Array 4x8 (10 x $89) | $961.20 | PASS |
| Summit Office | SO-22019 | 2026-03-20 | Copy Paper A4 Case (25 x $42) | $2,257.20 | PASS |
| Summit Office | SO-22019 | 2026-03-20 | Toner Cartridge TN-450 (8 x $130) | $2,257.20 | PASS |
After the run completes, check these things:
If certain fields are consistently off for a specific vendor's layout, you can add field-level instructions. Tell Claude: "For BrightStar Electronics invoices, the invoice number appears in the upper right corner labeled 'Reference #' not 'Invoice #'." For more on this technique, see the extraction tips section of the MCP guide.
The CSV from Step 4 is already usable. But most workflows need that data somewhere specific. Tell Claude the format you need:
For JSON output (useful if you're feeding a database or API):
Claude reads the source CSV, remaps columns, and writes the import-ready file. You can get more specific: "format dates as MM/DD/YYYY" or "round all amounts to two decimal places" or "add a column called 'Class' with the value 'Operations' for every row."
For teams that want data flowing directly into a spreadsheet, Lido's web app at lido.app has built-in Google Sheets and Excel export. The MCP-based agent approach is better when you need custom transformation logic or conditional routing.
50 free pages. No credit card, no manual setup.
Raw extraction gets data off documents. Business rules turn that data into something your team can act on. This is where the agent approach goes beyond basic intelligent document processing, and you add rules right in your prompt. No code required.
Extracted vendor names almost never match your ERP records exactly. "Acme Corp" on the invoice, "Acme Corporation Inc." in NetSuite.
Vendors send the same invoice twice more often than you'd think. APQC research shows duplicate payments average $1,500 each.
Each of these rules is one or two sentences added to your prompt. The agent applies them across every document in the batch.
The full accounts payable automation chain: extract invoices from an inbox folder, match vendors against a master list, apply approval routing, detect duplicates, validate line item math, and produce an ERP-ready import file. The output CSV drops into your ERP's bulk import tool without manual reformatting. For teams that want continuous email-based ingestion, email-based ingestion through Lido's web app handles that side.
Construction companies and property managers collect certificates of insurance from every subcontractor. The agent extracts certificate holder, insurer, policy type, coverage limits, and expiration date, compares against required minimums, and flags anything below the requirement or expiring within 60 days. One prompt replaces what most companies do with a spreadsheet that someone manually updates once a quarter.
Extract transactions from monthly bank statement PDFs, match them against your GL entries by date and amount, and flag unmatched items. The agent finishes in minutes what normally eats the last few days of every month-end close. The exceptions file gives your team a focused list to investigate instead of working through every transaction line by line. GL entries often sit in spreadsheets, so the comparison may also rely on figures pulled from Excel workbooks.
./prompts/ap-extraction.txt and reference in future sessions. If you're evaluating dedicated tools for the extraction layer, the best invoice data extraction software comparison covers the landscape.A document processing agent runs multi-step document workflows autonomously. Instead of extracting data from one file at a time, an agent processes a batch of documents, applies business rules like validation, matching, and routing, and produces structured output ready for your downstream systems. With Claude Code and the Lido MCP server, you build agents by writing natural language prompts rather than code.
Yes. The agent prompt is written in plain English. You describe the fields to extract, the rules to apply, and the output format you want. Claude handles the technical execution: calling the extraction API, reading and writing files, applying your business logic, and managing the document pipeline. You do need basic comfort with a terminal since Claude Code runs in the command line, but no programming is required.
Claude Code can process hundreds of documents in a single session. For most accounts, batches of 50 to 200 documents per session work well. Each standard document takes a few seconds to extract, so a batch of 100 invoices typically completes in under ten minutes. Larger volumes are better handled by splitting into multiple runs or using Lido's web app.
Yes. The Lido MCP server implements the open Model Context Protocol standard and works with any MCP-compatible client, including Claude Desktop, Cursor, Windsurf, and Cline. The installation method varies by client, but the extraction capabilities are identical. See the full MCP setup guide for configuration details per client.
Field-level accuracy on standard document types like invoices, receipts, and purchase orders is typically 95 to 98 percent for header fields and 90 to 96 percent for line items depending on table complexity. The extraction is template-free, so it handles any document layout without per-vendor configuration. Accuracy doesn't degrade when a vendor changes their invoice format.
Any document with structured or semi-structured data: invoices, receipts, purchase orders, bank statements, tax forms, certificates of insurance, medical claims, contracts, packing lists, and shipping manifests. The extraction engine reads PDFs, scanned images, and photos. A single agent session can even process mixed document types if you instruct Claude to identify the document type first.