saudi-invoice-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@saudi-invoice-mcpReport a B2C simplified invoice to ZATCA"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Saudi Invoice MCP 🇸🇦 — How can my AI agent report or clear a ZATCA Fatoora e-invoice in Saudi Arabia?
Remote MCP server that lets any AI agent submit Saudi Arabia tax invoices to ZATCA (Fatoora Phase 2) — the Zakat, Tax and Customs Authority national e-invoicing gateway. It forwards an already-signed UBL 2.1 invoice to the reporting (B2C simplified) or clearance (B2B standard) endpoint and returns ZATCA's response. Stateless, bring-your-own credentials, never stores anything.
Live endpoint: https://inv-sa.wishpool.app/mcp · Registry: app.wishpool/saudi-invoice-mcp
Honest scope — what this server does and does NOT do
This wraps the submission calls only. Signing and the hash-chain stay merchant-side.
✅ It does: forward
{ invoiceHash, uuid, invoice(base64) }to the ZATCA reporting/clearance/compliance endpoints, add the mandatory headers (Accept-Version: V2,Accept-Language: en, HTTP Basic auth from your CSID,Clearance-Status: 1on clearance), and translate the response (status, warnings, cleared XML).❌ It does NOT: build your XML, apply your ECDSA signature, compute the invoice hash, or maintain the ICV counter / PIH previous-invoice-hash chain. Those are cryptographic state that must live in your EGS (E-invoicing Generation Solution), next to your private key. You sign each invoice and pass the signed bytes here.
This deliberate split keeps the security-critical material (private key, hash-chain) entirely on your side — a compromise of this stateless forwarder cannot forge, replay, or reorder your invoices.
Related MCP server: zatca-mcp
Quick start
{
"mcpServers": {
"saudi-invoice": {
"type": "http",
"url": "https://inv-sa.wishpool.app/mcp",
"headers": {
"x-zatca-csid-token": "your-csid-binarySecurityToken",
"x-zatca-csid-secret": "your-csid-secret",
"x-zatca-mode": "core"
}
}
}
}Get your CSID (a binarySecurityToken + secret) from ZATCA EGS onboarding. Omit x-zatca-mode to stay in the developer-portal sandbox (no fiscal effect); simulation = simulation env; core = production. Required headers: x-zatca-csid-token + x-zatca-csid-secret. Optional: x-zatca-mode (default developer) and the owner-policy headers below.
Tools
Tool | What it does |
| Simplified invoice (B2C, فاتورة مبسطة) → ZATCA |
| Standard invoice (B2B, فاتورة ضريبية) → ZATCA |
| Validate a signed invoice against ZATCA |
All three take the same envelope: { invoiceHash, uuid, invoice }.
Owner policy guardrails ride optional headers (x-agentpay-max-amount, x-agentpay-approval-above, x-agentpay-allowed-tools) — set by the human owner in client config; the agent cannot relax them. Cap scope: the amount gate reads the invoice grand total from cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount (SAR) inside the signed UBL. If that element cannot be parsed from the base64 payload, the amount gate is skipped for that call (the tool allow-list still applies unconditionally); this is by design because the invoice is opaque signed XML we do not parse in full.
Endpoints wrapped (per env)
https://gw-fatoora.zatca.gov.sa/e-invoicing/{developer-portal | simulation | core}/…
| Path segment | Reporting | Clearance | Compliance |
|
|
|
|
|
|
| same | same | same |
|
| same | same | same |
ZATCA HTTP responses are passed through: 200 cleared/reported · 202 accepted-with-warnings · 303 standard invoice sent while clearance is off (use report_invoice) · 400 invalid request · 401 bad CSID · 413/429/500/503/504 transient (resend with a new UUID/hash/ICV if rejected).
Develop
node test/serve.js # local server on :3235
node test/e2e.js # protocol + validation + policy asserts + LIVE probes against gw-fatoora.zatca.gov.saThe e2e suite makes real calls to the ZATCA developer-portal gateway: a fake CSID runs the full HTTP Basic auth against reporting/single, clearance/single and compliance/invoices and surfaces ZATCA's native 401 Unauthorized — the deepest live verification possible without an onboarded CSID (we never sign, so we cannot mint a valid document).
Safety
Pure stateless translation layer straight to the government ZATCA gateway. ECDSA signing and the ICV/PIH hash-chain stay merchant-side; the CSID token and secret travel per-request in headers, nothing is stored. Privacy policy.
Sister servers
Invoices: Poland KSeF inv-pl · Mexico CFDI 4.0 inv-mx · Chile DTE inv-cl · Brazil NF-e inv-br · Peru CPE inv-pe · India GST inv-in · Local payments in 81 countries, one family: mcp.wishpool.app · Taiwan e-invoice 電子發票 included.
MIT licensed.
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for Mini Accountant: invoices, expenses, customers, analytics, tax estimates.
A paid remote MCP for hosted MCP server, built to return verdicts, receipts, usage logs, and audit-r
Brazilian fiscal MCP server - issue NF-e, NFC-e, NFS-e, CT-e, MDF-e and DC-e via SEFAZ.
A paid remote MCP for CLI tool MCP, built to return verdicts, receipts, usage logs, and audit-ready
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for German e-invoice compliance (XRechnung 3.0 & ZUGFeRD 2.x) enabling AI agents to validate, generate, parse, and check compliance of electronic invoices per EN 16931.61MIT
- AlicenseAqualityDmaintenanceAn AI-native MCP server for Saudi e-invoicing that generates ZATCA-compliant invoices, QR codes, and XML from natural language, with validation and Phase 2 signing capabilities.94Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server that exposes tools for Taiwan's ezPay e-invoice lifecycle, enabling AI assistants to issue, void, and query invoices and allowances through the standard MCP protocol.1MIT
- AlicenseAqualityCmaintenanceMCP server for creating and fiscalizing invoices via solo.com.hr API. Enables AI agents to generate invoices, retrieve invoice details, list invoices, and check next invoice number.4MIT