DPOLens
Connects DPOLens to GitHub Copilot in VS Code, giving it tools to search and read privacy laws and an organisation's policies with exact, versioned citations.
Get started
DPOLens runs on your own servers with Docker Compose, so your policies stay there. Get started takes you from the first command to your first question, and Connect your AI assistant sets up Claude Code, Codex, Cursor and GitHub Copilot in VS Code.
To try it first, add the community version to your AI assistant: public privacy law only, with no sign-in and no token.
For Claude Code, Codex, ChatGPT and the others, the community version's page has the line to add.
Related MCP server: io.github.mister-franklin/gdpr-decisions
What's inside
An MCP server with four tools to search and read the law and your policies, quoting each clause word for word with its key, its version and the date that version took effect. The MCP server
Laws as packs, each from its official source: GDPR and the UAE PDPL today, and more as their packs are released. Supported laws
Your own policies, from Word or Markdown files, read into clauses without an AI model and published as versions that never change. Your own policies
Search by words and by meaning, in English and Arabic, on the CPU, with no LLM and no API key.
A dashboard and two logs: a governance log that is append-only and hash-chained, and every question asked, with personal data taken out. The governance log
An HTTP API, the same one the dashboard and the MCP server use. The HTTP API
Measured
Search: on held-out questions, the clause the guidance points at is among the top five answers 77% of the time for GDPR, and 55% for the UAE's law. How it was measured
Use: Claude Code with the plugin searched before writing code in 36 of 36 runs of tasks that touch personal data, and in 3 of 45 runs of tasks that do not. How it was measured
Contributing
Law packs are the contribution that matters most, and CONTRIBUTING.md says what one needs. A security problem is reported privately, as SECURITY.md says.
Licence
The code is Apache-2.0, with DCO sign-off and no CLA. packs/ carries its own licence: the law
text keeps its source's, and the structure around it is CC-BY-4.0.
Available Tools
4 toolsget_clauseRead one clauseARead-onlyInspect
Read one clause by its key, with where it sits and what sits beneath it.
Use it when a search result points at another clause, or when you need the whole of an article rather than the part that matched. The call is recorded, with the key that was read rather than a question.
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | A canonical key, such as gdpr:art-17:para-1 | |
| lang | No | Which language to prefer, as a two letter code | en |
| as_of | No | Read the clause as it stood on this date | |
| whole_subtree | No | Also return this clause and everything beneath it in reading order, which is what you want for a whole article |
Output Schema
| Name | Required | Description |
|---|---|---|
| now | No | For a policy's clause read in a version that is no longer in force, where the same rule is in the version in force. A policy's keys follow its printed numbers, so the rule may have another key now |
| clause | Yes | |
| subtree | No | This clause and everything beneath it in reading order, when asked for |
| children | Yes | The clauses directly beneath this one |
| formerly | No | Set when this key named a different rule in the policy's version before |
| cross_references | Yes | Keys this clause's own words point at |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond readOnlyHint/openWorldHint, the description discloses that the response includes structural context (parent and children) and that the call is audited/recorded with the key rather than a question. Audit logging and result shape are behaviour the annotations cannot convey, though nothing is said about language fallback or as-of resolution.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, front-loaded with the core action and scoping. The phrase 'where it sits and what sits beneath it' is slightly literary but earns its place by describing the hierarchy in the result.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists so return values needn't be spelled out, and annotations carry the safety profile; the description usefully adds the audit-recording note and the article-vs-fragment distinction. Only minor gaps remain around language fallback and as-of semantics.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and each parameter (key, lang, as_of, whole_subtree) is already documented in the schema. The description gestures at 'whole of an article', which maps to whole_subtree, but adds no format or fallback detail beyond the schema's own text, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Read one clause by its key') and hints at the returned shape ('where it sits and what sits beneath it'). It never names the sibling tools (get_document, search_policies), so differentiation is inferred rather than explicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives concrete triggers: when a search result points at another clause, or when you need the whole of an article rather than the matched part. That is clear context but there are no explicit exclusions or named alternatives, so the agent must infer that search_policies is for discovery.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_documentRead one document's outlineARead-onlyInspect
Read one document and its top level structure, without the text.
The outline is where to find a clause key when you know roughly where to look. Read the words with get_clause. The call is recorded.
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | The document's slug, such as gdpr | |
| as_of | No | Read the document as it stood on this date |
Output Schema
| Name | Required | Description |
|---|---|---|
| outline | Yes | |
| document | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already establish that this is a safe read-only, non-open-world call. The description adds useful behavioral context: the outline excludes document text and the call is recorded, which is relevant audit information not captured by the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short and front-loaded: it states what is returned, how it relates to clause lookup, and the logging behavior. Every sentence carries useful information without repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With annotations covering safety, schema coverage at 100%, and an output schema present, the description provides enough context for correct invocation. It explains the outline's purpose and points to get_clause for full text.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so slug and as_of are already well documented in the schema. The description adds no parameter-level semantics beyond the general 'one document' framing, which is acceptable given the schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: reading one document's top-level structure without its text. It also distinguishes the tool from get_clause, which is for reading the actual words, so an agent can tell the two apart immediately.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives a clear usage condition: use the outline when you know roughly where to look for a clause key, and use get_clause to read the words. It does not explicitly cover when to prefer list_documents or search_policies, so it falls short of full when/when-not guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_documentsList what can be citedARead-onlyInspect
List the laws this community version can cite, and which version of each is in force.
| Name | Required | Description | Default |
|---|---|---|---|
| as_of | No | List the documents in force on this date | |
| limit | No | How many to return | |
| offset | No | Skip this many first |
Output Schema
| Name | Required | Description |
|---|---|---|
| total | Yes | How many documents are in force, ignoring limit and offset |
| documents | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safety profile (readOnlyHint=true, openWorldHint=false), so the description's value is in explaining that results are limited to the 'community version' corpus and that each document carries an in-force version — genuine behavioral context an agent would otherwise not know. It doesn't discuss pagination behavior, but the schema already documents limit/offset.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence, front-loaded with the action and resource, with the scope caveat and version detail packed into a subordinate clause. Nothing is padded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return-value explanation isn't required, and the tool has no required parameters. The description adequately frames a simple listing tool, with only a minor gap around how it relates to the sibling retrieval tools and when to move on to them.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and each parameter is documented inline, so the baseline is 3. The description's mention of 'in force' loosely gestures at the as_of parameter but adds no syntax or defaulting detail beyond the schema's own 'List the documents in force on this date'.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('List the laws ... can cite') plus a scope qualifier ('this community version') and adds that each entry reports which version is in force. This clearly separates it from get_document/get_clause (retrieval of one item) and search_policies (query-based lookup), though it never names those alternatives explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied: 'what can be cited' suggests this is the discovery step before fetching a specific document. There is no explicit 'use this when...' guidance, no statement about when to prefer search_policies instead, and no note on what to do with the results.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_policiesSearch the lawARead-onlyInspect
Search the privacy law this community version holds.
Call this before writing or changing code that collects, stores, logs, shares or deletes personal data, and before answering a question about what the law requires. What comes back is the clause itself, word for word, with the key, document and version to cite it by.
Questions asked here are kept 30 days, with nothing about who asked.
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | The language of the question, en or ar. Leave it out to have it read from the letters the question is written in | |
| laws | No | Only these of the laws this organisation has selected, by slug, such as gdpr or uae-pdpl. Leave it out to search all of them | |
| as_of | No | Read the documents as they stood on this date | |
| limit | No | How many clauses to return | |
| query | Yes | The question, in words | |
| include_explanatory | No | Include text that explains without obliging, such as a GDPR recital |
Output Schema
| Name | Required | Description |
|---|---|---|
| results | Yes | |
| searched | Yes | What was searched, and as of when |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safety profile (readOnlyHint=true, openWorldHint=false), but the description adds real disclosure beyond them: the corpus is the community version only, results are verbatim clauses with cite keys, and queries are retained 30 days without attribution. That retention/audit fact is exactly the kind of thing an agent cannot get from annotations or schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with purpose, then when-to-call, then return shape, then the retention note. Four short paragraphs, each earning its place. The privacy sentence is slightly off-task for tool selection but is genuinely decision-relevant for some agents.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema and full parameter coverage, the description only needs purpose, timing and behavioral caveats — all present. Minor gaps: no statement about what happens with zero matches or whether the limit truncates ranked results.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so lang, laws, as_of, limit and include_explanatory are already well documented. The description adds nothing parameter-specific — the mention of the returned clause with document and version is output framing, not input semantics. Baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Search the privacy law') and scopes the corpus ('this community version holds'), which separates it from get_clause/get_document/list_documents by implying retrieval-by-query rather than by identifier. It stops short of naming any sibling explicitly, so an agent must infer the boundary from the verb alone.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives concrete triggering conditions: call before writing or changing code that touches personal data, and before answering questions about legal requirements. No exclusions or named alternatives are offered, so the agent is not told when to use get_clause or get_document instead.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.2.0- First observed
get_clause - First observed
get_document - First observed
list_documents - First observed
search_policies
TDQS
Scored across 4 tools
Each tool has a distinct retrieval shape: query-based search, key-based clause read, document listing, and document outline read. The only near-pair is get_clause vs. get_document, but the descriptions explicitly disambiguate by stating one returns words and the other returns structure without text.
All four tools follow a clean verb_noun snake_case pattern (search_policies, get_clause, list_documents, get_document). The verbs match the operation type precisely, with no mixed conventions.
Four tools is well within a sensible range and each maps to a necessary step in a read-only legal-lookup workflow: discover documents, browse outline, search, and read a clause. Nothing feels padded or missing for the scope.
The read-only surface covers the core loop of search → locate → read clause, plus document/version discovery. Minor gaps remain: no way to request a specific historical version of a clause, and get_document only exposes top-level structure, forcing extra get_clause calls for deep article traversal.
Maintenance
Related MCP Connectors
AI laws from 110+ countries, enforcement actions and a 3,900-term glossary. Free, no API key.
One-step legal compliance for vibe-coded apps: privacy, terms, cookie banner and EU AI Act check.
EU AI Act and GDPR checks with sources: classify an AI system, trace each duty, find the supervisor.
Run deterministic SaaS contract redlining, GDPR Art. 28 DPA & EU AI Act compliance audits.
Related MCP Servers
AlicenseAqualityFmaintenanceScan 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.397 npm1MIT- AlicenseAqualityDmaintenanceProvides AI-powered access to the largest EU GDPR enforcement decisions database, enabling semantic search, GDPR article lookup, and enforcement statistics across all EU/EEA Data Protection Authorities.436 PyPI1MIT
- AlicenseNot gradedqualityDmaintenanceA remotely callable MCP server for US legal research that provides tools to search, retrieve, and analyze US case law from the CourtListener API, enabling agents to build evidence packs from primary sources without generating legal content.MIT

brehon-mcp-serverofficial
AlicenseNot gradedqualityDmaintenanceProvides AI assistants with real-time, structured access to 32 privacy and AI governance laws across 28 jurisdictions to prevent hallucination in compliance answers.2 npmMIT