Skip to content

MCP setup

The API is also a remote Model Context Protocol server, so AI agents can validate, parse and convert invoices with the same engine and the same API keys.

Endpoint https://einvoiceengine.com/mcp
Transport Streamable HTTP, stateless (POST, JSON responses)
Protocol versions 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26
Auth Authorization: Bearer <API key with the mcp scope>, or OAuth 2.1 (see OAuth)
Plans test keys on every plan; live keys on Developer and Growth

Tools

Tool Does Billable
validate_invoice Official validation with findings yes (live keys)
parse_invoice EN 16931 JSON yes
convert_invoice UBL ↔ CII, to Peppol BIS, to a ZUGFeRD / Factur-X PDF, Facturae / KSeF to EN 16931 — validated and round-trip checked yes
get_invoice_summary Compact summary of a document, or of a stored invoice by id yes for documents
create_invoice XRechnung, EN 16931, Peppol BIS or ZUGFeRD PDF from canonical JSON, validated before it is returned yes
repair_invoice Without changes: the failing rules and the JSON fields involved, with their current values. With changes: applies them, rebuilds the document and validates it. Amounts, tax data and bank or party identifiers only with confirmAmounts: true after the user confirmed them yes, when changes are applied
get_compliance_changes The register of rule and mandate changes with sources and verification; with impact: true which of them concern your formats and keys no
get_invoice_processing_status Status of a background job, or the latest result of a stored invoice no
get_supported_formats Formats, versions, limitations no
get_validation_rules Official rules by prefix no
explain_validation_error Explanation and fix for a rule id no

Documents are passed as XML text, or base64 with encoding: "base64" for PDFs, up to 2 MB. By default tools do not store documents (store: false).

Claude Code

claude mcp add --transport http einvoicing https://einvoiceengine.com/mcp --header "Authorization: Bearer $EINV_KEY"

Or in .mcp.json (use your own variable name — Claude Code blanks ANTHROPIC_* variables in remote headers):

{
  "mcpServers": {
    "einvoicing": {
      "type": "http",
      "url": "https://einvoiceengine.com/mcp",
      "headers": { "Authorization": "Bearer ${EINV_KEY}" }
    }
  }
}

OpenAI Codex CLI

~/.codex/config.toml:

[mcp_servers.einvoicing]
url = "https://einvoiceengine.com/mcp"
bearer_token_env_var = "EINV_KEY"

Cursor

.cursor/mcp.json:

{
  "mcpServers": {
    "einvoicing": {
      "url": "https://einvoiceengine.com/mcp",
      "headers": { "Authorization": "Bearer ${env:EINV_KEY}" }
    }
  }
}

Claude (web, desktop and mobile)

Add the server as a custom connector: Settings → Connectors → Add custom connector, name it, and enter https://einvoiceengine.com/mcp as the URL. Leave the OAuth client ID and secret empty. Claude registers itself, opens our sign-in page, and you choose:

  • the organization the connector may use (if you belong to several),
  • test or live mode (live needs the Developer or Growth plan),
  • the permissions (see the scopes below).

No API key is involved. The connection appears under Dashboard → Developers → Connected apps, where you can disconnect it at any time. On Team and Enterprise plans an owner adds the connector for the organization first; each member then signs in.

OAuth

The MCP endpoint follows the MCP authorization specification (revision 2026-07-28). Any MCP client that implements it can connect the same way as Claude.

Protected resource metadata (RFC 9728) https://einvoiceengine.com/.well-known/oauth-protected-resource/mcp (also at /.well-known/oauth-protected-resource)
Authorization server metadata (RFC 8414) https://einvoiceengine.com/.well-known/oauth-authorization-server
Authorization endpoint https://einvoiceengine.com/oauth/authorize
Token endpoint https://einvoiceengine.com/oauth/token
Revocation endpoint (RFC 7009) https://einvoiceengine.com/oauth/revoke
Client registration Client ID Metadata Documents (an https client_id URL), or Dynamic Client Registration (RFC 7591) at https://einvoiceengine.com/oauth/register
Grant authorization code with PKCE; S256 only
Resource indicator (RFC 8707) resource=https://einvoiceengine.com/mcp; tokens are only accepted by /mcp, not by the REST API
Access token 1 hour
Refresh token 30 days, rotated on every use; reusing an old refresh token revokes the connection

A request without a token gets 401 with WWW-Authenticate: Bearer resource_metadata="…", scope="…". Redirect URIs must match exactly and use https, or http on a loopback address (127.0.0.1, [::1], localhost) for apps on your own computer. The authorization response carries iss (RFC 9207).

Scopes

Scope Allows
mcp the endpoint and the free tools: formats, rules, explanations, compliance register (always granted)
validate validate_invoice; repair_invoice analysis
parse parse_invoice; get_invoice_summary of a document
convert convert_invoice, create_invoice; repair_invoice with changes
invoices:read get_invoice_summary and get_invoice_processing_status of stored invoices and jobs

A tool call outside the granted scopes gets 403 with WWW-Authenticate: Bearer error="insufficient_scope", scope="…", so the client can ask the user for more. API keys are not affected: a key with the mcp scope can use every tool, as before.

An OAuth connection acts like an API key of the chosen organization and mode: the same plan limits, quota, metering and data isolation. Usage appears in the dashboard with the channel mcp.

Data boundaries

  • A tool only sees the document passed in the call, or invoices stored in your organization (by id).
  • Tools never send data to third parties and never call an AI service.
  • Validity is decided by the official rule sets; explain_validation_error explains a rule but cannot change a verdict.

Protocol note

The server is built on the official TypeScript SDK 2 (@modelcontextprotocol/server). Requests in the 2026-07-28 revision (no initialize; protocol version and capabilities in each request's _meta; server/discover) are served statelessly. Clients on 2025-11-25, 2025-06-18 or 2025-03-26 still initialize as before and get JSON responses.