MCP Server
Expose invoice extraction, duplicate checks, and vendor analytics to MCP-compatible assistants. Built from source; not published to npm.
The repository includes an MCP server under mcp-server. It connects a local MCP client to the Parsurai API with your API key.
This server is not published to npm. npm install -g @invoiceextract/mcp-server and npx @invoiceextract/mcp-server do not resolve. Building it from a checkout of the repository, as shown below, is for local evaluation only and is not a supported integration path before public launch.
Its default base URL is https://api.invoiceextract.com. That hostname is obsolete, is not operated by Parsurai, and must never be used — always set INVOICEEXTRACT_BASE_URL explicitly. The example below uses https://api.parsurai.com, the production API host.
Build from source
From a checkout of the repository:
cd mcp-server
npm install
npm run build
That produces mcp-server/dist/index.js, which is what your MCP client runs.
Claude Desktop Setup
Point the client at the built file by absolute path:
{
"mcpServers": {
"parsurai": {
"command": "node",
"args": ["/path/to/invoice-extractor/mcp-server/dist/index.js"],
"env": {
"INVOICEEXTRACT_API_KEY": "sk_live_your_key_here",
"INVOICEEXTRACT_BASE_URL": "https://api.parsurai.com"
}
}
}
}
Available MCP Tools
The server registers ten tools: three for extraction and analysis, and seven for the fixed accounts-payable document workflow.
| Tool | Description | Input |
|---|---|---|
extract_invoice | Extract structured data from an invoice. Provide the invoice content as text, an image URL, or a base64-encoded PDF | text, image_url, pdf_base64, locale |
check_duplicate | Check whether an extracted invoice is a duplicate of one already in the system | invoice_id |
get_vendor_analytics | Retrieve aggregated analytics for vendors, optionally filtered by date range | start_date, end_date, limit |
start_ap_workflow | Start the fixed AP document workflow from a previously uploaded source artifact | source_artifact_id, plus optional workflow_version, preprocessing_policy, review_policy, candidate_ap_types, persist_after_approval, client_correlation_id, idempotency_key |
get_ap_workflow_status | Poll the status and stage metadata for a fixed AP workflow run | workflow_run_id |
approve_ap_workflow | Approve a fixed AP workflow run that is waiting for review | workflow_run_id, workflow_run_version, plus optional persist_after_approval, idempotency_key, reason |
correct_ap_workflow | Submit corrections for a fixed AP workflow run that is waiting for review | workflow_run_id, workflow_run_version, current_result, corrections, plus optional idempotency_key, reason |
reject_ap_workflow | Reject a fixed AP workflow run that is waiting for review | workflow_run_id, workflow_run_version, plus optional idempotency_key, reason |
retry_ap_workflow | Retry a failed fixed AP workflow run | workflow_run_id, workflow_run_version, plus optional idempotency_key, reason |
resume_ap_workflow | Resume a fixed AP workflow run that is waiting for review | workflow_run_id, workflow_run_version, plus optional idempotency_key, reason |
Environment Variables
| Variable | Required | Description |
|---|---|---|
INVOICEEXTRACT_API_KEY | Yes | API key sent in X-API-Key |
INVOICEEXTRACT_BASE_URL | Yes in practice | API base URL. Defaults to the obsolete https://api.invoiceextract.com, so always set it to your configured Parsurai API base URL |
Both variables keep the legacy INVOICEEXTRACT_ prefix until the server is renamed to the Parsurai brand.
The MCP server runs locally and uses your API key to call the API. Keep the key in environment configuration, not in prompts.