@ansvar/uae-law-mcp 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +359 -0
  3. package/data/database.db +0 -0
  4. package/dist/capabilities.d.ts +16 -0
  5. package/dist/capabilities.d.ts.map +1 -0
  6. package/dist/capabilities.js +43 -0
  7. package/dist/capabilities.js.map +1 -0
  8. package/dist/constants.d.ts +7 -0
  9. package/dist/constants.d.ts.map +1 -0
  10. package/dist/constants.js +7 -0
  11. package/dist/constants.js.map +1 -0
  12. package/dist/index.d.ts +8 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +80 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/tools/about.d.ts +40 -0
  17. package/dist/tools/about.d.ts.map +1 -0
  18. package/dist/tools/about.js +72 -0
  19. package/dist/tools/about.js.map +1 -0
  20. package/dist/tools/build-legal-stance.d.ts +24 -0
  21. package/dist/tools/build-legal-stance.d.ts.map +1 -0
  22. package/dist/tools/build-legal-stance.js +52 -0
  23. package/dist/tools/build-legal-stance.js.map +1 -0
  24. package/dist/tools/check-currency.d.ts +22 -0
  25. package/dist/tools/check-currency.d.ts.map +1 -0
  26. package/dist/tools/check-currency.js +44 -0
  27. package/dist/tools/check-currency.js.map +1 -0
  28. package/dist/tools/format-citation.d.ts +19 -0
  29. package/dist/tools/format-citation.d.ts.map +1 -0
  30. package/dist/tools/format-citation.js +38 -0
  31. package/dist/tools/format-citation.js.map +1 -0
  32. package/dist/tools/get-eu-basis.d.ts +26 -0
  33. package/dist/tools/get-eu-basis.d.ts.map +1 -0
  34. package/dist/tools/get-eu-basis.js +57 -0
  35. package/dist/tools/get-eu-basis.js.map +1 -0
  36. package/dist/tools/get-provision-eu-basis.d.ts +21 -0
  37. package/dist/tools/get-provision-eu-basis.d.ts.map +1 -0
  38. package/dist/tools/get-provision-eu-basis.js +46 -0
  39. package/dist/tools/get-provision-eu-basis.js.map +1 -0
  40. package/dist/tools/get-provision.d.ts +27 -0
  41. package/dist/tools/get-provision.d.ts.map +1 -0
  42. package/dist/tools/get-provision.js +88 -0
  43. package/dist/tools/get-provision.js.map +1 -0
  44. package/dist/tools/get-uae-implementations.d.ts +29 -0
  45. package/dist/tools/get-uae-implementations.d.ts.map +1 -0
  46. package/dist/tools/get-uae-implementations.js +50 -0
  47. package/dist/tools/get-uae-implementations.js.map +1 -0
  48. package/dist/tools/list-sources.d.ts +26 -0
  49. package/dist/tools/list-sources.d.ts.map +1 -0
  50. package/dist/tools/list-sources.js +63 -0
  51. package/dist/tools/list-sources.js.map +1 -0
  52. package/dist/tools/registry.d.ts +13 -0
  53. package/dist/tools/registry.d.ts.map +1 -0
  54. package/dist/tools/registry.js +387 -0
  55. package/dist/tools/registry.js.map +1 -0
  56. package/dist/tools/search-eu-implementations.d.ts +25 -0
  57. package/dist/tools/search-eu-implementations.d.ts.map +1 -0
  58. package/dist/tools/search-eu-implementations.js +59 -0
  59. package/dist/tools/search-eu-implementations.js.map +1 -0
  60. package/dist/tools/search-legislation.d.ts +27 -0
  61. package/dist/tools/search-legislation.d.ts.map +1 -0
  62. package/dist/tools/search-legislation.js +60 -0
  63. package/dist/tools/search-legislation.js.map +1 -0
  64. package/dist/tools/validate-citation.d.ts +29 -0
  65. package/dist/tools/validate-citation.d.ts.map +1 -0
  66. package/dist/tools/validate-citation.js +129 -0
  67. package/dist/tools/validate-citation.js.map +1 -0
  68. package/dist/tools/validate-eu-compliance.d.ts +22 -0
  69. package/dist/tools/validate-eu-compliance.d.ts.map +1 -0
  70. package/dist/tools/validate-eu-compliance.js +103 -0
  71. package/dist/tools/validate-eu-compliance.js.map +1 -0
  72. package/dist/utils/as-of-date.d.ts +9 -0
  73. package/dist/utils/as-of-date.d.ts.map +1 -0
  74. package/dist/utils/as-of-date.js +25 -0
  75. package/dist/utils/as-of-date.js.map +1 -0
  76. package/dist/utils/fts-query.d.ts +21 -0
  77. package/dist/utils/fts-query.d.ts.map +1 -0
  78. package/dist/utils/fts-query.js +49 -0
  79. package/dist/utils/fts-query.js.map +1 -0
  80. package/dist/utils/metadata.d.ts +16 -0
  81. package/dist/utils/metadata.d.ts.map +1 -0
  82. package/dist/utils/metadata.js +25 -0
  83. package/dist/utils/metadata.js.map +1 -0
  84. package/dist/utils/statute-id.d.ts +21 -0
  85. package/dist/utils/statute-id.d.ts.map +1 -0
  86. package/dist/utils/statute-id.js +51 -0
  87. package/dist/utils/statute-id.js.map +1 -0
  88. package/fixtures/golden-hashes.json +56 -0
  89. package/fixtures/golden-tests.json +180 -0
  90. package/package.json +80 -0
  91. package/sources.yml +100 -0
