Skip to main content
Glama
EroNiiChan

EU Compliance & Factur-X MCP Server

by EroNiiChan

๐Ÿ‡ช๐Ÿ‡บ EU Compliance & Factur-X MCP Server

License Python MCP Zero-Dependency EU AI Act EN 16931 Sponsors

Zero-dependency Model Context Protocol (MCP) server empowering AI coding environments (Claude Desktop, Cursor, Antigravity, Cline, Windsurf) to audit AI systems against the EU AI Act, generate EN 16931 / Factur-X electronic invoices, and assess GDPR & NIS2 readiness directly from your IDE prompt.


โšก Why This Matters in 2025โ€“2027

European regulation is fundamentally changing software development and B2B commerce:

  1. EU AI Act (Regulation (EU) 2024/1689):

    • Prohibited AI systems face immediate market bans and fines up to โ‚ฌ35,000,000 or 7% of worldwide annual turnover.

    • High-risk systems (HR, credit, education, biometrics, critical infrastructure) require continuous risk management, data bias testing, technical documentation, human oversight, and CE marking.

  2. Mandatory B2B Electronic Invoicing (EN 16931 & Factur-X):

    • France, Germany (e-Rechnung), Poland, and EU member states are making structured electronic invoices mandatory for B2B transactions. Traditional PDFs are no longer compliant.

  3. NIS2 Directive & GDPR:

    • Stringent 24h early warning incident reporting and โ‚ฌ10M+ penalties for supply chain security oversights.

With mcp-eu-compliance, your LLM agent acts as an in-IDE European regulatory officer and electronic invoicing engine.


Related MCP server: ai-act-mcp

๐Ÿ“ฆ Features

  • Zero External Dependencies: Pure Python standard library (sys, json, xml.etree.ElementTree, datetime). Runs on any machine with Python 3.9+ without pip install headaches.

  • EU AI Act Risk Auditor (audit_eu_ai_act):

    • Classifies AI systems: Unacceptable / Prohibited (Art 5), High Risk (Annex III & Annex I), GPAI Systemic Risk (FLOPs โ‰ฅ 10ยฒโต), Transparency (Art 50), or Minimal Risk.

    • Generates Article 9โ€“15 mandatory checklists, enforcement deadlines, and maximum penalty exposure.

  • Factur-X / EN 16931 Generator (generate_facturx_invoice):

    • Emits compliant UN/CEFACT CII (CrossIndustryInvoice) XML.

    • Supports MINIMUM, BASIC, and EN16931 (Comfort) profiles with line items, multi-rate VAT breakdown, and SEPA payment details.

  • Factur-X XML Validator (validate_facturx_xml):

    • Validates XML structure, namespaces, profile identifiers, and verifies arithmetic summation across line net totals, VAT bases, and gross payable amounts.

  • GDPR & NIS2 Readiness Evaluator (check_gdpr_nis2_readiness):

    • Scans organizational size and sector to detect Essential vs Important Entity status under NIS2, missing incident response plans, and GDPR DPO triggers.

  • Enterprise Pro Licensing (get_compliance_status_and_pro_license):

    • Seamless in-IDE verification of Pro licenses for Peppol routing and automated hybrid PDF/A-3 compilation.


๐Ÿš€ Quick Setup

1. Claude Desktop

Add to your claude_desktop_config.json:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "eu-compliance": {
      "command": "python",
      "args": [
        "C:\\Users\\Ender\\Documents\\Money\\swarm\\agent18_mcp_server\\mcp_eu_compliance.py"
      ]
    }
  }
}

2. Cursor IDE

In Cursor Settings โ†’ Features โ†’ MCP:

  • Name: eu-compliance

  • Type: command

  • Command: python c:\path\to\mcp_eu_compliance.py

3. Google Antigravity / AGY

In your agy MCP configuration or agent configuration:

{
  "mcpServers": {
    "eu_compliance": {
      "command": "python",
      "args": ["c:/path/to/mcp_eu_compliance.py"]
    }
  }
}

๐Ÿ› ๏ธ Tool Specifications & Prompts

1. audit_eu_ai_act

Example Prompt in IDE:

"Audit our new automated candidate resume screening and interview scoring tool under the EU AI Act."

Arguments:

  • system_name (str): System name.

  • description (str): Architecture and functionality summary.

  • intended_purpose (str): Use case (e.g. CV screening, credit evaluation, bot).

  • sector (str, optional): Industry sector (e.g. employment, finance, healthcare).

  • biometrics_used (bool, optional): Uses biometric data or facial processing.

  • affects_fundamental_rights (bool, optional): Potential rights impact.

  • is_gpai (bool, optional): Is it a general-purpose AI / foundation model.

  • training_flops (float, optional): Total compute FLOPs (โ‰ฅ 1e25 designates systemic risk).

Output Preview:

