mcpField
A
Agentic Document Parsing and Extraction (ADP)

Agentic Document Parsing and Extraction (ADP)

Local
github.com/Laiye-ADPAI & Agents1Updated today

About Agentic Document Parsing and Extraction (ADP)

ADP MCP Server connects MCP-compatible AI clients to Laiye’s document processing platform for business-document parsing, field extraction, and workflow execution. It combines document-specific extraction tools with custom apps and workflow templates, without requiring template setup or data labeling.

Key features

  1. 01Parse document structure and tables
  2. 02Extract invoice and order fields
  3. 03Recognize cards and certificates
  4. 04Run custom extraction apps
  5. 05Create and execute workflow applications

Use cases

  1. 01Extract amounts and dates from invoices
  2. 02Process identity-card and license images
  3. 03Parse unknown PDFs or office files
  4. 04Run finance and expense workflows

MCP support

The Node.js server runs locally over stdio and exposes ADP parsing, extraction, custom-app, and workflow tools to MCP clients. Clients launch it with an API key.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"adp-mcp-nodejs": {
"command": "npx",
"args": [
"-y",
"@laiye-adp/mcp"
],
"env": {
"ADP_API_KEY": "<ADP_API_KEY>"
}
}
}
}
Run commandnpx -y @laiye-adp/mcp
Environment variables to set
ADP_API_KEYSecret

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@laiye-adp/mcp

Tools

22

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
filestringYesFile URL or Base64-encoded data
file_namestringNoFile name (optional, including extension)
with_rec_resultbooleanNoWhether to include intermediate OCR results
waitbooleanNoWhether to wait for the result synchronously; defaults to true
timeout_secondsintegerNoSynchronous wait timeout in seconds; defaults to 300
accept_languageenumNoResponse language and API region. Defaults to zh and accesses https://adp.laiye.com; when set to en, accesses https://adp-global.laiye.com.zh | en

Details

From the project README

About ADP MCP Server

ADP MCP Server connects MCP-compatible AI clients to Laiye's Agentic Document Processing (ADP) platform for document parsing, extraction and workflow applications. This Node.js package runs locally over stdio, letting clients discover tools, process documents and query results from the conversation.

ADP integrates Vision-Language Models (VLM), Large Language Models (LLM) and autonomous agent decision-making technologies. It reshapes traditional document processing by transforming conventional rule-based field extraction into goal-driven end-to-end intelligent automation. Focused on intelligent processing of business documents, ADP automatically classifies overseas invoices, domestic vouchers, procurement contracts, logistics documents, financial statements and trading contracts, and accurately extracts key fields. It also supports table parsing, content verification and multilingual recognition. Requiring no template setup, data labeling or ongoing rule maintenance, it efficiently handles high-volume document processing tasks.


Quick Start

1. Get Your API Key

Sign up at https://adp-global.laiye.com/ and retrieve your API Key from My MCP in personal settings.

README image README image README image
2. Configure Your MCP Client

The ADP MCP Server runs over stdio transport: the client launches a local process via npx and passes your API Key through an environment variable. Add the following to your client's MCP config file (e.g. Claude Desktop's claude_desktop_config.json, Cursor's mcp.json):

{
  "mcpServers": {
    "adp": {
      "command": "npx",
      "args": ["-y", "@laiye-adp/mcp"],
      "env": {
        "ADP_API_KEY": "<YOUR-ADP-API-Key>",
        "API_SOURCE": "npm-mcp"
      }
    }
  }
}

The same parameters apply to any MCP client:

ParameterValue
Commandnpx
Args["-y", "@laiye-adp/mcp"]
Transportstdio
AuthenticationEnvironment variable ADP_API_KEY=<YOUR-ADP-API-Key>
Source markerOptional environment variable API_SOURCE, default npm-mcp

The optional environment variable ADP_ACCEPT_LANGUAGE (zh / en, default zh) switches the API language and domain. The optional environment variable API_SOURCE sets the OpenAPI request header X-Api-Source; the default is npm-mcp. Requires Node.js 20+ installed locally.

