Skip to main content
Glama
NBrain Saudi ZATCA MCP Server

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.


Exposed MCP Tools

Tool Name

Purpose

decode_zatca_tlv

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.

encode_zatca_tlv

Encodes Arabic/English seller name, 15-digit Saudi VAT number (3XXXXXXXXXXXXX3), ISO-8601 timestamp, total, and VAT amount into compliant Base64 TLV bytes.

validate_saudi_vat_number

Checks strict Saudi ZATCA 15-digit VAT registration rules.

calculate_saudi_vat

Computes exact SAR subtotal, 15% VAT (or custom GCC/Egypt rate), and total using Python Decimal ROUND_HALF_UP.


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

Available Tools

4 tools
calculate_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

    A3.7/5.0

    Scored across 4 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count4/5

    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.

    Completeness3/5

    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

    ActivityNo data
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP 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.
      6
      67 npm
      3
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An 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.
      9
      5
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Model 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.
      22
      113 PyPI
      1
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      MCP server for correct Arabic formatting — currency, Hijri dates, number-to-words, RTL fixes and validation across all 22 Arab countries. Zero-dependency.
      17
      100 npm
      3
      MIT