{
  "classification": "HIGH_RISK",
  "risk_level": "HIGH RISK (Annex III / Annex I)",
  "matched_high_risk_domains": [
    {
      "domain": "employment",
      "annex": "Annex III (4)",
      "title": "Employment, Workers Management & Access to Self-Employment"
    }
  ],
  "mandatory_requirements": [
    {"code": "ART_9_RMS", "title": "Risk Management System"},
    {"code": "ART_10_DATA_GOV", "title": "Data Governance & Bias Mitigation"},
    {"code": "ART_11_TECH_DOC", "title": "Technical Documentation & Annex IV"},
    {"code": "ART_14_HUMAN_OVERSIGHT", "title": "Human Oversight (HITL / HOTL)"},
    {"code": "ART_48_CE_MARK", "title": "CE Marking of Conformity"},
    {"code": "ART_71_EU_DATABASE", "title": "EU Database Registration"}
  ],
  "penalties": {
    "High-Risk Non-Compliance (Arts 9-15)": "Up to โ‚ฌ15,000,000 or 3% of total worldwide annual turnover."
  }
}

2. generate_facturx_invoice

Example Prompt in IDE:

"Generate a Factur-X EN 16931 invoice for 500 EUR consulting services with 20% French VAT."

Arguments:

  • invoice_number (str): e.g. "INV-2026-001"

  • issue_date (str): "YYYY-MM-DD"

  • seller (object): name, country_code, vat_id, siret, iban, bic, address.

  • buyer (object): name, country_code, vat_id, siret, address.

  • items (array): name, quantity, unit_price, vat_rate.

  • currency (str, default 'EUR')

  • profile (str, default 'EN16931'): MINIMUM, BASIC, EN16931, EXTENDED.

Output: Returns pure UN/CEFACT CII XML ready to be saved as factur-x.xml or embedded into PDF/A-3.


3. validate_facturx_xml

Example Prompt in IDE:

"Verify if this Factur-X XML complies with the EN 16931 standard."

Arguments:

  • xml_content (str): XML string to validate.

Output:

{
  "is_valid": true,
  "errors": [],
  "warnings": [],
  "details": {
    "invoice_number": "INV-2026-001",
    "profile_name": "EN16931",
    "profile_urn": "urn:cen.eu:en16931:2017",
    "grand_total_amount": 600.0,
    "seller_name": "Hexagon Software SAS",
    "buyer_name": "Acme Consulting GmbH"
  },
  "standards_compliance": "EN 16931-1:2017 & UN/CEFACT CII D16B"
}

๐Ÿ’Ž Community vs. Pro Enterprise Tier

Feature

Community Edition (Free)

Pro Enterprise Tier

EU AI Act Risk Classification & Checklist

โœ… Full Art 5โ€“15

โœ… Full Art 5โ€“15

Factur-X / EN 16931 XML Generation

โœ… All Profiles

โœ… All Profiles

Monetary & XML Schema Validation

โœ… Included

โœ… Included

GDPR & NIS2 Rapid Auditor

โœ… Included

โœ… Included

Zero-Dependency Local StdIO Execution

โœ… Yes

โœ… Yes

Automated PDF/A-3 Hybrid Compilation

Manual

โšก Automated (X.509 Signed)

Direct Peppol AS4 & Chorus Pro Routing

โ€”

โšก Automated API Dispatch

CI/CD Continuous AI Act RegWatch Scanner

โ€”

โšก Automated PR Checks

Signed EU Conformity Assessment Dossier

โ€”

โšก Automated PDF Export

Upgrading to Pro:

  • Price: $49/month or $299 lifetime license.

  • Sponsor / Purchase: GitHub Sponsors @EroNiiChan or Polar.sh.

  • Enter key via IDE: Call get_compliance_status_and_pro_license(pro_license_key="EUPRO-XXXX-XXXX-XXXX").


๐Ÿงช Testing

Run the included automated test suite (10/10 tests covering AI Act classifications, XML arithmetic, schema validation, and JSON-RPC 2.0 stdio pipes):

python test_mcp_server.py

Expected output:

..........
----------------------------------------------------------------------
Ran 10 tests in 0.093s

OK

๐Ÿ“œ Regulatory Reference


๐Ÿค Contributing & Support

Issues, PRs, and suggestions are welcome!

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    MCP server for EU AI Act compliance classification with multi-jurisdiction overlay across 8 frameworks (NIST AI RMF, ISO 42001, GDPR, HIPAA, Colorado SB 24-205). Provides deterministic risk classifier (quick_risk_class) and Claude-powered Annex III deep classifier (classify_annex3) with remediation actions.
    2
    5 npm
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables EU AI Act compliance assessment by classifying AI systems, listing obligations, computing deadlines, and scanning repos for required documentation, all running locally.
    4
    2
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI assistants to locally parse, validate, audit, explain, generate, and convert XRechnung and ZUGFeRD/Factur-X e-invoices using official rule sets, fully offline with no API keys required.
    Apache 2.0