3. Start Using

Once connected, your AI client will automatically discover all available ADP tools. Just describe what you need in natural language:

  • "Upload this local file and extract fields from the returned URL"
  • "Parse the structure of this PDF"
  • "Extract the information from this ID card"
  • "Pull the amount and date from this invoice"

Tool Catalog

Document Parsing
Tool NameTitleDescription
upload_temporary_fileUpload Temporary FileUpload chunk and return download_url. Pass data.download_url to parsing or extraction tools as the file parameter.
parse_documentGeneral Document ParsingParse PDF, image, Word, Excel, PPT and other documents for layout analysis, returning structured text blocks, tables, reading order and page coordinates. Use when the document type is unknown and you need raw structure for further processing; for invoices, ID cards or other specific types, prefer the dedicated extraction tool.
Invoice & Order Extraction
Tool NameTitleDescription
extract_china_invoiceChina Invoice / BillCovers 30+ common Chinese bill types: fully-digitalized e-invoices, general VAT invoices, special VAT invoices, taxi receipts, train tickets, air itineraries, fiscal invoices, etc. Extracts invoice number, date, amount, buyer, seller and other key fields; also supports invoice authenticity verification.
extract_global_invoiceGlobal Invoice / ReceiptExtract key fields (invoice number, date, amount, tax, currency, line items, etc.) from overseas invoices, receipts or bills in PDF or image format. Ideal for cross-border trade, reimbursement and accounts-payable automation; for Chinese VAT invoices, use the dedicated China invoice tool.
extract_purchase_orderPurchase / Sales OrderExtract key fields (order number, buyer/seller info, order date, item details, quantity, unit price, total amount, shipping address, etc.) from purchase or sales orders in PDF or image format. Suitable for e-commerce order entry, supply-chain reconciliation and warehouse management automation.
Card & Certificate Extraction
Tool NameTitleDescription
extract_id_cardChina ID CardExtract key fields (name, gender, ethnicity, date of birth, ID number, address, issuing authority, validity period, etc.) from Chinese mainland resident ID card images. Supports both front and back sides. For HK/Macao/Taiwan permits or passports, use the corresponding tool.
extract_bank_cardBank CardExtract key fields (card number, issuing bank, card type, expiration date, etc.) from the front side of a bank card image. Only public card-face information is recognized; sensitive fields such as CVV are not extracted.
extract_vehicle_certVehicle CertificateExtract key fields (certificate number, vehicle brand, model, VIN, engine number, manufacturing date, etc.) from vehicle certificate of conformity images. Suitable for vehicle registration, used-car transactions and fleet management.
extract_account_permitBank Account PermitExtract key fields (company name, basic account number, bank name, approval number, issue date, etc.) from corporate bank-account opening permit images.
extract_driver_licenseChina Driver LicenseExtract key fields (name, gender, nationality, date of birth, license number, permitted vehicle class, first issue date, validity period, etc.) from Chinese motor-vehicle driver license images. Supports both main and supplementary pages.
extract_business_licenseBusiness LicenseExtract key fields (company name, unified social credit code, legal representative, registered capital, establishment date, business scope, registered address, etc.) from Chinese business license images.
extract_passport_cnChina PassportExtract key fields (Chinese name, romanized name, gender, date of birth, passport number, nationality, issue date, validity period, issuing authority, etc.) from PRC passport images. Foreign passports are not supported.
extract_vehicle_licenseVehicle LicenseExtract key fields (plate number, vehicle type, owner, VIN, engine number, registration date, issue date, etc.) from Chinese motor-vehicle license images. Supports both main and supplementary pages.
extract_org_code_certOrganization Code CertificateExtract key fields (organization name, organization code, legal representative, address, issue date, validity period, etc.) from organization code certificate images. For newly registered enterprises, use the Business License tool instead.
extract_household_bookHousehold RegisterExtract key fields (household number, household type, address, family member list including name, ID number and relationship to head of household, etc.) from Chinese household register (Hukou) images. Supports both index and individual pages.
extract_hk_macao_permitHK/Macao Travel PermitExtract key fields (name, gender, date of birth, permit number, issue date, validity period, issuing authority, etc.) from Exit-Entry Permit for Travelling to and from Hong Kong and Macao images.
Custom Extraction

