GDPR Shift-Left Compliance MCP Server — Azure-first GDPR guidance, code review, and audit tools
Project description
GDPR Shift-Left MCP Server
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 (24 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
🏗️ 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
📝 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 (11 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))
Quick Start
Prerequisites
- Python 3.11+
- VS Code with GitHub Copilot
Installation
# 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": {
"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_gdpr_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_gdpr_recital |
Retrieve a recital by number | All |
get_azure_mapping |
Azure services for a GDPR article | All |
get_gdpr_definition |
Art. 4 term definition | Art. 4 |
list_gdpr_definitions |
List all definitions | Art. 4 |
search_gdpr_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 |
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 (24 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
│ └── retention.py # Retention/deletion tools
├── 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_URLenvironment variable - Cache TTL: Default 1 hour (configurable via
GDPR_CACHE_TTL) - Cache directory:
__gdpr_cache__/(configurable viaGDPR_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 featuresbugfix/<name>for fixesrelease/<version>for releaseshotfix/<name>for production fixes
All PRs must pass automated tests and judges before merging.
License
MIT — see LICENSE for details.
Acknowledgements
- Architecture inspired by FedRAMP20xMCP
- GDPR text from EUR-Lex
- EDPB guidelines from edpb.europa.eu
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gdpr_shift_left_mcp-0.1.1.tar.gz.
File metadata
- Download URL: gdpr_shift_left_mcp-0.1.1.tar.gz
- Upload date:
- Size: 160.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
060c24b3419a0f9ebf266e64c54c3643b69580b73d7234a9159cf3cc59ece399
|
|
| MD5 |
463547bf86a223f410f24fe01744aaf9
|
|
| BLAKE2b-256 |
089d0d3d6b4cff4ca992fda4b043b1747546f00004031cb50289e86909142330
|
Provenance
The following attestation bundles were made for gdpr_shift_left_mcp-0.1.1.tar.gz:
Publisher:
publish.yml on KevinRabun/GDPRShiftLeftMCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gdpr_shift_left_mcp-0.1.1.tar.gz -
Subject digest:
060c24b3419a0f9ebf266e64c54c3643b69580b73d7234a9159cf3cc59ece399 - Sigstore transparency entry: 925231790
- Sigstore integration time:
-
Permalink:
KevinRabun/GDPRShiftLeftMCP@1df191af828a8961fac5d581b92c56613083545a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/KevinRabun
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1df191af828a8961fac5d581b92c56613083545a -
Trigger Event:
push
-
Statement type:
File details
Details for the file gdpr_shift_left_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: gdpr_shift_left_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 159.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e4f7b560e918f51944169a8b9d75270fc2d7b6ba6646c478b12aa0298dd815b
|
|
| MD5 |
a9274817fc8e4000d544811d33499c5e
|
|
| BLAKE2b-256 |
ed8e242e4a8b695c63333924387efb03e409d8866d87457e66ecbca677aed16b
|
Provenance
The following attestation bundles were made for gdpr_shift_left_mcp-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on KevinRabun/GDPRShiftLeftMCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gdpr_shift_left_mcp-0.1.1-py3-none-any.whl -
Subject digest:
6e4f7b560e918f51944169a8b9d75270fc2d7b6ba6646c478b12aa0298dd815b - Sigstore transparency entry: 925231825
- Sigstore integration time:
-
Permalink:
KevinRabun/GDPRShiftLeftMCP@1df191af828a8961fac5d581b92c56613083545a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/KevinRabun
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1df191af828a8961fac5d581b92c56613083545a -
Trigger Event:
push
-
Statement type: