Skip to main content
Glama
io.github.KevinRabun/GDPRShiftLeftMCP

io.github.KevinRabun/GDPRShiftLeftMCP

by KevinRabun

GDPR Shift-Left MCP Server

Tests & Judges PyPI version Python versions License: MIT

A Model Context Protocol (MCP) server that brings GDPR compliance knowledge directly into your IDE, enabling developers and compliance teams to "shift left" — identifying and addressing data protection requirements early in the development lifecycle.

āš ļø Disclaimer: This tool provides informational guidance only and does not constitute legal advice. Organisations should consult qualified legal counsel for binding GDPR compliance decisions.

Features

šŸ” GDPR Knowledge Base (34 Tools)

  • Article Lookup — Retrieve any GDPR article by number, search across all 99 articles and 173 recitals

  • Definitions — Art. 4 term definitions with contextual explanations

  • Chapter Navigation — Browse articles by chapter with full directory

  • Azure Mappings — Map GDPR articles to Azure services and controls

šŸ“‹ Compliance Workflows

  • DPIA Assessment — Assess whether a DPIA is required (EDPB 9-criteria test), generate Art. 35 templates

  • ROPA Builder — Generate and validate Art. 30 Records of Processing Activities

  • DSR Guidance — Step-by-step workflows for all 7 data subject rights (Arts. 12–23)

  • Retention Analysis — Assess retention policies against Art. 5(1)(e) storage limitation

  • Controller/Processor Role Classification — Assess data roles, get obligations, analyze code patterns, generate DPA checklists

šŸ—ļø Infrastructure & Code Review

  • Bicep/Terraform/ARM Analyzer — Scan IaC for GDPR violations (encryption, access, network, residency, logging, retention)

  • Application Code Analyzer — Detect PII logging, hardcoded secrets, missing consent checks, data minimisation issues

  • GDPR Config Validator — Pass/fail validation in strict or advisory mode

  • DSR Capability Analyzer — Detect implementation of all 7 data subject rights (Arts. 15–22)

  • Cross-Border Transfer Analyzer — Identify third-party APIs/SDKs that may transfer data outside EEA, with risk justifications explaining why each provider has its assigned risk level (based on headquarters location, adequacy decisions, and data sensitivity)

  • Breach Readiness Analyzer — Assess breach detection, logging, and notification capabilities

  • Data Flow Analyzer — Map personal data lifecycle (collection, storage, transmission, deletion)

  • AST Code Analyzer — Deep analysis using Abstract Syntax Trees for Python, JavaScript, TypeScript, Java, C#, and Go with:

    • PII detection in function parameters and variables

    • Cross-border transfer detection via import analysis (150+ providers with risk justifications)

    • PII logging violation detection

    • DSR implementation pattern verification

    • Data flow tracking and call graph analysis

šŸ“ Guided Prompts (8 Expert Prompts)

  • Gap Analysis, DPIA Assessment, Compliance Roadmap, Data Mapping

  • Incident Response, Azure Privacy Review, Vendor Assessment, Cross-Border Transfers

