zatca
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ZATCA QR Toolkit
Small, exact helpers for Saudi e-invoices — VAT-number checks, VAT and invoice totals in exact halalas, and the simplified-invoice QR code — usable from Python, the command line, or by Claude as MCP tools.
Why
Every Saudi point-of-sale, booking system and online store has to print a QR code on simplified invoices and get VAT right to the halala. The common bugs are small and expensive:
Floats in money.
0.1 + 0.2and a 15% multiply later, the VAT on the receipt is a halala off from the VAT in the books.Arabic seller names counted in characters. The QR code's length byte counts bytes; an Arabic letter is two. Get it wrong and the code scans as garbage — and a name over 255 bytes cannot be encoded at all.
VAT numbers that fail the format rule (15 digits, first and last digit 3), caught only when an invoice is rejected.
Letting an AI assistant do the arithmetic. A model asked "what's the VAT on these lines?" will answer confidently and sometimes wrongly.
Related MCP server: Qoyod MCP Server
What it does
check_vat_number— normalises Arabic-Indic digits, spaces and dashes, then checks the 15-digit, 3…3 format. A valid format does not prove a number is registered; only ZATCA's taxpayer lookup can.invoice_totals— net, VAT per rate (15%, 0%, …) and total from invoice lines with quantities, unit prices and discounts. Exact fractions in, integer halalas out; VAT is rounded half up once per rate.QR code (Phase 1 fields, tags 1–5) — build the Base64 TLV payload and a PNG; read a payload back, including the Phase 2 tags 6–9 as raw bytes. The check separates errors (malformed, breaks a format rule — never encoded) from warnings (well-formed but worth a look, e.g. VAT that is not 15% of the net amount, which is fine for zero-rated lines).
MCP server — the four operations as tools, so Claude computes nothing itself: it passes text in, gets exact text back.
Encoding is checked against the widely published "Bobs Records" example from ZATCA's QR guidance, byte for byte.
Use it
uv sync --frozen
# CLI
uv run python -m zatcakit.cli vat 300000000000003
uv run python -m zatcakit.cli qr build --seller "متجر ركن البن" --vat 300000000000003 \
--time 2026-12-03T14:30:00+03:00 --total 1035.00 --vat-total 135.00 --png qr.png
uv run python -m zatcakit.cli qr read "AQxCb2JzIFJlY29yZHMC..."from fractions import Fraction
from zatcakit.money import Line, invoice_totals, format_sar
totals = invoice_totals(
[
Line("Hand grinder", Fraction(1), 30348),
Line("Coffee beans", Fraction(3), 5652, discount_halalas=500),
Line("Export shipment", Fraction(1), 10000, vat_rate=Fraction(0)),
]
)
format_sar(totals.vat_halalas) # '70.21'As Claude tools (MCP)
Add the server to Claude Code:
claude mcp add zatca -- uv --directory /path/to/zatca-qr-toolkit run python -m zatcakit.serveror to any MCP client's config:
{
"mcpServers": {
"zatca": {
"command": "uv",
"args": ["--directory", "/path/to/zatca-qr-toolkit", "run", "python", "-m", "zatcakit.server"]
}
}
}Then ask: "Calculate the invoice for 2 kettles at 275 SAR and a pack of filters at 24 SAR, and give me the QR payload for seller Rukn Al Bunn, VAT 300000000000003."
Scope
In: Phase 1 QR fields, reading Phase 2 tags, VAT-number format, VAT and totals arithmetic.
Out: Phase 2 (integration) — UBL XML, cryptographic stamps and clearance/reporting with ZATCA need a device certificate from ZATCA's onboarding and belong in a certified e-invoicing solution. This toolkit does not make a system ZATCA-compliant on its own; check requirements with your accountant or e-invoicing provider.
Quality gates
Every push runs ruff, mypy --strict, 52 tests at ≥ 95% branch coverage
(99% today, warnings as errors), a dependency audit and a secret scan.
Built with Claude Code under the rules in
claude-code-production-playbook.
About
Built by Mahmoud (@Akairo27), freelance developer since 2012, based in Makkah, building invoicing, booking and AI systems for businesses in Saudi Arabia.
MIT licence.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Saudi ZATCA TLV & UAE PINT-AE TRN inspector, encoder & Decimal GCC VAT MCP server by NBrain
Create, send and track invoices from a conversation in Claude, ChatGPT or any MCP client that supports OAuth. Draft an invoice from one sentence or from last month's invoice for the same client, finalize it, email it to your client and send payment reminders for overdue ones. See revenue by month and by client, download PDFs and e-invoices (ZUGFeRD, XRechnung), and export DATEV packages for your tax advisor. Invoices follow the tax rules of 25 countries, including reverse charge and the small-business VAT exemption. New invoices are drafts, and nothing is emailed until you ask. Pay per invoice with no subscription: the first invoice is free.
Read-only Amazon profit, fee, ACoS, and geo-holdout MCP tools for Claude, ChatGPT, and agents.
SmartMoney77 MCP v0.6.0 — 14 public tools that turn financial questions into exact numbers and citable links. New: historical_investment_return and compare_investments, which compute "what if I had invested" results from real yearly price data. Also compound interest, FIRE number, credit-card payoff, emergency fund, inflation, latte factor, investment fees, cost of waiting, plus discovery/deep-link/share-pack tools for a catalog of calculators in 6 languages (he/en/ar/es/pt/in). Public, no login. Endpoint: https://smartmoney77.com/mcp
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceRemote 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.MIT
- FlicenseNot gradedqualityDmaintenanceConnects Claude to the Qoyod accounting system via its REST API, enabling natural language management of customers, invoices, vendors, journal entries, and other accounting resources through MCP tools.-
- AlicenseAqualityBmaintenanceEnables MCP clients such as Claude Desktop, Cursor, or a LangGraph agent to turn scanned or photographed invoices into structured data using OpenCV preprocessing and Tesseract OCR, then validate them against Saudi VAT rules and store them in SQLite. It also lets agents list, filter, and query stored invoices with read-only SQL to answer spending questions.7MIT
- AlicenseAqualityBmaintenanceEnables Claude and other MCP-compatible AI assistants to create GST invoices, calculate GST, validate GSTINs, search HSN/SAC codes, and analyze PDF or CSV bank statements with decoded UPI narrations. It also supports IFSC and PIN code lookups, with most sensitive financial processing done locally.12113 npmMIT