@@ -0,0 +1,180 @@
1
+ {
2
+ "$schema": "./golden-tests.schema.json",
3
+ "version": "1.0",
4
+ "mcp_name": "UAE Law MCP",
5
+ "description": "Golden contract tests for the UAE Law MCP covering federal data protection (PDPL), cybercrimes, electronic transactions, commercial companies, and DIFC/ADGM free zone data protection legislation",
6
+ "tests": [
7
+ {
8
+ "id": "ae-001",
9
+ "category": "article_retrieval",
10
+ "description": "Retrieve Article 2 of the Personal Data Protection Law (Federal Decree-Law No. 45/2021) — definitions including personal data, data controller, data processor",
11
+ "tool": "get_provision",
12
+ "input": {
13
+ "law_identifier": "Federal Decree-Law No. 45/2021 on Personal Data Protection",
14
+ "article": "2"
15
+ },
16
+ "assertions": {
17
+ "result_not_empty": true,
18
+ "text_contains": ["personal data"],
19
+ "fields_present": ["text", "article_number"],
20
+ "text_not_empty": true
21
+ }
22
+ },
23
+ {
24
+ "id": "ae-002",
25
+ "category": "article_retrieval",
26
+ "description": "Retrieve Article 1 of the Cybercrimes Law (Federal Decree-Law No. 34/2021) — definitions and scope",
27
+ "tool": "get_provision",
28
+ "input": {
29
+ "law_identifier": "Federal Decree-Law No. 34/2021 on Combatting Rumours and Cybercrimes",
30
+ "article": "1"
31
+ },
32
+ "assertions": {
33
+ "result_not_empty": true,
34
+ "any_result_contains": ["cybercrime", "information system", "electronic"],
35
+ "fields_present": ["text", "article_number"],
36
+ "text_not_empty": true
37
+ }
38
+ },
39
+ {
40
+ "id": "ae-003",
41
+ "category": "article_retrieval",
42
+ "description": "Retrieve Article 1 of the DIFC Data Protection Law (Law No. 5/2020) — application and scope",
43
+ "tool": "get_provision",
44
+ "input": {
45
+ "law_identifier": "DIFC Data Protection Law No. 5/2020",
46
+ "article": "1"
47
+ },
48
+ "assertions": {
49
+ "result_not_empty": true,
50
+ "any_result_contains": ["personal data", "data protection", "DIFC"],
51
+ "fields_present": ["text"],
52
+ "text_not_empty": true
53
+ }
54
+ },
55
+ {
56
+ "id": "ae-004",
57
+ "category": "search",
58
+ "description": "Full-text search for 'personal data' returns PDPL and data protection provisions",
59
+ "tool": "search_legislation",
60
+ "input": {
61
+ "query": "personal data"
62
+ },
63
+ "assertions": {
64
+ "result_not_empty": true,
65
+ "min_results": 1,
66
+ "any_result_contains": ["Personal Data Protection", "personal data", "data controller"]
67
+ }
68
+ },
69
+ {
70
+ "id": "ae-005",
71
+ "category": "search",
72
+ "description": "Full-text search for 'cybercrime' returns Cybercrimes Law provisions",
73
+ "tool": "search_legislation",
74
+ "input": {
75
+ "query": "cybercrime"
76
+ },
77
+ "assertions": {
78
+ "result_not_empty": true,
79
+ "min_results": 1,
80
+ "any_result_contains": ["Combatting Rumours and Cybercrimes", "cybercrime", "information system"]
81
+ }
82
+ },
83
+ {
84
+ "id": "ae-006",
85
+ "category": "search",
86
+ "description": "Full-text search for 'electronic transaction' returns Electronic Transactions Law provisions",
87
+ "tool": "search_legislation",
88
+ "input": {
89
+ "query": "electronic transaction"
90
+ },
91
+ "assertions": {
92
+ "result_not_empty": true,
93
+ "min_results": 1,
94
+ "any_result_contains": ["Electronic Transactions", "electronic", "trust services"]
95
+ }
96
+ },
97
+ {
98
+ "id": "ae-007",
99
+ "category": "citation_roundtrip",
100
+ "description": "Citation for PDPL Article 3 includes moj.gov.ae or difclaws.com URL pattern",
101
+ "tool": "get_provision",
102
+ "input": {
103
+ "law_identifier": "Federal Decree-Law No. 45/2021 on Personal Data Protection",
104
+ "article": "3"
105
+ },
106
+ "assertions": {
107
+ "result_not_empty": true,
108
+ "citation_url_pattern": "(moj\\.gov\\.ae|difclaws\\.com|adgm\\.com)",
109
+ "text_not_empty": true
110
+ }
111
+ },
112
+ {
113
+ "id": "ae-008",
114
+ "category": "citation_roundtrip",
115
+ "description": "Citation for Commercial Companies Law Article 1 includes official source reference",
116
+ "tool": "get_provision",
117
+ "input": {
118
+ "law_identifier": "Federal Law No. 2/2015 on Commercial Companies",
119
+ "article": "1"
120
+ },
121
+ "assertions": {
122
+ "result_not_empty": true,
123
+ "fields_present": ["text"],
124
+ "text_not_empty": true
125
+ }
126
+ },
127
+ {
128
+ "id": "ae-009",
129
+ "category": "eu_cross_reference",
130
+ "description": "PDPL cross-reference to GDPR — the UAE PDPL was influenced by GDPR principles",
131
+ "tool": "get_provision_eu_basis",
132
+ "input": {
133
+ "law_identifier": "Federal Decree-Law No. 45/2021 on Personal Data Protection"
134
+ },
135
+ "assertions": {
136
+ "result_not_empty": true,
137
+ "any_result_contains": ["GDPR", "General Data Protection Regulation", "2016/679", "data protection"]
138
+ }
139
+ },
140
+ {
141
+ "id": "ae-010",
142
+ "category": "eu_cross_reference",
143
+ "description": "DIFC Data Protection Law cross-reference to GDPR — DIFC DPL is closely modeled on GDPR",
144
+ "tool": "get_provision_eu_basis",
145
+ "input": {
146
+ "law_identifier": "DIFC Data Protection Law No. 5/2020"
147
+ },
148
+ "assertions": {
149
+ "result_not_empty": true,
150
+ "any_result_contains": ["GDPR", "General Data Protection Regulation", "2016/679", "EU"]
151
+ }
152
+ },
153
+ {
154
+ "id": "ae-011",
155
+ "category": "negative_test",
156
+ "description": "Non-existent UAE law returns graceful error or empty result",
157
+ "tool": "get_provision",
158
+ "input": {
159
+ "law_identifier": "Federal Decree-Law No. 9999/2099 on Fictional Matters",
160
+ "article": "1"
161
+ },
162
+ "assertions": {
163
+ "handles_gracefully": true
164
+ }
165
+ },
166
+ {
167
+ "id": "ae-012",
168
+ "category": "negative_test",
169
+ "description": "Malformed article number returns graceful error or empty result",
170
+ "tool": "get_provision",
171
+ "input": {
172
+ "law_identifier": "Federal Decree-Law No. 45/2021 on Personal Data Protection",
173
+ "article": "999ZZZ-INVALID"
174
+ },
175
+ "assertions": {
176
+ "handles_gracefully": true
177
+ }
178
+ }
179
+ ]
180
+ }
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@ansvar/uae-law-mcp",
3
+ "version": "1.1.2",
4
+ "mcpName": "eu.ansvar/uae-law-mcp",
5
+ "description": "UAE law database covering federal data protection (PDPL), cybercrimes, electronic transactions, commercial companies, and DIFC/ADGM free zone data protection law with full-text search",
6
+ "author": "Ansvar Systems <hello@ansvar.eu>",
7
+ "license": "Apache-2.0",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/Ansvar-Systems/uae-law-mcp.git"
11
+ },
12
+ "homepage": "https://ansvar.eu",
13
+ "keywords": [
14
+ "mcp",
15
+ "model-context-protocol",
16
+ "uae-law",
17
+ "pdpl",
18
+ "personal-data-protection",
19
+ "cybercrimes",
20
+ "electronic-transactions",
21
+ "commercial-companies",
22
+ "difc",
23
+ "adgm",
24
+ "legislation",
25
+ "legal",
26
+ "compliance",
27
+ "middle-east",
28
+ "ansvar"
29
+ ],
30
+ "type": "module",
31
+ "main": "dist/server.js",
32
+ "bin": {
33
+ "uae-law-mcp": "dist/server.js"
34
+ },
35
+ "files": [
36
+ "dist/",
37
+ "data/database.db",
38
+ "sources.yml",
39
+ "fixtures/",
40
+ "LICENSE",
41
+ "README.md"
42
+ ],
43
+ "scripts": {
44
+ "build": "tsc",
45
+ "test": "vitest run",
46
+ "test:contract": "vitest run __tests__/contract/",
47
+ "test:watch": "vitest",
48
+ "lint": "tsc --noEmit",
49
+ "start": "node dist/server.js",
50
+ "start:stdio": "node dist/server.js --stdio",
51
+ "health": "curl -s http://localhost:3000/health | jq .",
52
+ "build:db": "tsx scripts/build-db.ts",
53
+ "build:db:free": "tsx scripts/build-db-free.ts",
54
+ "ingest": "tsx scripts/ingest.ts",
55
+ "drift:detect": "tsx scripts/drift-detect.ts",
56
+ "check:freshness": "tsx scripts/check-freshness.ts",
57
+ "validate": "npm run lint && npm run test && npm run test:contract"
58
+ },
59
+ "dependencies": {
60
+ "@ansvar/mcp-sqlite": "^1.0.0",
61
+ "@modelcontextprotocol/sdk": "^1.12.0",
62
+ "@types/better-sqlite3": "^7.6.13",
63
+ "better-sqlite3": "^12.6.2",
64
+ "zod": "^3.23.0"
65
+ },
66
+ "devDependencies": {
67
+ "@types/node": "^22.0.0",
68
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
69
+ "@typescript-eslint/parser": "^8.0.0",
70
+ "cheerio": "^1.0.0",
71
+ "eslint": "^9.0.0",
72
+ "prettier": "^3.4.0",
73
+ "tsx": "^4.19.0",
74
+ "typescript": "^5.7.0",
75
+ "vitest": "^3.0.0"
76
+ },
77
+ "engines": {
78
+ "node": ">=18.0.0"
79
+ }
80
+ }
package/sources.yml ADDED
@@ -0,0 +1,100 @@
1
+ # sources.yml
2
+ schema_version: "1.0"
3
+ mcp_name: "UAE Law MCP"
4
+ jurisdiction: "AE"
5
+
6
+ sources:
7
+ - name: "UAE Ministry of Justice (Official Legislation Portal)"
8
+ authority: "Ministry of Justice, United Arab Emirates"
9
+ official_portal: "https://moj.gov.ae"
10
+ canonical_identifier: "N/A (UAE legislation identified by Federal Decree-Law/Law number and year; no standardized URI scheme)"
11
+ retrieval_method: "HTML_SCRAPE"
12
+ api_documentation: "N/A"
13
+ update_frequency: "monthly"
14
+ last_ingested: "PENDING_FIRST_INGEST"
15
+ license_or_terms:
16
+ type: "Government Open Data"
17
+ url: "https://moj.gov.ae"
18
+ summary: "UAE federal legislation is publicly available through the Ministry of Justice portal; government publications are accessible for informational purposes"
19
+ coverage:
20
+ scope: "Federal Decree-Laws, Federal Laws, Cabinet Decisions, and ministerial resolutions including PDPL (45/2021), Cybercrimes Law (34/2021), Electronic Transactions Law (46/2021), Commercial Companies Law (2/2015), and related implementing regulations"
21
+ limitations: "Emirate-level legislation not comprehensively covered; historical laws prior to digitization may be incomplete; implementing regulations may lag behind primary legislation; Arabic is the authoritative language — English translations are unofficial unless from DIFC/ADGM"
22
+ languages:
23
+ - "ar"
24
+ - "en"
25
+
26
+ - name: "DIFC Laws and Regulations"
27
+ authority: "Dubai International Financial Centre (DIFC)"
28
+ official_portal: "https://difclaws.com"
29
+ canonical_identifier: "DIFC Law No. [number]/[year]"
30
+ retrieval_method: "HTML_SCRAPE"
31
+ api_documentation: "N/A"
32
+ update_frequency: "on_change"
33
+ last_ingested: "PENDING_FIRST_INGEST"
34
+ license_or_terms:
35
+ type: "Government Open Data"
36
+ url: "https://difclaws.com/terms"
37
+ summary: "DIFC laws and regulations are published in English and freely accessible; DIFC is a common-law jurisdiction within Dubai with its own courts and regulatory framework"
38
+ coverage:
39
+ scope: "DIFC Data Protection Law (Law No. 5/2020), DIFC Operating Law, DIFC Companies Law, DIFC Employment Law, DIFC Insolvency Law, DIFC Arbitration Law, and all DIFC regulations and rules of court"
40
+ limitations: "Only covers DIFC free zone laws; does not include Dubai or UAE federal legislation; DIFC court decisions not fully indexed"
41
+ languages:
42
+ - "en"
43
+
44
+ - name: "ADGM Legal Framework"
45
+ authority: "Abu Dhabi Global Market (ADGM)"
46
+ official_portal: "https://adgm.com/legal-framework"
47
+ canonical_identifier: "ADGM Regulations [year]"
48
+ retrieval_method: "HTML_SCRAPE"
49
+ api_documentation: "N/A"
50
+ update_frequency: "on_change"
51
+ last_ingested: "PENDING_FIRST_INGEST"
52
+ license_or_terms:
53
+ type: "Government Open Data"
54
+ url: "https://adgm.com/legal-framework"
55
+ summary: "ADGM laws and regulations are published in English and freely accessible; ADGM is a common-law jurisdiction within Abu Dhabi with its own courts and regulatory framework"
56
+ coverage:
57
+ scope: "ADGM Data Protection Regulations 2021, ADGM Companies Regulations, ADGM Financial Services regulations, ADGM Employment Regulations, and all ADGM guidance and rules"
58
+ limitations: "Only covers ADGM free zone laws; does not include Abu Dhabi emirate or UAE federal legislation; ADGM court decisions not fully indexed"
59
+ languages:
60
+ - "en"
61
+
62
+ - name: "WAM (Emirates News Agency) — Official Gazette"
63
+ authority: "Emirates News Agency (WAM)"
64
+ official_portal: "https://www.wam.ae"
65
+ canonical_identifier: "N/A (gazette notices by date and number)"
66
+ retrieval_method: "HTML_SCRAPE"
67
+ api_documentation: "N/A"
68
+ update_frequency: "weekly"
69
+ last_ingested: "PENDING_FIRST_INGEST"
70
+ license_or_terms:
71
+ type: "Government Publication"
72
+ url: "https://www.wam.ae"
73
+ summary: "Official UAE government news and gazette publications; WAM is the official state news agency and publishes legislative announcements"
74
+ coverage:
75
+ scope: "Official government gazette notices, promulgation announcements for new Federal Decree-Laws, and regulatory updates"
76
+ limitations: "Not a structured legal database; primarily news announcements; full legal texts must be obtained from MOJ or official gazette"
77
+ languages:
78
+ - "ar"
79
+ - "en"
80
+
81
+ data_freshness:
82
+ automated_checks: true
83
+ check_frequency: "weekly"
84
+ last_verified: "PENDING_FIRST_INGEST"
85
+
86
+ # Notes:
87
+ # - UAE has a complex multi-layered legal system: Federal law applies across all
88
+ # emirates, but free zones (DIFC in Dubai, ADGM in Abu Dhabi) have their own
89
+ # independent legal systems based on common law (English language)
90
+ # - The federal Personal Data Protection Law (PDPL, Federal Decree-Law No. 45/2021)
91
+ # is the overarching data protection framework, effective January 2, 2022
92
+ # - DIFC Data Protection Law (Law No. 5/2020) and ADGM Data Protection Regulations 2021
93
+ # are separate regimes that apply within their respective free zones
94
+ # - The UAE Data Office (established 2022) oversees implementation of the federal PDPL
95
+ # - Arabic is the official legal language for federal legislation; DIFC and ADGM laws
96
+ # are natively drafted in English
97
+ # - The Cybercrimes Law (Federal Decree-Law No. 34/2021) replaced the older
98
+ # Federal Decree-Law No. 5/2012 on Combating Cybercrimes
99
+ # - Telecommunications Regulatory Authority (TRA, now TDRA) regulates ICT sector
100
+ # - Critical for Ansvar's Middle East market expansion