šŸ“ Azure Bicep Templates (19 Templates)

  • Storage Account — CMK encryption, Private Endpoint, lifecycle policies (Art. 5, 25, 32, 44-49)

  • Key Vault — HSM-backed Premium, purge protection, RBAC (Art. 25, 32)

  • Azure SQL — Entra-only auth, TDE, auditing (Art. 25, 32)

  • Log Analytics — 365-day retention, saved GDPR queries for breach/access/erasure tracking (Art. 5(2), 30, 33)

  • Cosmos DB — EU-only regions, strong consistency, continuous backup, TTL-enabled ROPA container (Art. 25, 32, 44-49)

  • App Service — Managed identity, TLS 1.2, VNet integration, staging slot, full audit logging (Art. 25, 32)

  • Virtual Network — 3 subnets, NSGs with least-privilege rules, service endpoints (Art. 25, 32, 5(1)(f))

  • Container Apps — Internal ingress, mutual TLS, zone redundancy, managed identity (Art. 25, 32)

  • Monitor Alerts — DPO action group, 4 scheduled alerts for sign-in/exfiltration/escalation/Key Vault (Art. 33, 34, 32)

  • PostgreSQL Flexible Server — Zone-redundant HA, Entra ID auth, pgaudit, geo-redundant backups (Art. 25, 32, 5(1)(e))

  • Service Bus Premium — CMK encryption, GDPR queues for DSR/consent/breach/retention (Art. 25, 32, 5(1)(f))

  • AKS — Private cluster, Azure CNI, Defender for Containers, workload identity, network policies (Art. 25, 32, 5(1)(f))

  • Confidential Ledger — TEE-backed tamper-proof audit trail for GDPR accountability records (Art. 5(2), 30, 33)

  • Confidential VM — AMD SEV-SNP encrypted memory, vTPM, secure boot, ephemeral OS disk (Art. 25, 32, 5(1)(f))

  • Entra ID Configuration — Audit log routing, sign-in monitoring, Conditional Access checklist (Art. 32, 5(2))

  • Azure Policy — EU region restriction, CMK enforcement, tag requirements, HTTPS-only (Art. 25, 32, 44)

  • Defender for Cloud — All Defender plans, security contacts, auto-provisioning, GDPR compliance dashboard (Art. 32, 33)

  • API Management — Internal VNet, TLS 1.2+, rate limiting, data masking policies, audit logging (Art. 25, 32, 30)

  • Front Door with WAF — OWASP rules, EU/EEA geo-filtering, bot protection, rate limiting (Art. 25, 32, 44)

Related MCP server: GDPR Compliance for AI Systems MCP Server

Quick Start

Prerequisites

  • Python 3.10+

  • VS Code with GitHub Copilot

Installation

The server is published to the MCP Registry. You can install it directly in VS Code:

  1. Open the Extensions view (Ctrl+Shift+X)

  2. Type @mcp GDPR in the search field

  3. Click Install on "GDPR Shift-Left Compliance"

Note: The VS Code MCP gallery shows a curated subset of servers by default. If the server doesn't appear, add this to your VS Code User Settings (Ctrl+, → Open Settings JSON):

"chat.mcp.gallery.serviceUrl": "https://registry.modelcontextprotocol.io"

This points VS Code at the full MCP Registry (5,000+ servers) instead of GitHub's curated list.

Install via uvx (no clone needed)

uvx gdpr-shift-left-mcp

Install from source

# Clone the repository
git clone https://github.com/KevinRabun/GDPRShiftLeftMCP.git
cd GDPRShiftLeftMCP

# Install in development mode
pip install -e ".[dev]"

VS Code Integration

The repository includes .vscode/mcp.json for automatic MCP server registration. After installation, the GDPR tools appear in GitHub Copilot's tool list.

To configure manually, add to your VS Code settings:

{
  "mcp": {
    "servers": {
      "gdpr-shift-left-mcp": {
        "type": "stdio",
        "command": "python",
        "args": ["-m", "gdpr_shift_left_mcp"]
      }
    }
  }
}

Running the Server

# Run directly
python -m gdpr_shift_left_mcp

# Or via the installed entry point
gdpr-shift-left-mcp

Tool Reference

Tool

Description

GDPR Articles

get_article

Retrieve a GDPR article by number

All

list_chapter_articles

List all articles in a chapter

All

search_gdpr

Full-text search across GDPR

All

get_recital

Retrieve a recital by number

All

get_azure_mapping

Azure services for a GDPR article

All

get_definition

Art. 4 term definition

Art. 4

list_definitions

List all definitions

Art. 4

search_definitions

Search definitions

Art. 4

assess_dpia_need

Check if DPIA is required

Art. 35

generate_dpia_template

Generate DPIA document