In addition to the out-of-the-box tools above, MCP provides two fixed tools for working with custom extraction apps you create on the ADP platform:

Tool NameTitleDescription
list_custom_extract_appsList Custom Extraction AppsList all custom document extraction apps created by the current user, returning each app's ID, name, description, labels and output field definitions. Use this to find the app_id needed by execute_custom_extract_app.
execute_custom_extract_appExecute Custom Extraction AppProcess a file using a specified custom document extraction app. Use list_custom_extract_apps first to obtain the app_id.

Workflow: Call list_custom_extract_apps to browse available apps and get the target app_id, then call execute_custom_extract_app with the app_id and file to perform extraction.


Workflow Applications
Tool NameDescription
list_workflow_templatesQuery official templates by name with search, offset and size. Catalog IDs are for discovery.
create_workflow_application_from_templateCreate and publish an account application, or reuse the corresponding runnable application.
upload_temporary_fileFor workflow files, pass the created application_id and sharing_scope="application".
execute_workflow_appRun a published account application, synchronously by default; use wait=false for an explicitly requested async run.
query_workflow_runQuery a workflow by run_id, preserving its complete output and error.

Supported template keys:

Templatetemplate_key
Accounts payablefinance_payable
Expense reimbursementexpense_reimbursement
Financial report extractionfinancial_report_extraction

Use the matching template to create and publish an application first, then upload and run using the returned account application_id. Creation does not require can_run=true in the template catalog. Repeated creation reuses an existing runnable application and preserves its template version. Do not run using the catalog's application_id.

Call create_workflow_application_from_template:

{"template_key":"financial_report_extraction"}

Successful data contains template_key, template_version, application_id, application_name, release_version_id, application_status="published" and can_run=true. Save the returned IDs. Then call upload_temporary_file:

{"chunk":"/path/to/report.pdf","application_id":"<created application_id>","sharing_scope":"application"}

Call execute_workflow_app using the upload response's download_url, file_name, content_type and optional file_size:

{
  "application_id":"<created application_id>",
  "files":[{"url":"https://files.example.com/report.pdf","name":"report.pdf","mime_type":"application/pdf"}]
}

For async runs, add "wait":false, save data.run_id, and call query_workflow_run with {"run_id":"<returned run_id>"}. A run is successful only when status="succeeded"; also inspect the output against the user's request. Do not use document task_id query tools for workflow runs. If a creation, upload or run response is uncertain, do not automatically resubmit.

Workflow changes currently require the ADP website interface. Test and republish there before running the application through the API again. These tools support creating an application from an official template; custom workflow creation and workflow editing remain website operations.

The workflow tools accept accept_language and timeout_seconds. Use the same account region for creation, upload, execution and query: zh selects the China service and en selects the global service, or configure ADP_ACCEPT_LANGUAGE consistently.

Tool Input Parameters

Document Parsing & OOTB Extraction Tools

Common input parameters for out-of-the-box tools:

ParameterTypeRequiredDescription
filestringYesFile URL or Base64-encoded content
file_namestringNoFile name (with extension)
with_rec_resultbooleanNoWhether to include OCR intermediate results, default true
waitbooleanNoWhether to wait synchronously for the result, default true
timeout_secondsintegerNoSynchronous wait timeout in seconds, default 300, range 1–900

extract_china_invoice additionally supports:

ParameterTypeRequiredDescription
enable_invoice_verifyboolean or nullNoEnable (true) or disable (false) verification for this extraction only. Omission or null uses the saved app configuration without changing it.

extract_global_invoice, extract_global_invoice_fast, and extract_sea_invoice_fast additionally support:

