MCP server
The Beliq MCP server lets AI clients like Claude and Cursor validate, parse, generate and convert e-invoices, with the check depth the API states per verdict.
Available
An MCP server for Beliq. It lets MCP clients (Claude Desktop, Claude Code, Cursor, and others) validate e-invoices (XRechnung, ZUGFeRD, Factur-X, Peppol BIS Billing 3.0, and the other formats the API carries) and explain exactly what fails, and parse, generate, and convert them. Each verdict shows the check depth the API states for it.
- Package:
beliq-mcpon npm - Source: github.com/beliq-eu/beliq-mcp
Tools
beliq_validate_einvoice: validate an invoice XML (inline or by file path) or a Factur-X/ZUGFeRD PDF (by file path). Returns the verdict, how deep the check went, the detected format and profile, the versions of the rule packs and schemas it ran, and every error and warning with its rule id, severity, location, and message. For a PDF the verdict is about the embedded XML; the PDF itself is not checked.beliq_parse_einvoice: parse a UBL/CII XML invoice or a Factur-X/ZUGFeRD PDF into a structured EN 16931 invoice. Returns the detected format and profile, the extracted invoice (number, dates, currency, seller, buyer, lines and totals), and warnings that say what the document holds and the parsed invoice does not.beliq_generate_einvoice: generate a document from an EN 16931 invoice object. Setstandardtoxrechnung,zugferd,facturx,peppol-bis,fatturapa,facturae,eslog, orksef. XML output comes back inline; PDF output is written to theoutputPathyou provide. By default the invoice XML is validated before it is returned (verify), so a document that fails its rules is refused rather than returned, and the text summary names how deep that check went. A ZUGFeRD or Factur-X PDF is returned only when veraPDF reports no violation of its PDF/A-3b profile in it (the PDF/A check on a hybrid PDF).beliq_convert_einvoice: convert a document from one EN 16931 format to another. SettargetFormattocii,ubl,xrechnung,peppol-bis,facturx, orzugferd. From an XML source the result is XML, inline, for every target,facturxandzugferdincluded: an XML source is not wrapped into a hybrid PDF. From a hybrid PDF source, afacturxorzugferdtarget returns a PDF, written tooutputPath: as sent, with only its annotation flags set as PDF/A asks, when its embedded XML already is the target, and otherwise re-wrapped around the converted XML; every other target returns XML. The result reports the resolved source and target formats and the losses the engine recorded. The API validates the converted XML before it returns it, and a conversion whose result fails is refused. For afacturxorzugferdtarget at profileen16931the converted document carries the plain EN 16931 identifier, so it is checked as EN 16931 CII and against no Factur-X profile schema. The result carries no verdict and no check depth, so runbeliq_validate_einvoiceon the converted document to read its warnings. POST /v1/convert says what a returned document has and has not been checked for.beliq_check_account: verify the configured API key and report the plan and remaining quota. CallsGET /v1/me, which draws no quota; useful as a connection and credential smoke test.
Install
The server is published to npm, so clients can run it with npx with no separate install step:
npx -y beliq-mcp
Requires Node.js 20.15 or newer.
Configuration
The server is configured entirely through environment variables. Create an API key in the Beliq dashboard under Integration → API Keys.
| Variable | Required | Default | Description |
|---|---|---|---|
BELIQ_API_KEY |
yes | (none) | API key from the Beliq dashboard. |
BELIQ_AUTH |
no | header |
How the key is sent: header (X-API-Key) or bearer (Authorization: Bearer). |
BELIQ_BASE_URL |
no | https://api.beliq.eu |
Override for a self-hosted deployment; defaults to the production API. |
Client setup
Claude Code
claude mcp add beliq -e BELIQ_API_KEY=your-key -- npx -y beliq-mcp
Claude Desktop
Add to claude_desktop_config.json (Settings → Developer → Edit Config). Cursor uses the same block in ~/.cursor/mcp.json or a project .cursor/mcp.json:
{
"mcpServers": {
"beliq": {
"command": "npx",
"args": ["-y", "beliq-mcp"],
"env": {
"BELIQ_API_KEY": "your-key"
}
}
}
}Reading a result
beliq_validate_einvoice returns a short text verdict plus a structured result:
validis the API’s verdict: the document passed the rule packs and schemas Beliq runs for its format, in the versions the result names. It does not mean every recipient, validation tool or tax authority accepts it. Warnings do not make a document invalid, with one case to read beside it:franceCtcBlockingRuleIds.verificationBadgeLabelis the check depth as English display text, and the text verdict prints it besideVALIDorINVALID. How verification works says what each depth means. Where the API sends no label, the text sayscheck depth not statedand names no depth.verificationBadgeandverificationTierare the ids behind the label.franceCtcBlockingRuleIdslists the BR-FR-CTC rule ids the document trips. The API reports them besidevalid, also wherevalidis true, and the text verdict then leads with them. The result stays a normal result, not a tool error. Warnings are not all optional says why they matter.pdfInputis present when the document was a PDF: it says which embedded file the verdict is about, and itscontainerCheckedis alwaysfalse, because the PDF itself is not checked.formatandprofileDetectedreport the detected syntax and business profile.schematronVersionis the Schematron revision the check ran against, where a Schematron ran. The versions of the other rule packs and schema bundles come in fields of their own, each present only when it applies.errors[]andwarnings[]each carryruleId,severity,location(an XPath when available), andmessage.errorCountandwarningCountare their lengths.
The structured result carries every field of the API’s validation result.
beliq_parse_einvoice returns a short text summary plus a structured result:
format,profileDetectedandprofileUrnreport the detected syntax and profile;businessProcessIdandfranceCtcDetectedare present when the document states them.invoiceis the extracted invoice object, a subset of the EN 16931 fields, such as number, dates, currency, seller, buyer, lines and totals. A field the API holds no value for is left out.warningssays what the document holds and the parsed invoice does not: each entry has acode, amessage, and, by code, afield, theterms(EN 16931 business term or group ids, such asBT-110orBG-20) or theelements(paths with counts) concerned. The text summary lists them.
beliq_generate_einvoice returns a short text summary (with the XML document appended for XML output) plus a structured result:
outputisxmlorpdf, as requested, andcontentTypeis the matching media type (application/xmlorapplication/pdf).xmlis the generated document inline, present only for XML output.outputPathandbytesWrittenare set when the document was written to disk: always for a PDF, and for XML when you setoutputPath. The tool never overwrites an existing file, so pointoutputPathat a path that does not exist yet.pdfKindis present only for PDF output:hybrid(a PDF/A-3 with the XML embedded, forfacturxandzugferd) orvisualization(rendered pages with no XML inside, forxrechnungandpeppol-bis, whose legal document stays the XML). See PDF output.schematronVersionis the ruleset (Schematron) revision the document was checked against.sha256is the lowercase-hex SHA-256 of the returned document bytes, sosha256sumon the file atoutputPathreproduces it.rulesetSha256is one combined fingerprint of the rule artifacts the document was checked against, present when a ruleset ran.livemodeistruefor ablq_live_key andfalsefor ablq_test_sandbox key, whose output is marked as a specimen and is not a production invoice.validationResultis the API’s verdict on the generated document, with the check depth inverificationBadgeLabel; the text summary names that depth. The verdict is about the invoice XML, so for a PDF the text says so and names the kind of PDF. With the defaultverify: true, a document that fails validation comes back as a tool error that lists the failed rules. Withverify: falseno ruleset runs:verifiedisfalse,validisfalse, anderrors/warningsare empty because nothing checked the document, not because it failed. The text then saysnot validated.
beliq_convert_einvoice returns a short text summary (with the XML document appended when XML came back) plus a structured result:
outputis what came back, read from the response:xmlfor every target when the source is XML,facturxandzugferdincluded, andpdfwhen a hybrid PDF source is converted tofacturxorzugferd, whether it comes back as sent or re-wrapped.contentTypeis the matching media type (application/xmlorapplication/pdf).xmlis the converted document inline, present only when XML came back.outputPathandbytesWrittenare set when the document was written to disk: always for a PDF, and for XML when you setoutputPath. Like generate, it never overwrites an existing file.sourceFormatis the format the engine read, andtargetFormatthe format it produced (thetargetFormatyou asked for when the API does not name one).profileDetectedis the profile the engine recognised on the source document, when it recognised one.lostElementsCountandlostElementscount and name the source elements the engine recorded as having no equivalent in the target format. A loss the engine does not detect is not counted: the converters between CII and UBL are not checked field by field, so0means the engine recorded no loss, not that every field of the source arrived.
A PDF (Factur-X / ZUGFeRD) must be passed by file path to validate, parse, and convert, not inlined as text. The repo also ships a portable agent skill that teaches a model when to validate and how to report a verdict with its check depth.
See also
- POST /v1/validate: the endpoint behind
beliq_validate_einvoice. - POST /v1/parse, POST /v1/generate, and POST /v1/convert: the endpoints behind parse, generate, and convert.
- How verification works: what the verdict means.
- Authentication: keys, quotas, and rate limits.