Art. 35

get_dpia_guidance

DPIA area guidance

Art. 35–36

generate_ropa_template

Art. 30 ROPA template

Art. 30

validate_ropa

Validate ROPA completeness

Art. 30

get_ropa_requirements

ROPA field requirements

Art. 30

get_dsr_guidance

DSR handling guidance

Arts. 12–23

generate_dsr_workflow

DSR fulfilment workflow

Arts. 12–23

get_dsr_timeline

DSR response timelines

Art. 12(3)

analyze_infrastructure_code

Scan IaC for GDPR issues

Art. 25, 32, 44

analyze_application_code

Scan app code for GDPR issues

Art. 5, 25, 32

validate_gdpr_config

Pass/fail GDPR validation

All

assess_retention_policy

Assess retention policy

Art. 5(1)(e)

get_retention_guidance

Category-specific retention

Art. 5(1)(e)

check_deletion_requirements

Deletion capability checklist

Art. 17

assess_controller_processor_role

Assess data controller/processor role

Art. 4, 24, 26, 28

get_role_obligations

Role-specific GDPR obligations

Art. 24, 26, 28

analyze_code_for_role_indicators

Detect controller/processor code patterns

Art. 4, 24, 28

generate_dpa_checklist

Art. 28 DPA agreement checklist

Art. 28

get_role_scenarios

Common role classification scenarios

Art. 4, 24, 26, 28

analyze_dsr_capabilities

Detect DSR implementation (access, erase, portability, etc.)

Arts. 15–22

analyze_cross_border_transfers

Detect third-party APIs/SDKs with risk justifications

Arts. 44–49

analyze_breach_readiness

Assess breach detection, logging, and notification capabilities

Arts. 33–34

analyze_data_flow

Map personal data lifecycle (collection, storage, transmission, deletion)

Art. 30

analyze_code_ast

Deep AST analysis for Python/JS/TS/Java/C#/Go (PII, cross-border, DSR)

Art. 5, 25, 32, 44

get_ast_capabilities

Get AST analyzer supported languages and features

All

Architecture

src/gdpr_shift_left_mcp/
ā”œā”€ā”€ __init__.py              # Package init
ā”œā”€ā”€ __main__.py              # Entry point
ā”œā”€ā”€ server.py                # FastMCP server + prompt registration
ā”œā”€ā”€ disclaimer.py            # Legal disclaimer utility
ā”œā”€ā”€ data_loader.py           # Online GDPR data fetching + caching
ā”œā”€ā”€ tools/
│   ā”œā”€ā”€ __init__.py          # Tool registration (34 tools)
│   ā”œā”€ā”€ articles.py          # Article/recital/search tools
│   ā”œā”€ā”€ definitions.py       # Art. 4 definition tools
│   ā”œā”€ā”€ dpia.py              # DPIA assessment tools
│   ā”œā”€ā”€ ropa.py              # ROPA builder tools
│   ā”œā”€ā”€ dsr.py               # Data subject rights tools
│   ā”œā”€ā”€ analyzer.py          # IaC + app code analyzer
│   ā”œā”€ā”€ ast_analyzer.py      # AST-based deep code analysis
│   ā”œā”€ā”€ retention.py         # Retention/deletion tools
│   └── role_classifier.py   # Controller/processor role classification
ā”œā”€ā”€ prompts/
│   ā”œā”€ā”€ __init__.py          # Prompt loader
│   └── *.txt                # 8 expert prompt templates
└── templates/
    ā”œā”€ā”€ __init__.py           # Template loader
    └── *.bicep               # GDPR-aligned Azure Bicep templates

Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=gdpr_shift_left_mcp --cov-report=html

# Run judges (end-to-end evaluators)
python -m tests.evaluator.run_judges

Online Updates