ParameterTypeRequiredDescription
enable_multi_ticketbooleanNoSplit multiple invoices in one file into separate results, default true. Applies only to international and Southeast Asia fast modes without changing app configuration.
enable_field_value_translationboolean or nullNoEnable (true) or disable (false) field-value translation for this extraction only. Omission or null uses the saved app configuration without changing it. The target language follows accept_language or ADP_ACCEPT_LANGUAGE.
upload_temporary_file
ParameterTypeRequiredDescription
chunkstringYesFile to upload. Local file path, file:// URL, or Base64-encoded content
application_idstringNoCreated account workflow application ID; required when sharing_scope="application"
sharing_scopestringNoapplication for workflow files, or user for temporary document files
accept_languagestringNoAccount region and response language, zh or en
timeout_secondsintegerNoRequest timeout in seconds, default 300, range 1–900

The response contains data.download_url, which can be passed directly to parsing or extraction tools as file.

execute_custom_extract_app

In addition to the parameters above:

ParameterTypeRequiredDescription
app_idstringYesCustom extraction app ID (obtained from list_custom_extract_apps)
list_custom_extract_apps

No input parameters required.

Parsing/extraction file input methods:

  • URL: pass a link starting with http:// or https:// as file
  • Base64: pass Base64-encoded file content as file (auto-detected when not a URL)
  • Local files: call upload_temporary_file first, then pass the returned data.download_url to the parsing or extraction tool.

Sync vs Async:

  • wait=true (default): blocks until processing completes, returns the result directly
  • wait=false: returns immediately with a task_id for later status queries

Tool Output

upload_temporary_file Output
{
  "code": "success",
  "message": "",
  "tips": null,
  "data": {
    "id": "ade6dcfd9b9c11f1be34d85ed35661fd",
    "file_name": "invoice.pdf",
    "file_size": 123,
    "content_type": "application/pdf",
    "download_url": "https://adp.laiye.com/web/agentic_doc_processor/laiye/file/ade6dcfd9b9c11f1be34d85ed35661fd",
    "status": "success"
  }
}
FieldTypeDescription
codestringBusiness status code. Success is usually success
messagestringResponse message
tipsstring | nullAdditional message
data.idstringFile ID
data.file_namestringFile name
data.file_sizeintegerFile size in bytes
data.content_typestringMIME type
data.download_urlstringDownload URL. Pass this value to parsing or extraction tools as file
data.statusstringFile status, returned when available
parse_document Output
{
  "task_id": "fabd7f0a4e7211f1bbc4d85ed35661fd",
  "status": 4,
  "message": "",
  "doc_recognize_result": [
    {
      "page_num": 1,
      "document_content": "Full text content of this page...",
      "document_details": [
        {
          "type": "Text",
          "text": "Paragraph content...",
          "position": [{"points": [{"x": 311, "y": 50}, {"x": 500, "y": 50}, {"x": 500, "y": 80}, {"x": 311, "y": 80}]}],
          "ocr_confidence": {
            "ocr_mean_confidence": 0.999,
            "ocr_min_confidence": 0.998,
            "is_overall_confidence": 1
          }
        },
        {
          "type": "Table",
          "text": "Column A\tColumn B\nValue 1\tValue 2",
          "position": [{"points": [...]}],
          "ocr_confidence": {...}
        },
        {
          "type": "Picture",
          "text": "https://adp.laiye.com/web/.../file/abc123",
          "position": [{"points": [...]}],
          "ocr_confidence": {...}
        }
      ]
    }
  ]
}
FieldTypeDescription
task_idstringTask ID
statusintegerTask status code
messagestringStatus message
doc_recognize_resultarrayPer-page recognition results
doc_recognize_result[].page_numintegerPage number (1-indexed)
doc_recognize_result[].document_contentstringFull text of the page in reading order
doc_recognize_result[].document_detailsarrayElement-level details
document_details[].typestringElement type: Text, Table, or Picture
document_details[].textstringText content; image URL for Picture type
document_details[].positionarrayBounding box coordinates (4 corner points)
document_details[].ocr_confidence.ocr_mean_confidencefloatAverage OCR confidence (0–1)
document_details[].ocr_confidence.ocr_min_confidencefloatMinimum OCR confidence (0–1)
extract Tool Output
{
  "task_id": "91283e544e7111f18cd6d85ed35661fd",
  "status": 4,
  "message": "",
  "extraction_result": [
    {
      "field_key": "invoice_number",
      "field_name": "Invoice Number",
      "field_values": [
        {
          "field_value": "24VLT0591617",
          "field_confidence": 1.0,
          "references": []
        }
      ]
    },
    {
      "field_key": "line_items",
      "field_name": "Product Details",
      "references": [],
      "field_confidence": 1.0,
      "table_values": [
        [
          {
            "field_name": "Description",
            "field_key": "line_items_description",
            "field_values": [
              {
                "field_value": "TESLA MODEL 3",
                "field_confidence": 1.0,
                "references": "Description: TESLA MODEL 3"
              }
            ]
          }
        ]
      ]
    }
  ]
}

