@ansvar/eu-regulations-mcp 0.8.0 → 1.1.0

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 (66) hide show
  1. package/README.md +76 -29
  2. package/data/regulations.db +0 -0
  3. package/data/seed/applicability/chips-act.json +67 -0
  4. package/data/seed/applicability/crma.json +85 -0
  5. package/data/seed/chips-act.json +714 -0
  6. package/data/seed/crma.json +877 -0
  7. package/data/seed/mappings/iso27001-chips-act.json +50 -0
  8. package/data/seed/mappings/iso27001-crma.json +50 -0
  9. package/data/seed/mappings/nist-csf-chips-act.json +56 -0
  10. package/data/seed/mappings/nist-csf-crma.json +56 -0
  11. package/dist/database/sqlite-adapter.d.ts +2 -2
  12. package/dist/database/sqlite-adapter.d.ts.map +1 -1
  13. package/dist/database/sqlite-adapter.js.map +1 -1
  14. package/dist/http-server.js +27 -5
  15. package/dist/http-server.js.map +1 -1
  16. package/dist/index.js +27 -4
  17. package/dist/index.js.map +1 -1
  18. package/dist/tools/about.d.ts +40 -0
  19. package/dist/tools/about.d.ts.map +1 -0
  20. package/dist/tools/about.js +61 -0
  21. package/dist/tools/about.js.map +1 -0
  22. package/dist/tools/list.d.ts +7 -0
  23. package/dist/tools/list.d.ts.map +1 -1
  24. package/dist/tools/list.js +73 -8
  25. package/dist/tools/list.js.map +1 -1
  26. package/dist/tools/registry.d.ts +11 -1
  27. package/dist/tools/registry.d.ts.map +1 -1
  28. package/dist/tools/registry.js +56 -4
  29. package/dist/tools/registry.js.map +1 -1
  30. package/dist/worker.d.ts.map +1 -1
  31. package/dist/worker.js +17 -5
  32. package/dist/worker.js.map +1 -1
  33. package/package.json +8 -7
  34. package/scripts/add-cross-references.sql +0 -200
  35. package/scripts/analyze-survey-responses.ts +0 -285
  36. package/scripts/build-db.ts +0 -421
  37. package/scripts/bulk-reingest-all.ts +0 -331
  38. package/scripts/check-updates.ts +0 -294
  39. package/scripts/extract-eprivacy-recitals.ts +0 -98
  40. package/scripts/ingest-eurlex-browser.ts +0 -113
  41. package/scripts/ingest-eurlex.ts +0 -346
  42. package/scripts/ingest-unece.ts +0 -382
  43. package/scripts/migrate-postgres.ts +0 -445
  44. package/scripts/migrate-to-postgres.ts +0 -353
  45. package/scripts/reingest-all-with-recitals.sh +0 -81
  46. package/scripts/sync-versions.ts +0 -206
  47. package/scripts/test-cross-refs.js +0 -26
  48. package/scripts/test-postgres-adapter.ts +0 -146
  49. package/scripts/update-dora-rts-metadata.ts +0 -112
  50. package/src/database/postgres-adapter.ts +0 -84
  51. package/src/database/sqlite-adapter.ts +0 -44
  52. package/src/database/types.ts +0 -10
  53. package/src/http-server.ts +0 -149
  54. package/src/index.ts +0 -61
  55. package/src/middleware/rate-limit.ts +0 -104
  56. package/src/tools/applicability.ts +0 -167
  57. package/src/tools/article.ts +0 -81
  58. package/src/tools/compare.ts +0 -217
  59. package/src/tools/definitions.ts +0 -49
  60. package/src/tools/evidence.ts +0 -84
  61. package/src/tools/list.ts +0 -124
  62. package/src/tools/map.ts +0 -86
  63. package/src/tools/recital.ts +0 -60
  64. package/src/tools/registry.ts +0 -311
  65. package/src/tools/search.ts +0 -297
  66. package/src/worker.ts +0 -708