The server fetches GDPR data from a configurable online source, with local caching:

  • Source URL: Set via GDPR_SOURCE_URL environment variable

  • Cache TTL: Default 1 hour (configurable via GDPR_CACHE_TTL)

  • Cache directory: __gdpr_cache__/ (configurable via GDPR_CACHE_DIR)

  • Fallback: Built-in data if online fetch fails

Contributing

See CONTRIBUTING.md for guidelines. This project follows Git Flow branching:

  • feature/<name> for new features

  • bugfix/<name> for fixes

  • release/<version> for releases

  • hotfix/<name> for production fixes

All PRs must pass automated tests and judges before merging.

License

MIT — see LICENSE for details.

Acknowledgements

Available Tools

34 tools
analyze_application_codeB

Analyze application code for GDPR compliance issues such as missing consent checks, PII logging, insecure data handling, and missing encryption.

Args: code: The application code content language: 'python', 'csharp', 'java', 'typescript', or 'javascript' file_path: Optional file path for reporting

Inputs: code (required), language (required), file_path. Returns: result

analyze_breach_readinessA

Analyze code for breach notification readiness under GDPR Art. 33-34.

Assesses:

  • Security logging capabilities

  • Alerting mechanisms

  • Incident tracking systems

  • 72-hour notification process references

  • Data subject notification capabilities

Args: code: The application code content language: Programming language ('python', 'typescript', 'csharp', etc.) file_path: Optional file path for reporting

Inputs: code (required), language (required), file_path. Returns: result

analyze_code_astA

Analyze code using AST for GDPR compliance (Python, JavaScript, TypeScript).

AST analysis provides higher accuracy than regex by:

  • Filtering out comments and string literals (reducing false positives)

  • Tracking variable assignments and data flow

  • Identifying function definitions and call sites

  • Verifying semantic intent of GDPR-related code

Detects:

  • Cross-border data transfers (third-party API imports)

  • PII handling in function parameters

  • PII logging violations

  • DSR implementation patterns (Art. 15-22)

Args: code: Source code to analyze file_path: Optional file path for automatic language detection language: Override language (python, javascript, typescript) deep_analysis: Include detailed function, import, and data flow info

Inputs: code (required), file_path, language, deep_analysis. Returns: result

analyze_code_for_role_indicatorsA

Analyze source code for patterns indicating controller vs processor role.

Detects patterns like: direct user data collection, consent mechanisms, multi-tenant isolation, webhook receivers, data forwarding, etc.

Args: code: The source code to analyze language: Programming language ('python', 'typescript', 'csharp', etc.)

Inputs: code (required), language (required). Returns: result

analyze_cross_border_transfersA

Analyze code for potential cross-border data transfers under GDPR Chapter V.

Detects:

  • Third-party API calls to non-EU services (OpenAI, Stripe, Twilio, etc.)

  • SDK imports for US-based services

  • Webhook/integration patterns that may involve data export

Provides guidance on SCCs, DPAs, and Transfer Impact Assessments.

Args: code: The application code content language: Programming language ('python', 'typescript', 'csharp', etc.) file_path: Optional file path for reporting

Inputs: code (required), language (required), file_path. Returns: result

analyze_data_flowA

Analyze code for personal data flow patterns to support ROPA documentation.

Maps the data lifecycle:

  • Collection: Where PII enters the system

  • Storage: Where PII is persisted

  • Transmission: Where PII is sent externally

  • Deletion: Where PII is removed

Helps identify GDPR compliance touchpoints for Art. 30 ROPA.

Args: code: The application code content language: Programming language ('python', 'typescript', 'csharp', etc.) file_path: Optional file path for reporting

Inputs: code (required), language (required), file_path. Returns: result

analyze_dsr_capabilitiesB

Analyze code for Data Subject Rights (DSR) implementation capabilities.

Detects patterns indicating support for GDPR rights:

  • Art. 15: Right of access

  • Art. 16: Right to rectification

  • Art. 17: Right to erasure

  • Art. 18: Right to restriction

  • Art. 20: Right to data portability

  • Art. 21: Right to object

  • Art. 22: Automated decision-making safeguards