Regular field (no table_values):

FieldTypeDescription
field_keystringMachine-readable field identifier
field_namestringHuman-readable field name
field_valuesarrayExtracted values
field_values[].field_valuestringThe extracted value
field_values[].field_confidencefloatConfidence score (0–1)

Table field (has table_values):

FieldTypeDescription
field_keystringTable identifier
field_namestringTable name
table_valuesarray[array]2D array: rows of cells, each cell has field_name, field_key, field_values

How to distinguish: Field object contains table_values → table field; only field_values → regular field.

Async Response (wait=false)
{
  "task_id": "fabd7f0a4e7211f1bbc4d85ed35661fd",
  "status": "running"
}

Task Status Codes

Status CodeMCP StatusDescription
0runningUnknown
1runningReady / Queued
2runningProcessing
4successSuccess
5failedFailed
6failedCancelled

Supported File Formats

FormatExtensionsNotes
PDF.pdfSupports both scanned and electronic
Image.jpg .jpeg .png .bmp .tiffSupports camera photos
Word.doc .docx-
Excel.xls .xlsx-
PPT.ppt .pptx-

Authentication

ADP MCP Server uses API Key authentication, passed via the ADP_API_KEY environment variable:

"env": {
  "ADP_API_KEY": "<YOUR-ADP-API-Key>",
  "API_SOURCE": "npm-mcp"
}
  • API Key is available from the My MCP page in the ADP console
  • Each API Key is bound to a single user and can only access that user's apps and data
  • The API Key is passed only as an environment variable to the local process and never appears in request bodies or responses
  • API_SOURCE is sent to OpenAPI as the X-Api-Source request header; when omitted it defaults to npm-mcp

FAQ

Q: Some card/certificate tools don't appear after connecting?

A: The tool list is dynamically generated based on your initialized apps. On first connection, the system automatically initializes all out-of-the-box apps. Refresh the tool list once initialization completes to see all available tools.

Q: A card tool returns "extraction failed"?

A: Make sure the uploaded file matches the tool type (e.g., use extract_id_card for ID card images, not extract_vehicle_cert). The file must be in a supported image or PDF format.

Q: How to handle timeouts?

A: The default timeout is 300 seconds (5 minutes). You can adjust it via the timeout_seconds parameter (max 900). For large files or complex documents, use wait=false for async mode and query results later using the task_id.

Q: How does MCP compare to ADP CLI / OpenAPI?

A: All three provide equivalent functionality — the difference is in the integration method:

MethodBest For
MCP ServerAI clients (Claude Desktop, Cursor, etc.) — no code required
ADP CLITerminal, scripting, AI Skill integration
OpenAPIBusiness system integration, backend service calls

License

  • MCP Server: Free to connect, provided as part of the ADP platform
  • ADP Service: Cloud-based AI document processing, usage-based billing

Free tier: new users receive 100 free credits per month upon registration

Get started


Support & Contact

Build the Future of Agentic AI with ❤️ Copyright © 2026 [Laiye Technology (Beijing) Co., Ltd.] All rights reserved.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.