package/README.md CHANGED
@@ -3,14 +3,14 @@
3
3
  **The EUR-Lex alternative for the AI age.**
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/@ansvar%2Feu-regulations-mcp.svg)](https://www.npmjs.com/package/@ansvar/eu-regulations-mcp)
6
- [![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue)](https://registry.modelcontextprotocol.io/io.github.Ansvar-Systems/eu-regulations-mcp)
6
+ [![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue)](https://registry.modelcontextprotocol.io/eu.ansvar/eu-regulations-mcp)
7
7
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
8
8
  [![GitHub stars](https://img.shields.io/github/stars/Ansvar-Systems/EU_compliance_MCP?style=social)](https://github.com/Ansvar-Systems/EU_compliance_MCP)
9
9
  [![Daily EUR-Lex Check](https://github.com/Ansvar-Systems/EU_compliance_MCP/actions/workflows/check-updates.yml/badge.svg)](https://github.com/Ansvar-Systems/EU_compliance_MCP/actions/workflows/check-updates.yml)
10
10
  [![Database](https://img.shields.io/badge/database-pre--built-green)](docs/COVERAGE_GAPS.md)
11
11
  [![Recitals](https://img.shields.io/badge/recitals-3500%2B-blue)](docs/COVERAGE_GAPS.md)
12
12
 
13
- Query **47 EU regulations** — from GDPR and AI Act to DORA, MiFID II, eIDAS, Medical Device Regulation, and more — directly from Claude, Cursor, or any MCP-compatible client.
13
+ Query **49 EU regulations** — from GDPR and AI Act to DORA, Chips Act, MiFID II, eIDAS, Medical Device Regulation, and more — directly from Claude, Cursor, or any MCP-compatible client.
14
14
 
15
15
  If you're building digital products, financial services, healthcare tech, or connected devices for the European market, this is your compliance reference.
16
16
 
@@ -34,40 +34,59 @@ This MCP server makes EU regulations **searchable, cross-referenceable, and AI-r
34
34
 
35
35
  ## Quick Start
36
36
 
37
- ### Installation
37
+ ### Use Remotely (No Install Needed)
38
38
 
39
- **Option 1: Claude Desktop (Recommended)**
39
+ > Connect directly to the hosted version — zero dependencies, nothing to install.
40
40
 
41
- Add to your `claude_desktop_config.json`:
41
+ **Endpoint:** `https://eu-regulations-mcp.vercel.app/mcp`
42
42
 
43
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
44
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
43
+ | Client | How to Connect |
44
+ |--------|---------------|
45
+ | **Claude.ai** | Settings > Connectors > Add Integration > paste URL |
46
+ | **Claude Code** | `claude mcp add eu-regulations --transport http https://eu-regulations-mcp.vercel.app/mcp` |
47
+ | **Claude Desktop** | Add to config (see below) |
48
+ | **GitHub Copilot** | Add to VS Code settings (see below) |
49
+
50
+ **Claude Desktop** — add to `claude_desktop_config.json`:
45
51
 
46
52
  ```json
47
53
  {
48
54
  "mcpServers": {
49
55
  "eu-regulations": {
50
- "command": "npx",
51
- "args": ["-y", "@ansvar/eu-regulations-mcp"]
56
+ "type": "url",
57
+ "url": "https://eu-regulations-mcp.vercel.app/mcp"
52
58
  }
53
59
  }
54
60
  }
55
61
  ```
56
62
 
57
- Restart Claude Desktop. Done!
63
+ **GitHub Copilot** — add to VS Code `settings.json`:
58
64
 
59
- **Option 2: MCP Registry**
65
+ ```json
66
+ {
67
+ "github.copilot.chat.mcp.servers": {
68
+ "eu-regulations": {
69
+ "type": "http",
70
+ "url": "https://eu-regulations-mcp.vercel.app/mcp"
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ ### Use Locally (npm)
77
+
78
+ ```bash
79
+ npx @ansvar/eu-regulations-mcp
80
+ ```
60
81
 
61
- Browse and install from the [official MCP registry](https://registry.modelcontextprotocol.io/):
62
- - Search for "EU Regulations" or view directly: [`io.github.Ansvar-Systems/eu-regulations-mcp`](https://registry.modelcontextprotocol.io/io.github.Ansvar-Systems/eu-regulations-mcp)
63
- - One-click install (when registry integration is live in Claude Desktop)
64
- - Automatic updates when new versions are released
82
+ **Claude Desktop** add to `claude_desktop_config.json`:
65
83
 
66
- **Option 3: Cursor / VS Code**
84
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
85
+ **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
67
86
 
68
87
  ```json
69
88
  {
70
- "mcp.servers": {
89
+ "mcpServers": {
71
90
  "eu-regulations": {
72
91
  "command": "npx",
73
92
  "args": ["-y", "@ansvar/eu-regulations-mcp"]
@@ -76,16 +95,19 @@ Browse and install from the [official MCP registry](https://registry.modelcontex
76
95
  }
77
96
  ```
78
97
 
79
- **Option 4: Global npm Install**
98
+ **Cursor / VS Code:**
80
99
 
81
- ```bash
82
- npm install -g @ansvar/eu-regulations-mcp
100
+ ```json
101
+ {
102
+ "mcp.servers": {
103
+ "eu-regulations": {
104
+ "command": "npx",
105
+ "args": ["-y", "@ansvar/eu-regulations-mcp"]
106
+ }
107
+ }
108
+ }
83
109
  ```
84
110
 
85
- Then use `"command": "eu-regulations-mcp"` in your config (without npx).
86
-
87
- ---
88
-
89
111
  ## Example Queries
90
112
 
91
113
  Once connected, just ask naturally:
@@ -106,12 +128,12 @@ Once connected, just ask naturally:
106
128
 
107
129
  ## What's Included
108
130
 
109
- - **47 Regulations** — GDPR, DORA, NIS2, AI Act, MiCA, eIDAS 2.0, Medical Device Regulation, and 30 more
110
- - **2,438 Articles** + 3,789 Recitals + 1,138 Official Definitions
131
+ - **49 Regulations** — GDPR, DORA, NIS2, AI Act, Chips Act, MiCA, eIDAS 2.0, Medical Device Regulation, and 40 more
132
+ - **2,528 Articles** + 3,869 Recitals + 1,226 Official Definitions
111
133
  - **Full-Text Search** — Find relevant articles across all regulations instantly
112
- - **Control Mappings** — 685 mappings to ISO 27001:2022 & NIST CSF 2.0
113
- - **Evidence Requirements** — 407 audit artifacts across all 47 regulations
114
- - **Sector Rules** — Check which regulations apply to your industry
134
+ - **Control Mappings** — 709 mappings to ISO 27001:2022 & NIST CSF 2.0
135
+ - **Evidence Requirements** — 407 audit artifacts across all 49 regulations
136
+ - **Sector Rules** — 323 applicability rules across all sectors and industries
115
137
  - **Daily Updates** — Automatic freshness checks against EUR-Lex
116
138
 
117
139
  **Detailed coverage:** [docs/coverage.md](docs/coverage.md)
@@ -160,6 +182,31 @@ EUR-Lex HTML → Parse → SQLite → FTS5 snippet() → MCP response
160
182
 
161
183
  ---
162
184
 
185
+ ## 📚 Documentation
186
+
187
+ - **[Database SSL/TLS Configuration](docs/DATABASE_SSL.md)** - Secure PostgreSQL connections for Cloudflare Workers deployments
188
+ - **[Security Policy](SECURITY.md)** - Vulnerability reporting and security best practices
189
+ - **[Coverage Gaps](docs/COVERAGE_GAPS.md)** - Known missing content from EUR-Lex
190
+ - **[GitHub Actions Setup](docs/GITHUB_ACTIONS_SETUP.md)** - CI/CD workflow configuration
191
+ - **[Privacy Policy](PRIVACY.md)** - Data handling and retention notes
192
+
193
+ ---
194
+
195
+ ## Directory Review Notes
196
+
197
+ ### Testing Account and Sample Data
198
+
199
+ This server is read-only and does not require a login account for functional review.
200
+ For directory review, use the bundled dataset and these sample prompts:
201
+ - *"What does NIS2 Article 21 require?"*
202
+ - *"Compare DORA and NIS2 incident reporting obligations."*
203
+ - *"Map ISO 27001 controls to DORA requirements."*
204
+
205
+ ### Remote Authentication (OAuth 2.0)
206
+
207
+ The default server runtime is read-only and can be deployed without authentication.
208
+ If you deploy a remote authenticated endpoint, use OAuth 2.0 over TLS with certificates from recognized authorities.
209
+
163
210
  ## ⚠️ Important Disclaimers
164
211
 
165
212
  ### Legal Advice
Binary file
@@ -0,0 +1,67 @@
1
+ [
2
+ {
3
+ "regulation": "CHIPS_ACT",
4
+ "sector": "manufacturing",
5
+ "subsector": "semiconductor",
6
+ "applies": true,
7
+ "confidence": "definite",
8
+ "basis_article": "3",
9
+ "notes": "Semiconductor design, manufacturing, packaging, and testing facilities are primary targets; eligible for Chips for Europe Initiative support"
10
+ },
11
+ {
12
+ "regulation": "CHIPS_ACT",
13
+ "sector": "manufacturing",
14
+ "subsector": "electronics",
15
+ "applies": true,
16
+ "confidence": "definite",
17
+ "basis_article": "13",
18
+ "notes": "Electronics manufacturers using semiconductors are part of supply chain; may benefit from Integrated Production Facilities and Open EU Foundries"
19
+ },
20
+ {
21
+ "regulation": "CHIPS_ACT",
22
+ "sector": "transport",
23
+ "subsector": "automotive",
24
+ "applies": true,
25
+ "confidence": "likely",
26
+ "basis_article": "22",
27
+ "notes": "Automotive sector heavily dependent on semiconductor supply; subject to crisis monitoring and alert mechanisms for supply disruptions"
28
+ },
29
+ {
30
+ "regulation": "CHIPS_ACT",
31
+ "sector": "digital_infrastructure",
32
+ "applies": true,
33
+ "confidence": "likely",
34
+ "basis_article": "3",
35
+ "notes": "Data centers, telecom infrastructure, and cloud providers are key consumers; may participate in European chips infrastructure initiatives"
36
+ },
37
+ {
38
+ "regulation": "CHIPS_ACT",
39
+ "sector": "energy",
40
+ "applies": true,
41
+ "confidence": "likely",
42
+ "basis_article": "22",
43
+ "notes": "Smart grid and renewable energy systems depend on semiconductors; subject to supply chain monitoring"
44
+ },
45
+ {
46
+ "regulation": "CHIPS_ACT",
47
+ "sector": "healthcare",
48
+ "applies": true,
49
+ "confidence": "possible",
50
+ "basis_article": "22",
51
+ "notes": "Medical devices use semiconductors; subject to crisis response mechanisms during shortages"
52
+ },
53
+ {
54
+ "regulation": "CHIPS_ACT",
55
+ "sector": "financial",
56
+ "applies": false,
57
+ "confidence": "definite",
58
+ "notes": "Financial services are semiconductor users, not producers; not subject to Chips Act requirements"
59
+ },
60
+ {
61
+ "regulation": "CHIPS_ACT",
62
+ "sector": "public_administration",
63
+ "applies": false,
64
+ "confidence": "definite",
65
+ "notes": "Public sector is a semiconductor consumer; may participate in governance (European Semiconductor Board) but not subject to production requirements"
66
+ }
67
+ ]
@@ -0,0 +1,85 @@
1
+ [
2
+ {
3
+ "regulation": "CRMA",
4
+ "sector": "manufacturing",
5
+ "subsector": "mining",
6
+ "applies": true,
7
+ "confidence": "definite",
8
+ "basis_article": "4",
9
+ "notes": "Mining and extraction of strategic raw materials (lithium, cobalt, rare earths, etc.) subject to permitting, monitoring, and supply chain due diligence"
10
+ },
11
+ {
12
+ "regulation": "CRMA",
13
+ "sector": "manufacturing",
14
+ "subsector": "battery",
15
+ "applies": true,
16
+ "confidence": "definite",
17
+ "basis_article": "5",
18
+ "notes": "Battery manufacturers using critical raw materials must comply with supply chain transparency and strategic stockpiling provisions"
19
+ },
20
+ {
21
+ "regulation": "CRMA",
22
+ "sector": "manufacturing",
23
+ "subsector": "semiconductor",
24
+ "applies": true,
25
+ "confidence": "definite",
26
+ "basis_article": "4",
27
+ "notes": "Semiconductor production uses critical raw materials (silicon, gallium, germanium); subject to supply chain monitoring and risk assessment"
28
+ },
29
+ {
30
+ "regulation": "CRMA",
31
+ "sector": "transport",
32
+ "subsector": "automotive",
33
+ "applies": true,
34
+ "confidence": "likely",
35
+ "basis_article": "5",
36
+ "notes": "EV manufacturers and automotive supply chains using batteries/magnets containing critical raw materials subject to due diligence requirements"
37
+ },
38
+ {
39
+ "regulation": "CRMA",
40
+ "sector": "energy",
41
+ "subsector": "renewable",
42
+ "applies": true,
43
+ "confidence": "definite",
44
+ "basis_article": "4",
45
+ "notes": "Wind turbines (permanent magnets), solar panels (silicon), and energy storage systems use critical raw materials; subject to supply chain rules"
46
+ },
47
+ {
48
+ "regulation": "CRMA",
49
+ "sector": "manufacturing",
50
+ "subsector": "electronics",
51
+ "applies": true,
52
+ "confidence": "likely",
53
+ "basis_article": "5",
54
+ "notes": "Electronics manufacturers using critical raw materials in components must ensure supply chain transparency"
55
+ },
56
+ {
57
+ "regulation": "CRMA",
58
+ "sector": "digital_infrastructure",
59
+ "applies": true,
60
+ "confidence": "possible",
61
+ "basis_article": "5",
62
+ "notes": "Data center operators using servers/storage with critical raw materials may be subject to supply chain monitoring during crises"
63
+ },
64
+ {
65
+ "regulation": "CRMA",
66
+ "sector": "financial",
67
+ "applies": false,
68
+ "confidence": "definite",
69
+ "notes": "Financial services do not directly extract or process critical raw materials; not subject to CRMA requirements"
70
+ },
71
+ {
72
+ "regulation": "CRMA",
73
+ "sector": "healthcare",
74
+ "applies": false,
75
+ "confidence": "likely",
76
+ "notes": "Healthcare sector uses medical devices containing critical materials but is typically end-user, not producer; indirect exposure only"
77
+ },
78
+ {
79
+ "regulation": "CRMA",
80
+ "sector": "public_administration",
81
+ "applies": false,
82
+ "confidence": "definite",
83
+ "notes": "Public sector participates in governance and strategic stockpiling but is not subject to production/supply chain requirements"
84
+ }
85
+ ]