Args: code: The application code content language: Programming language ('python', 'typescript', 'csharp', etc.) file_path: Optional file path for reporting

Inputs: code (required), language (required), file_path. Returns: result

analyze_infrastructure_codeA

Analyze Bicep/Terraform/ARM code for GDPR compliance issues.

Checks data residency, encryption, access control, logging, retention, and privacy-by-design patterns.

Args: code: The IaC code content file_type: 'bicep', 'terraform', or 'arm' file_path: Optional file path for reporting context: Optional additional context

Inputs: code (required), file_type (required), file_path, context. Returns: result

assess_controller_processor_roleA

Assess whether a service/system acts as data controller, processor, joint controller, or has a mixed role under GDPR.

Analyzes the service description against GDPR definitions and EDPB guidance to determine the likely role and associated obligations.

Args: service_description: Description of the service, data flows, business relationships, and processing activities

Inputs: service_description (required). Returns: result

assess_dpia_needB

Assess whether a DPIA is required for a described processing activity.

Args: processing_description: Free-text description of the data processing

Inputs: processing_description (required). Returns: result

assess_retention_policyB

Assess a data-retention policy against GDPR storage-limitation principle (Art. 5(1)(e)) and right to erasure (Art. 17).

Args: policy_description: Description of the retention policy

Inputs: policy_description (required). Returns: result

check_deletion_requirementsC

Check what deletion/anonymization capabilities a system must support per GDPR.

Args: system_context: Description of the system and data it holds

Inputs: system_context (required). Returns: result

generate_dpa_checklistA

Generate an Article 28 Data Processing Agreement (DPA) checklist.

Provides a comprehensive checklist of mandatory and recommended DPA clauses with Azure-specific considerations.

Args: context: Description of the processing relationship and context

Inputs: context (required). Returns: result

generate_dpia_templateA

Generate a DPIA template pre-filled with guidance for the described processing activity, including risk assessment and mitigation measures.

Args: processing_description: Free-text description of the data processing

Inputs: processing_description (required). Returns: result

generate_dsr_workflowB

Generate a step-by-step DSR fulfilment workflow with Azure implementation notes.

Args: request_type: Type of DSR system_context: Optional description of the system architecture

Inputs: request_type (required), system_context. Returns: result

generate_ropa_templateB

Generate a Records of Processing Activities (ROPA) template per Art. 30.

Args: organization_context: Description of the organization, its role (controller/processor), and main processing activities

Inputs: organization_context (required). Returns: result

get_articleB

Get the full text and context of a specific GDPR article.

Inputs: article_id (required). Returns: result

get_ast_capabilitiesA

Get information about AST analysis capabilities.

Returns supported languages, analysis categories, detected patterns, and configuration options for the AST-based code analyzer.

Inputs: no named parameters. Returns: result

get_azure_mappingC

Get Azure service recommendations mapped to a specific GDPR article.

Inputs: article_id (required). Returns: result

get_definitionA

Get the GDPR definition for a specific term (Art. 4).

Inputs: term (required). Returns: result

get_dpia_guidanceB

Get detailed DPIA guidance for a specific topic or processing type.

Args: topic: Topic area (e.g., 'profiling', 'large-scale monitoring', 'special categories', 'children')

Inputs: topic (required). Returns: result

get_dsr_guidanceA

Get guidance on handling a specific data-subject request.

Args: request_type: Type of DSR — 'access', 'rectification', 'erasure', 'restriction', 'portability', 'objection', 'automated_decision'

Inputs: request_type (required). Returns: result

get_dsr_timelineC

Get GDPR-mandated response timelines and extension rules for a DSR type.

Args: request_type: Type of DSR

Inputs: request_type (required). Returns: result

get_recitalB

Get the text of a specific GDPR recital.

Inputs: recital_number (required). Returns: result

