MENA GS1 Pharmaceutical Track-and-Trace & Egypt Nafeza 19-Digit ACID MCP Server
# NBrain MENA GS1 Pharmaceutical Track-and-Trace (`SFDA RSD`, `UAE Tatmeen`, `Egypt EDA`) & Egypt `Nafeza` 19-Digit ACID + MCP
**Engineered by [Eng. Nadeem Mohamed Badr Eldin](https://nadeembadr.com) at [NBrain (`nbra.in`)](https://nbra.in)**.
## Core Capabilities
1. **GS1 DataMatrix 2D Barcode Parser (`FNC1` / `` & HRI `(01)...`)** — Decodes `AI (01)` GTIN-14, `AI (17)` YYMMDD Expiry (including the official GS1 `DD=00` leap-year-aware end-of-month rule), `AI (10)` Batch/Lot, `AI (21)` Unique Serial Number, `AI (00)` SSCC-18, and `AI (410/414)` GLN-13.
2. **Saudi SFDA `RSD` (Rasad), UAE MoHAP `Tatmeen` & Egypt `EDA` Validation** — Blocks expired or check-digit-corrupted packs before pharmacy dispensing and builds **GS1 EPCIS 2.0 JSON-LD** (`SGTIN` / `SGLN` URIs).
3. **Egypt Customs `Nafeza` 19-Digit ACID & IATA `OCI` Segment Generator** — Validates 19-digit ACID declarations, 9-digit Egyptian Importer Tax IDs, and CargoX/IATA Air Waybill `OCI/EG/IMP/M/...` segments.
4. **Built-in Model Context Protocol (`MCP`) Server** — Ready for Claude Code, Cline, Cursor, Docker MCP Toolkit, and Antigravity.
## Run Unit Tests
```bash
python -m unittest discover -s tests -v
```
TDQS
Scored across 4 tools
Each tool targets a distinct artifact: full pack parsing, EPCIS event generation, Egypt ACID/Waybill metadata, and generic GS1 identifier checks. The one blurred boundary is between validate_mena_pharma_pack and verify_gs1_identifier, since pack validation implicitly includes GTIN check-digit verification, and the validate/verify verb distinction is subtle. Descriptions do disambiguate (pack vs single identifier), so misselection risk is low but non-zero.
All names use snake_case with a leading verb (validate_, build_, verify_), giving a predictable pattern. Minor deviation: three names use validate/verify interchangeably for what is essentially checksum/format checking, and 'mena_pharma_pack' drops the GS1 qualifier present in the other names, but the convention is otherwise coherent.
Four tools is on the lean side but each maps to a clearly separate workflow step (pack validation, event build, ACID/customs check, identifier verification), so none feel padded. It sits just below the ideal 5-15 range for a domain this broad, but the scoping is defensible for a focused validator server.
The surface covers inbound validation and outbound EPCIS event generation for Saudi/UAE, plus Egypt customs ACID — but Egypt EDA has a validator with no corresponding EPCIS/reporting event builder, creating an asymmetric dead end. There is also no aggregation/cartonization event support, no master-data or reference lookup, and no way to validate a produced EPCIS event before submission.