GDPR Shift-Left Compliance

io.github.KevinRabun由 GitHub 帳號 KevinRabun 發布v0.4.0更新於 Oct 25, 2026

GDPR compliance MCP server - article lookup, DPIA, ROPA, DSR, IaC analysis, Bicep templates.

概覽

AI 產生的概覽

在本機執行的 GDPR 合規 MCP 伺服器,讓助理查詢 GDPR 條文與前言、執行 DPIA、ROPA 和 DSR 流程,並掃描程式碼與基礎設施中的合規問題。

可以做什麼
查詢與搜尋 GDPR 條文、前言、章節目錄及第 4 條定義,並將條文對應到 Azure 服務與控制項。執行 DPIA 必要性評估與範本產生,建立並驗證 ROPA 紀錄,取得 DSR 指引、工作流程與時限。評估留存政策、刪除要求以及控管者/處理者角色,並提供義務說明與 DPA 檢核清單。掃描基礎設施即程式碼與應用程式碼(含多語言 AST 分析),檢查 PII 記錄、硬編碼密鑰、同意缺失、跨境傳輸、外洩準備度與資料流。產生符合 GDPR 的 Azure Bicep 範本,並提供八個專家引導提示。
適用情境
適合希望在開發早期就納入 GDPR 要求的開發者與合規團隊,例如審查 Azure 基礎設施或應用程式碼中的資料保護問題、準備 DPIA 或 ROPA 文件,或在 IDE 內查詢 GDPR 條文。
執行需求
以 Python 套件形式透過 stdio 在本機執行(需 Python 3.10+),可用 uvx 或 python -m 啟動;README 以 VS Code 與 GitHub Copilot 為對象。未宣告驗證或 API 金鑰。它會從可設定的線上來源取得 GDPR 資料並在本機快取,取得失敗時改用內建資料。
安裝前請注意
README 聲明本工具僅提供資訊性指引,不構成法律意見;具拘束力的決定需諮詢合格律師。程式碼分析器會讀取你的原始碼與基礎設施檔案,產生的範本與文件使用前應人工複核。選用環境變數 GDPR_SOURCE_URL、GDPR_CACHE_TTL 和 GDPR_CACHE_DIR 決定參考資料的取得來源與快取位置。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 GDPR Shift-Left Compliance,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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)

Quick Start

Prerequisites

  • Python 3.10+
  • VS Code with GitHub Copilot

Installation

Install from the MCP Registry (recommended)

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):

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)
bash
uvx gdpr-shift-left-mcp
Install from source
bash
# Clone the repositorygit clone https://github.com/KevinRabun/GDPRShiftLeftMCP.gitcd GDPRShiftLeftMCP
# Install in development modepip 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:

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

Running the Server

bash
# Run directlypython -m gdpr_shift_left_mcp
# Or via the installed entry pointgdpr-shift-left-mcp

Tool Reference

ToolDescriptionGDPR Articles
get_articleRetrieve a GDPR article by numberAll
list_chapter_articlesList all articles in a chapterAll
search_gdprFull-text search across GDPRAll
get_recitalRetrieve a recital by numberAll
get_azure_mappingAzure services for a GDPR articleAll
get_definitionArt. 4 term definitionArt. 4
list_definitionsList all definitionsArt. 4
search_definitionsSearch definitionsArt. 4
assess_dpia_needCheck if DPIA is requiredArt. 35
generate_dpia_templateGenerate DPIA documentArt. 35
get_dpia_guidanceDPIA area guidanceArt. 35–36
generate_ropa_templateArt. 30 ROPA templateArt. 30
validate_ropaValidate ROPA completenessArt. 30
get_ropa_requirementsROPA field requirementsArt. 30
get_dsr_guidanceDSR handling guidanceArts. 12–23
generate_dsr_workflowDSR fulfilment workflowArts. 12–23
get_dsr_timelineDSR response timelinesArt. 12(3)
analyze_infrastructure_codeScan IaC for GDPR issuesArt. 25, 32, 44
analyze_application_codeScan app code for GDPR issuesArt. 5, 25, 32
validate_gdpr_configPass/fail GDPR validationAll
assess_retention_policyAssess retention policyArt. 5(1)(e)
get_retention_guidanceCategory-specific retentionArt. 5(1)(e)
check_deletion_requirementsDeletion capability checklistArt. 17
assess_controller_processor_roleAssess data controller/processor roleArt. 4, 24, 26, 28
get_role_obligationsRole-specific GDPR obligationsArt. 24, 26, 28
analyze_code_for_role_indicatorsDetect controller/processor code patternsArt. 4, 24, 28
generate_dpa_checklistArt. 28 DPA agreement checklistArt. 28
get_role_scenariosCommon role classification scenariosArt. 4, 24, 26, 28
analyze_dsr_capabilitiesDetect DSR implementation (access, erase, portability, etc.)Arts. 15–22
analyze_cross_border_transfersDetect third-party APIs/SDKs with risk justificationsArts. 44–49
analyze_breach_readinessAssess breach detection, logging, and notification capabilitiesArts. 33–34
analyze_data_flowMap personal data lifecycle (collection, storage, transmission, deletion)Art. 30
analyze_code_astDeep AST analysis for Python/JS/TS/Java/C#/Go (PII, cross-border, DSR)Art. 5, 25, 32, 44
get_ast_capabilitiesGet AST analyzer supported languages and featuresAll

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

bash
# Run all testspytest
# Run with coveragepytest --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

來源:README.md,提交 904aab0

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.4.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分