get_retention_guidanceB

Get GDPR-aligned retention guidance for a specific data category.

Args: data_category: Category of data (e.g., 'employee records', 'customer data', 'marketing consent', 'health data', 'financial transactions')

Inputs: data_category (required). Returns: result

get_role_obligationsA

Get GDPR obligations specific to a controller/processor role.

Returns detailed obligations from relevant GDPR articles with optional Azure implementation guidance.

Args: role: 'controller', 'processor', 'joint_controller', or 'sub_processor' include_azure: Include Azure-specific implementation guidance

Inputs: role (required), include_azure. Returns: result

get_role_scenariosB

Get common controller/processor scenarios and role determinations.

Returns typical scenarios (SaaS, API services, cloud infrastructure, etc.) with guidance on typical role classification and exceptions.

Args: scenario_type: Filter scenarios by type (e.g., 'saas', 'api', 'cloud') or 'all' for all scenarios

Inputs: scenario_type. Returns: result

get_ropa_requirementsA

Get the mandatory ROPA fields for a given organizational role.

Args: role: 'controller' or 'processor' — determines required fields

Inputs: role. Returns: result

list_chapter_articlesB

List all articles within a specific GDPR chapter.

Inputs: chapter (required). Returns: result

list_definitionsA

List all GDPR definitions from Article 4.

Inputs: no named parameters. Returns: result

search_definitionsB

Search GDPR definitions by keywords.

Inputs: keywords (required). Returns: result

search_gdprA

Search across GDPR articles and recitals by keywords.

Inputs: keywords (required). Returns: result

validate_gdpr_configA

Validate IaC configuration against GDPR mandatory requirements BEFORE deploying.

Checks for: missing encryption at rest/in transit, public endpoints without justification, insufficient log retention, missing data classification tags, non-EU data residency.

Args: code: The IaC code content file_type: 'bicep', 'terraform', or 'arm' strict_mode: If True, fail on any GDPR violation

Inputs: code (required), file_type (required), strict_mode. Returns: result

validate_ropaB

Validate a ROPA document against Art. 30 mandatory fields.

Args: ropa_content: The ROPA content to validate (text/JSON/markdown)

Inputs: ropa_content (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 34 tools

    Disambiguation3/5

    Many analysis tools target code but with specific focuses (e.g., GDPR compliance, breach readiness, DSR). Overlap exists, but detailed descriptions help differentiate. Some tools like 'get_article' and 'search_gdpr' are distinct.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with underscores, e.g., analyze_*, generate_*, get_*, validate_*. No mixing of conventions.

    Tool Count3/5

    34 tools is on the high side for a single MCP server. While each tool serves a distinct purpose in GDPR compliance, the number may overwhelm agents. Some consolidation could reduce cognitive load.

    Completeness4/5

    The tool set covers a wide range of GDPR-related tasks: code analysis, DPIA, DSR, retention, breach readiness, ROPA, cross-border transfers, controller/processor roles, and infrastructure. Minor gaps exist, like missing data mapping or consent management tools.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Scan any project or website for privacy compliance issues directly in your AI coding tool. Detects tracking tech, cookies, and third-party data collection. Works in Claude Code, Cursor, and Windsurf.
      3
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Provides comprehensive GDPR compliance assessment tools for AI/ML systems, including lawful basis determination, DPIA generation, and data subject rights handling. It also crosswalks GDPR requirements to EU AI Act obligations with AI-specific considerations throughout.
      6
      3 npm
      56 PyPI
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Integrates authoritative security compliance frameworks (ISO 27001, NIST 800-53, OWASP ASVS, NIST SSDF) into AI-assisted development, offering control lookups, cross-framework mappings, build-time guardrails, and automated audit evidence generation.
      244 npm
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects AI coding assistants to DLP One for real-time security scanning, vulnerability management, and AI-generated remediation directly inside your IDE or AI agent.
      Apache 2.0