Skip to main content
Glama
nbrain-egypt-eta-mcp

nbrain-egypt-eta-mcp

nbrain-egypt-eta — Egyptian Tax Authority (ETA) E-Invoice & E-Receipt Engine + MCP Server

Engineered by Eng. Nadeem Mohamed Badr El-Din at NBrain (منظومة إن برين — nbra.in).

nbrain-egypt-eta is a zero-dependency, deterministic Python SDK, CLI, and Model Context Protocol (MCP) server implementing the official Egyptian Tax Authority (مصلحة الضرائب المصرية — sdk.invoicing.eta.gov.eg) specifications for B2B E-Invoices v1.0 and B2C E-Receipts v1.2:

  • Official ETA Recursive Uppercase Serialization: Implements the exact sdk.invoicing.eta.gov.eg Document Serialization Approach (culture-invariant uppercase property framing, verbatim numeric/Decimal preservation so "0.0" never drifts, and repeated "ARRAYNAME""ARRAYNAME"<element> array prefixing).

  • CAdES-BES Hash & 64-Hex E-Receipt UUID Generation: Strips signatures (for B2B E-Invoices) or header.uuid (for B2C E-Receipts) and computes the exact UTF-8 SHA-256 digest.

  • Sequential POS previousUUID Chain Verification: Audits multi-receipt B2C POS batches for broken cryptographic links.

  • Zero-Drift Decimal Egyptian Tax Arithmetic (EGP): Standard 14% VAT (T1), Table Tax (T2/T3), and Withholding Tax (T4 — الخصم والتحصيل تحت حساب الضريبة at 1%, 3%, 5% deducted strictly from net amount).

  • Egyptian 9-Digit Tax Registration Number (RIN) Validator: Validates XXX-XXX-XXX / 9-digit corporate RIN identifiers.

  • Built-in MCP JSON-RPC 2.0 Server (nbrain-egypt-eta-mcp): Ready for Claude Desktop, Cursor, VS Code, Windsurf, and Google Antigravity.

Try Live in Browser (Zero Signup)

Related MCP server: al.square/fiskalizimi

Quick Usage

from nbrain_egypt_eta import (
    serialize_eta_document,
    compute_eta_sha256_uuid,
    calculate_egypt_vat_and_wht,
    validate_egypt_rin,
)

raw_json = '''{
  "header": {"dateTimeIssued": "2026-12-06T10:00:00Z", "receiptNumber": "R-001", "uuid": ""},
  "seller": {"rin": "123456789", "companyTradeName": "NBrain Egypt"},
  "taxableItems": [
    {"taxType": "T1", "amount": 140.00, "subType": "V009", "rate": 14}
  ],
  "totalAmount": 1140.00
}'''

res = compute_eta_sha256_uuid(raw_json, mode="ereceipt")
print("Canonical:", res["canonical_string"])
print("64-Hex UUID:", res["sha256_hex"])

tax = calculate_egypt_vat_and_wht("1000.00", vat_rate="14", wht_rate="3")
print(tax)  # net=1000.00, vat=140.00, wht=30.00, payable=1110.00 EGP

Run Tests

PYTHONPATH=src python -m unittest discover -s tests -v

Citation & Author

Available Tools

4 tools
calculate_egypt_vat_whtBInspect

Calculate exact Decimal Egyptian EGP 14% VAT (T1), Table Tax (T2), and T4 Withholding Tax (1%, 3%, 5%).

Inputs: net_amount (required), vat_rate, wht_rate, table_tax_rate.

compute_eta_document_uuidBInspect

Canonicalize an Egyptian Tax Authority (ETA) B2B E-Invoice or B2C E-Receipt JSON per sdk.invoicing.eta.gov.eg and return the 64-hex UTF-8 SHA-256 UUID / CAdES signing digest.

Inputs: document_json (required), mode.

validate_egypt_tax_rinBInspect

Validate a 9-digit Egyptian corporate Tax Registration Number (RIN / رقم التسجيل الضريبي المصري).

Inputs: rin (required).

verify_eta_ereceipt_chainBInspect

Verify cryptographic UUID and sequential previousUUID links across an array of Egyptian POS B2C E-Receipts.

Inputs: receipts_json (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 4 tools

    Disambiguation4/5

    Each tool has a clearly distinct operation: UUID computation, RIN validation, VAT/WHT calculation, and receipt-chain verification. The only mild overlap is between computing an ETA document UUID and verifying a receipt chain, since both involve UUIDs, but their inputs and purposes are different enough for an agent to choose correctly.

    Naming Consistency4/5

    All four tool names follow a verb_object pattern (compute_*, validate_*, calculate_*, verify_*) and use snake_case consistently. The only minor inconsistency is the domain qualifier varying between 'eta' and 'egypt', but the overall convention remains predictable.

    Tool Count5/5

    Four tools is well-scoped for a focused Egyptian ETA compliance utility. Each tool covers a distinct compliance function, and there are no redundant or trivial entries.

    Completeness4/5

    The surface covers key Egyptian e-invoicing/e-receipt needs: UUID canonicalization, RIN validation, VAT/WHT computation, and chain verification. Minor gaps exist around broader lifecycle operations such as document submission or QR-code generation, but the core computational and validation workflows are present.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides Japanese tax and invoice utilities such as consumption tax calculation, withholding tax, invoice number validation, and tax rate summarization, enabling AI assistants to perform these operations locally without external APIs.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to validate a Japanese qualified invoice against the six required items, reduced-rate markings, per-rate totals, and once-per-invoice-per-rate tax rounding, while flagging the common line-by-line rounding mistake, and to normalize and verify T + 13-digit registration numbers. Read-only tools also compute expected consumption tax for a given amount, rate, price basis, and rounding method.
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to audit Spanish VERI*FACTU invoice chains and exported XML by recomputing AEAT fingerprints and verifying record links, generate AEAT tax QR codes and images, and build or validate Facturae 3.2.2 invoices offline. It also exposes helpers for NIF checks, QR URL checks, compliance deadlines, and credit balances.
      11
      Business Source 1.1