EU AI Act Risk Assessor
# ๐ช๐บ EU AI Act Risk Assessor
> MCP server that classifies AI use cases under **Regulation (EU) 2024/1689** with deterministic precision. Built with [Vurb.ts](https://github.com/vinkius-labs/vurb.ts).
[](https://www.typescriptlang.org/)
[](https://github.com/vinkius-labs/vurb.ts)
[](LICENSE)
## Why This Exists
Every AI company in the EU needs to know: **is my AI system legal?**
The EU AI Act defines four risk tiers โ from **Unacceptable** (banned) to **Minimal** (no obligations). Misclassification means fines up to **โฌ35 million or 7% of global revenue**.
This MCP server gives any LLM client deterministic, auditable risk classification โ zero hallucination on compliance.
## Architecture
```
User describes AI use case (natural language)
โ
LLM translates โ structured input (Zod-enforced enums/booleans)
โ
MCP applies legal matrix โ deterministic verdict
โ
Presenter formats โ rules, UI, suggested actions
โ
LLM presents result to user
```
**LLM = Semantic Translator** ยท **MCP = Implacable Judge**
The LLM handles what it does best (understanding language). The MCP handles what code does best (applying legal logic without drift).
## Tools
| Tool | Description |
|---|---|
| `risk.assess` | Classify an AI use case across all four risk tiers |
| `fines.calculate` | Calculate maximum fine exposure under Art. 99 |
| `exemptions.check` | Interactive exemption auditor (guided decision tree) |
| `compliance.obligations` | List all applicable obligations by risk level |
| `compliance.timeline` | Enforcement deadlines and milestones |
| `compliance.generate_report` | Generate Annex IV technical documentation template |
### risk.assess
The main classification tool. The LLM maps the user's natural language description to structured fields:
```
Input: "Our AI screens job applications and ranks candidates"
โ LLM translates:
inferred_domain: "employment"
involves_profiling: true
makes_autonomous_decisions: true
โ MCP evaluates:
โ Art. 5(1)(f) match? No (no biometric data)
โ Annex III ยง4 match? Yes (employment + profiling)
โ
Output: HIGH RISK | Art. 6 + Annex III ยง4 | 7 obligations
```
### exemptions.check
Transforms the LLM into a guided compliance interviewer:
```
Call 1: exemptions.check(risk_level: "high", {})
โ "Is this system purely procedural (no discretion)?"
Call 2: exemptions.check(risk_level: "high", { purely_procedural: false })
โ "Does it merely improve a prior human activity?"
Call 3: exemptions.check(risk_level: "high", { ..., improves_prior_activity: true })
โ EXEMPT under Art. 6(3)(b)
```
### fines.calculate
Exact Art. 99 formula:
```
Prohibited practice: max(โฌ35M, 7% of global revenue)
High-risk noncompliance: max(โฌ15M, 3% of global revenue)
Incorrect information: max(โฌ7.5M, 1% of global revenue)
```
### compliance.generate_report
Generates a complete **Annex IV technical documentation template** in Markdown โ all 9 legally required sections with subsections. V8-safe (returns content as string, no filesystem access).
## Legal Coverage
| Regulation Area | Articles | Implementation |
|---|---|---|
| Prohibited Practices | Art. 5(1)(a)โ(h) | 8 rules with deterministic condition functions |
| High-Risk Classification | Art. 6, Annex III | 8 domains, 15+ rules |
| Limited Risk | Art. 50 | Transparency obligations |
| Fines | Art. 99(3)โ(5) | Exact formulas with SME proportionality |
| Exemptions | Art. 6(3), Art. 2 | 6-node interactive decision tree |
| Technical Documentation | Art. 11, Annex IV | 9-section template generator |
| Enforcement Timeline | Arts. 111, 113 | Milestones with live status |
## Usage Examples
### ๐ซ Example 1 โ Detecting a Prohibited Practice
> **User:** "We're building an AI that analyses employee webcam footage to detect if they're stressed, bored, or engaged during meetings."
The LLM translates this into structured input and calls `risk.assess`:
```json
{
"intention_summary": "Real-time emotion recognition system analysing employee webcam footage during meetings",
"inferred_domain": "employment",
"processes_biometric_data": true,
"involves_profiling": true,
"makes_autonomous_decisions": false
}
```
**Result:** ๐ซ **UNACCEPTABLE** โ Art. 5(1)(f) prohibits emotion recognition in the workplace. This AI practice is **illegal since 2 February 2025**.
The Presenter automatically suggests `fines.calculate` and `exemptions.check` as next actions.
---
### โ ๏ธ Example 2 โ High-Risk Classification (Employment)
> **User:** "Our startup uses AI to screen CVs and shortlist the top 20% of candidates for interview."
```json
{
"intention_summary": "AI system that screens and ranks job applicants based on CV analysis",
"inferred_domain": "employment",
"processes_biometric_data": false,
"involves_profiling": true,
"makes_autonomous_decisions": true
}
```
**Result:** โ ๏ธ **HIGH RISK** โ Annex III ยง4(a): AI systems used for recruitment and selection. Confidence: **definitive**. 7 compliance obligations apply.
The Presenter renders a Mermaid decision-flow diagram and suggests:
- `compliance.obligations` โ review all required obligations
- `fines.calculate` โ calculate maximum fine exposure
- `compliance.generate_report` โ generate Annex IV documentation
---
### โ ๏ธ Example 3 โ High-Risk Classification (Education)
> **User:** "We want to build an AI that grades university exams automatically and decides who passes."
```json
{
"intention_summary": "Automated exam grading system with pass/fail decision authority",
"inferred_domain": "education",
"processes_biometric_data": false,
"involves_profiling": true,
"makes_autonomous_decisions": true
}
```
**Result:** โ ๏ธ **HIGH RISK** โ Annex III ยง3(a): AI systems determining access to or outcomes in educational institutions.
---
### โน๏ธ Example 4 โ Limited Risk (Chatbot)
> **User:** "We have a customer support chatbot that answers questions about our products."
```json
{
"intention_summary": "Customer-facing chatbot for product FAQ and support queries",
"inferred_domain": "none",
"processes_biometric_data": false,
"involves_profiling": false,
"makes_autonomous_decisions": false
}
```
**Result:** โน๏ธ **LIMITED RISK** โ Art. 50: The system must clearly disclose to users that they are interacting with an AI. No further compliance obligations beyond transparency.
---
### โ
Example 5 โ Minimal Risk
> **User:** "We use AI to recommend songs to users based on their listening history."
```json
{
"intention_summary": "Music recommendation engine based on listening patterns",
"inferred_domain": "none",
"processes_biometric_data": false,
"involves_profiling": false,
"makes_autonomous_decisions": false
}
```
**Result:** โ
**MINIMAL RISK** โ No specific obligations under the EU AI Act. Voluntary codes of conduct apply.
---
### ๐ฐ Example 6 โ Fine Calculation
> **User:** "We're a company with โฌ500M annual revenue. What's the worst-case fine if our prohibited AI system is caught?"
The LLM calls `fines.calculate`:
```json
{
"violation_type": "prohibited_practice",
"global_annual_revenue_eur": 500000000,
"is_sme": false
}
```
**Result:**
| | Value |
|---|---|
| Fixed threshold | โฌ35,000,000 |
| Revenue-based (7%) | โฌ35,000,000 |
| **Applicable fine** | **โฌ35,000,000** |
| Article | Article 99(3) |
> If annual revenue were โฌ1B, the revenue-based fine (โฌ70M) would exceed the fixed threshold.
---
### ๐ Example 7 โ Interactive Exemption Audit
> **User:** "Our AI was classified as high-risk, but it just automates a simple checklist โ no real decisions."
The LLM initiates an interactive exemption audit via `exemptions.check`:
**Round 1:**
```json
{ "risk_level": "high", "answers": {} }
โ "Is this AI system purely procedural, performing a narrow task with no discretionary judgement?"
```
**User:** "Yes, it just checks if all documents are present in a submission."
**Round 2:**
```json
{ "risk_level": "high", "answers": { "purely_procedural": true } }
โ โ
EXEMPT under Art. 6(3)(a) โ The system performs a purely procedural task.
```
The Presenter rules change dynamically: instead of "ask the next question", it now shows the exemption details and advises legal verification.
---
### ๐ Example 8 โ Full Compliance Workflow
A realistic end-to-end scenario:
**Step 1** โ User describes their system:
> "We're building an AI for a city council that analyses CCTV footage to predict where crimes are likely to occur."
**Step 2** โ `risk.assess` classifies:
```
๐ซ UNACCEPTABLE โ Art. 5(1)(d): Predictive policing based on profiling.
Domain: law_enforcement | Biometric: false | Profiling: true | Autonomous: true
```
**Step 3** โ User asks about exemptions:
> "But what if it's for national security?"
**Step 4** โ `exemptions.check` evaluates:
```
โ "Is this system exclusively for military or national security purposes?"
User: "No, it's municipal police."
โ NOT EXEMPT โ Art. 2(3) applies only to military/national security, not municipal law enforcement.
```
**Step 5** โ User asks about fines:
> "What's the maximum fine for the city council?"
**Step 6** โ `fines.calculate`:
```
๐ฐ Prohibited practice: max(โฌ35M, 7% of global revenue)
Public authorities typically face the fixed threshold: โฌ35,000,000
```
**Step 7** โ User asks about the timeline:
> "When does this become enforceable?"
**Step 8** โ `compliance.timeline`:
```
๐
Prohibited practices (Art. 5): ENFORCED since 2 February 2025
โ ๏ธ This system is already illegal.
```
---
### ๐ Example 9 โ Generating Technical Documentation
> **User:** "Generate the Annex IV documentation template for our employment screening AI."
The LLM calls `compliance.generate_report`:
```json
{
"system_name": "TalentScreen AI",
"system_description": "AI-powered CV screening and candidate ranking system",
"intended_purpose": "Automated shortlisting of job applicants for interview",
"domain": "employment",
"provider_name": "Acme Corp"
}
```
**Result:** A complete Markdown document with all 9 Annex IV sections:
```markdown
# Technical Documentation โ TalentScreen AI
> Regulation (EU) 2024/1689 โ Article 11, Annex IV
## 1. General Description of the AI System
## 2. Detailed Description of Elements and Development Process
## 3. Monitoring, Functioning and Control
## 4. Risk Management System
## 5. Data and Data Governance
## 6. Human Oversight Measures
## 7. Accuracy, Robustness and Cybersecurity
## 8. Transparency and Provision of Information
## 9. Post-Market Monitoring
```
Each section includes subsections with `[To be completed by the provider]` placeholders.
## Deploy
### Vinkius Cloud โ One Command โก
The fastest path to production. [`vurb deploy`](https://vurb.vinkius.com/quickstart) publishes your server to [Vinkius Cloud](https://vinkius.com)'s global edge โ zero infrastructure, built-in DLP, kill switch, audit logging, and a managed MCP token:
```bash
npm install
vurb deploy
```
That's it. No Dockerfile, no CI/CD pipeline, no servers to manage. You get a connection token that works with **any MCP client** โ Cursor, Claude Desktop, Claude Code, Windsurf, Cline, VS Code + Copilot.
```bash
# Deploy with a custom name
vurb deploy --name eu-ai-act
# Deploy to a specific environment
vurb deploy --env production
```
> **๐ก Tip:** Install the [Vinkius extension](https://marketplace.visualstudio.com/items?itemName=vinkius.cloud-extension) to manage your deployed server directly from VS Code, Cursor, or Windsurf โ live connections, requests, P95 latency, DLP intercepts, token management, tool toggling, logs, and deployment history.
### Connect Your MCP Client
After deploying, share the managed token with any MCP-compatible client:
#### Claude Desktop / Cursor / Windsurf
```json
{
"mcpServers": {
"eu-ai-act": {
"url": "https://edge.vinkius.com/your-token/mcp"
}
}
}
```
### Self-Hosted Alternatives
The same `ToolRegistry` runs anywhere โ no code changes required:
| Platform | Adapter |
|---|---|
| Vercel Edge Functions | `@vurb/vercel` |
| Cloudflare Workers | `@vurb/cloudflare` |
| Any Node.js server | Stdio / HTTP+SSE transport |
```typescript
// Vercel โ one line
import { vercelAdapter } from '@vurb/vercel';
export const POST = vercelAdapter({ registry, contextFactory });
```
```typescript
// Cloudflare Workers โ one line
import { cloudflareWorkersAdapter } from '@vurb/cloudflare';
export default cloudflareWorkersAdapter({ registry, contextFactory });
```
Full deployment guides: [Production Server](https://vurb.vinkius.com/cookbook/production-server) ยท [Vercel Adapter](https://vurb.vinkius.com/vercel-adapter) ยท [Cloudflare Adapter](https://vurb.vinkius.com/cloudflare-adapter)
### Running Locally via stdio
If you prefer to run the server locally and connect via **stdio** โ the native MCP transport used by Claude Desktop, Cursor, and Windsurf:
```bash
# 1. Install dependencies
npm install
# 2. Build
npm run build
# 3. Test it directly (optional)
node dist/server.js
```
Then add it to your MCP client config (e.g. `claude_desktop_config.json`):
```json
{
"mcpServers": {
"eu-ai-act": {
"command": "node",
"args": ["/absolute/path/to/eu-ai-act/dist/server.js"]
}
}
}
```
Or run without cloning via `npx` (after the package is published):
```json
{
"mcpServers": {
"eu-ai-act": {
"command": "npx",
"args": ["-y", "@mcp-originals/eu-ai-act"]
}
}
}
```
> **Note:** The stdio transport is the default. No environment variables are required โ the server runs fully offline with all legal data hardcoded.
## Development
```bash
# Install dependencies
npm install
# Development server with HMR
vurb dev
# Type-check
npm run typecheck
# Run tests
npm test
```
### Project Structure
```
src/
โโโ data/ โ Legal knowledge base (hardcoded for determinism)
โ โโโ types.ts
โ โโโ prohibited-practices.ts Art. 5
โ โโโ annex-iii-matrix.ts Annex III
โ โโโ limited-risk.ts Art. 50
โ โโโ obligations.ts Art. 9-15, 72
โ โโโ timeline.ts Enforcement dates
โ โโโ exemptions.ts Art. 6(3), Art. 2
โ โโโ fines.ts Art. 99
โ โโโ annex-iv-template.ts Documentation TOC
โโโ engine/
โ โโโ risk-engine.ts Pure deterministic logic
โโโ models/ M โ defineModel()
โ โโโ index.ts
โโโ views/ V โ definePresenter()
โ โโโ index.ts
โโโ agents/ A โ Tool definitions
โ โโโ risk/
โ โ โโโ assess.tool.ts
โ โโโ fines/
โ โ โโโ calculate.tool.ts
โ โโโ exemptions/
โ โ โโโ check.tool.ts
โ โโโ compliance/
โ โโโ obligations.tool.ts
โ โโโ timeline.tool.ts
โ โโโ generate-report.tool.ts
โโโ vurb.ts Shared Vurb instance
โโโ server.ts Bootstrap
```
## Built with Vurb.ts
This server showcases the full [Vurb.ts](https://github.com/vinkius-labs/vurb.ts) MVA (Model-View-Agent) pattern:
| Feature | Usage |
|---|---|
| `defineModel()` | 6 domain models with guidance labels as auto-rules |
| `definePresenter()` | Schema validation, JIT rules, Mermaid diagrams, collection UI, suggested actions |
| Semantic Verbs | `f.query()` (readOnly), `f.action()` (neutral) |
| `f.error()` | Self-healing errors with suggestions |
| `.cached()` | Static reference data (obligations, timeline) |
| `.instructions()` | AI-first prompt engineering in the framework |
| `agentLimit` | Cognitive guardrails with truncation guidance |
| `autoDiscover()` | File-based tool routing |
[Get started with Vurb.ts โ](https://github.com/vinkius-labs/vurb.ts) ยท [Documentation โ](https://vurb.vinkius.com)
## License
Apache 2.0 โ See [LICENSE](LICENSE) for details.
TDQS
Scored across 6 tools
Each tool targets a distinct step in the assessment workflow: classification (risk_assess), obligations, timeline, documentation generation, exemptions, and fines. The only mild overlap is between risk_assess and exemptions_check, since both touch on whether a system is high-risk, but the descriptions clarify that exemptions_check handles Article 6(3)/Article 2 carve-outs specifically.
Names are grouped by a domain prefix (risk_, compliance_, exemptions_, fines_) which aids readability, but the verb placement is mixed: risk_assess and exemptions_check put the verb last, compliance_obligations/compliance_timeline have no verb at all, and compliance_generate_report is a three-part outlier. The pattern is understandable but not the predictable verb_noun convention.
Six tools is tightly scoped to a single advisory workflow and each one covers a distinct stage (assess, obligations, timeline, report, exemptions, fines). There is no redundant or filler tool.
The surface covers the core lifecycle: risk classification, obligations, deadlines, Annex IV documentation, exemptions, and penalties. However, there is no explicit coverage of Article 5 prohibited practices screening, Article 50 transparency obligations, or conformity assessment/CE marking, which are notable gaps for a full EU AI Act assessor.