NBrain Saudi ZATCA MCP Server
nbrain-zatca-mcp — Official Saudi ZATCA Phase 1 & Phase 2 MCP Server
Built by NBrain (منظومة إن برين — nbra.in) & Eng. Nadeem Mohamed Badr El-Din
A production-grade, zero-dependency Model Context Protocol (MCP) server giving AI agents (Claude Desktop, Cursor, VS Code, Windsurf, Cline, Antigravity) native tools to decode, encode, and validate Saudi ZATCA (Fatoora) Phase 1 & Phase 2 TLV QR codes and compute Decimal-safe 15% SAR VAT with zero floating-point drift.
Live Free Browser Tool (Zero Signup, WebMCP): https://nbra.in/tools/zatca-qr-inspector
Live Remote HTTP MCP Endpoint:
https://nbra.in/mcp(Manifest)Open-Source Python TLV Library (MIT): https://github.com/NBrain-Studio/nbrain-zatca-tlv
50-Case Validation Benchmark Dataset (CC-BY-4.0): https://github.com/NBrain-Studio/zatca-tlv-benchmark
Enterprise ZATCA Phase 2 ERP Architecture: https://nadeembadr.com/solutions/zatca-phase-2-erp/
Exposed MCP Tools
Tool Name | Purpose |
| Decodes any Saudi ZATCA Base64 TLV QR payload (Phase 1 Tags 1–5 & Phase 2 Cryptographic Tags 6–9) and validates 15-digit VAT format & UTF-8 byte boundaries. |
| Encodes Arabic/English seller name, 15-digit Saudi VAT number ( |
| Checks strict Saudi ZATCA 15-digit VAT registration rules. |
| Computes exact SAR subtotal, 15% VAT (or custom GCC/Egypt rate), and total using Python |
Related MCP server: zatca-mcp
Quick Start (Local Stdio or Live Remote HTTP)
Option 1 — Connect to Live Remote MCP Endpoint (Zero Install)
{
"mcpServers": {
"nbrain-zatca": {
"url": "https://nbra.in/mcp"
}
}
}Option 2 — Install Locally (Claude Desktop / Cursor / VS Code / Antigravity)
pip install git+https://github.com/NBrain-Studio/nbrain-zatca-mcp.git{
"mcpServers": {
"nbrain-zatca": {
"command": "nbrain-zatca-mcp"
}
}
}Security & Privacy
100% Stateless & Zero Secrets: Requires no API keys, no environment variables, and stores zero invoice data.
MIT Licensed: Free for commercial Saudi, Egyptian, GCC, and global ERP teams.
Author & Maintainer
Organization: NBrain (منظومة إن برين) · GitHub Verified Org · LinkedIn · Dev.to
Founder: Eng. Nadeem Mohamed Badr El-Din (nadeembadr.com · ORCID 0009-0005-5836-2631)
Available Tools
4 toolscalculate_saudi_vatA
Compute exact Saudi 15% VAT (or custom VAT percentage) using Decimal ROUND_HALF_UP halala arithmetic.
Inputs: subtotal (required), vat_rate.
decode_zatca_tlvA
Decode and validate a Saudi ZATCA Phase 1 (Tags 1-5) or Phase 2 (Tags 1-9) Base64 TLV QR payload.
Inputs: payload (required).
encode_zatca_tlvA
Encode Saudi ZATCA Phase 1 invoice fields into a compliant UTF-8 Base64 TLV QR string.
Inputs: timestamp (required), vat_amount (required), vat_number (required), seller_name (required), +1 more.
validate_saudi_vat_numberB
Validate whether a string conforms to Saudi ZATCA 15-digit VAT registration format (3XXXXXXXXXXXXX3).
Inputs: vat_number (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct operation: decoding TLV, encoding TLV, validating a VAT number, and computing VAT. There is no overlap between QR payload handling and VAT arithmetic, so an agent can pick the right tool unambiguously.
All four names follow a strict verb_noun snake_case pattern (decode_/encode_/validate_/calculate_ + domain object). The two TLV tools are symmetrically named, reinforcing predictability.
Four focused tools are reasonable for a narrow ZATCA QR/VAT utility server, and each earns its place. It sits at the thin end of the ideal range, with no redundancy but little headroom.
The set covers a sensible round trip (encode/decode TLV, VAT validation, VAT calculation), but decode handles Phase 1 and Phase 2 while encode only supports Phase 1 fields, leaving an asymmetric gap. There is also no tool to validate or generate a QR directly from a full invoice object, forcing agents to compose steps manually.
Maintenance
Related MCP Connectors
AI VAT Number Validation: hosted MCP server for EU VAT number checks via VIES.
MCP server for Quaderno — tax-rate calculation, invoices, contacts, products, receipts & expenses.
Brazilian fiscal MCP server - issue NF-e, NFC-e, NFS-e, CT-e, MDF-e and DC-e via SEFAZ.
Nigeria PAYE, VAT and CBN rates, sourced and dated. Plus invoice totals, QR codes, JSON, Base64.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for DACH e-invoicing. Create XRechnung (UBL) and ZUGFeRD 2.3 (Factur-X CII) invoices, validate against EN 16931 rules, extract data from XML, and convert between UBL, CII and JSON formats.667 npm3MIT
- 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.95Apache 2.0
- AlicenseAqualityBmaintenanceModel Context Protocol (MCP) server for Brazilian Electronic Invoicing (NF-e / NFC-e, modelo 55/65, schema 4.00). Provides CPF/CNPJ validation tools, with NF-e/NFC-e generation and SEFAZ integration planned.22113 PyPI1Apache 2.0
- AlicenseAqualityCmaintenanceMCP server for correct Arabic formatting — currency, Hijri dates, number-to-words, RTL fixes and validation across all 22 Arab countries. Zero-dependency.17100 npm3MIT