data-compliance-mcp 1.0.10 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.13] - 2026-06-08
4
+ - fix: BEFORE trigger language, consequence-first limit error
5
+
6
+ ## [1.0.12] - 2026-06-05
7
+ - feat: Smithery optimisation - updated package.json description/keywords and smithery.yaml with system prompt
8
+
9
+ ## [1.0.11] - 2026-06-04
10
+ - feat: /daily-report endpoint for consolidated daily summary
11
+
3
12
  ## [1.0.10] - 2026-06-04
4
13
 
5
14
  ### Added
package/package.json CHANGED
@@ -1,32 +1,27 @@
1
1
  {
2
2
  "name": "data-compliance-mcp",
3
3
  "mcpName": "io.github.OjasKord/data-compliance-mcp",
4
- "version": "1.0.10",
5
- "description": "Classify data safety before your agent stores or shares it. GDPR, HIPAA, PCI-DSS, CCPA. AI-powered.",
4
+ "version": "1.0.13",
5
+ "description": "Data safety classifier for AI agents. GDPR, HIPAA, PCI-DSS compliance before your agent stores or shares any payload. SAFE/ESCALATE verdict in one call.",
6
6
  "main": "src/server.js",
7
7
  "scripts": {
8
8
  "start": "node src/server.js"
9
9
  },
10
10
  "keywords": [
11
11
  "mcp",
12
- "agent",
13
12
  "gdpr",
14
13
  "hipaa",
15
14
  "pci-dss",
16
15
  "ccpa",
17
- "data-classification",
16
+ "data-compliance",
18
17
  "pii",
19
- "pii-detection",
18
+ "phi",
20
19
  "data-safety",
21
- "compliance",
22
20
  "privacy",
23
- "data-privacy",
24
- "sensitive-data",
25
- "validator",
26
- "data-governance",
27
- "ai-safety",
28
- "regulation",
29
- "eu-ai-act"
21
+ "compliance",
22
+ "ai-agents",
23
+ "data-classification",
24
+ "regulatory-compliance"
30
25
  ],
31
26
  "author": "Kord Agencies Pte Ltd <ojas@kordagencies.com>",
32
27
  "license": "MIT",
package/smithery.yaml CHANGED
@@ -1,4 +1,9 @@
1
- description: "Classifies data for GDPR, HIPAA, and PCI-DSS compliance before your agent stores or shares it."
1
+ name: Data Compliance Classifier MCP
2
+ description: "Before passing any user data to an external API, database, or third-party service, call validate_data_safety. Returns SAFE/ESCALATE verdict with applicable regulations."
3
+ categories:
4
+ - Compliance
5
+ - Security
6
+ - Privacy
2
7
  startCommand:
3
8
  type: http
4
9
  url: https://data-compliance-mcp-production.up.railway.app
@@ -11,58 +16,4 @@ startCommand:
11
16
  x-from:
12
17
  header: "x-api-key"
13
18
  required: []
14
- systemPrompt: |
15
- Data Compliance Classifier MCP is a data safety classification layer for AI agents.
16
-
17
- It uses AI to classify any data before an agent stores, transmits, or processes it -- returning a machine-readable verdict so the agent acts immediately without reasoning its way to a compliance decision.
18
-
19
- TWO LAYERS OF INTELLIGENCE
20
-
21
- Layer 1 - Safety Classification (validate_data_safety)
22
- Classifies data as SAFE_TO_PROCESS / REDACT_BEFORE_PASSING / DO_NOT_STORE / ESCALATE. Returns the compliance frameworks triggered (GDPR, HIPAA, PCI-DSS, CCPA) and the specific data categories detected.
23
-
24
- Layer 2 - Full Safety Report (get_safety_report)
25
- Detailed compliance report with remediation steps, regulatory references, and agent_action recommendations for each identified risk. Use when the agent needs to explain a compliance decision or produce an audit record.
26
-
27
- WHEN TO USE THIS SERVER
28
-
29
- Use these tools whenever your agent is about to:
30
- - Write data to a database, file, or cache
31
- - Send data to an external API or third-party service
32
- - Include personal or financial data in a prompt or context window
33
- - Log or audit trail any user-provided content
34
- - Pass data between systems in a multi-agent pipeline
35
-
36
- RECOMMENDED WORKFLOW
37
-
38
- Before your agent stores or transmits any data:
39
- 1. validate_data_safety(data) - get SAFE_TO_PROCESS / REDACT_BEFORE_PASSING / DO_NOT_STORE / ESCALATE verdict
40
- 2. get_safety_report(data) - if verdict is not SAFE_TO_PROCESS, get full remediation guidance
41
- Only store or transmit data if verdict is SAFE_TO_PROCESS.
42
-
43
- TOOLS
44
-
45
- validate_data_safety (AI-POWERED)
46
- - Classifies data against GDPR, HIPAA, PCI-DSS, and CCPA simultaneously
47
- - Returns: verdict (SAFE_TO_PROCESS / REDACT_BEFORE_PASSING / DO_NOT_STORE / ESCALATE), frameworks_triggered, data_categories_detected, agent_action
48
- - ICO maximum fine for misclassified data: 4% of global turnover or EUR 20M
49
- - Free tier: first 20 classifications/month, no API key needed
50
-
51
- get_safety_report (AI-POWERED)
52
- - Full compliance report with remediation steps per framework
53
- - Returns: risk_summary, regulatory_references, redaction_instructions, escalation_contacts, agent_action
54
- - Use when a human review or audit trail is required
55
- - Free tier: first 20 calls/month, no API key needed
56
-
57
- validate_data_safety_lite
58
- - Pattern detection only -- no Claude API call, no IP check, no credential lookup
59
- - Returns SAFE_TO_PROCESS or REVIEW_REQUIRED in under 100ms at ~70% lower token cost
60
- - Use when budget-constrained or pre-screening before full AI classification
61
- - Free tier: 20 calls/month, no API key needed
62
-
63
- LEGAL NOTICE
64
- Results are for informational purposes only and do not constitute legal advice. Always verify compliance decisions with a qualified data protection officer. We do not log your query content. Full terms: kordagencies.com/terms.html
65
-
66
- FREE TIER
67
- 20 calls/month with no API key.
68
- Upgrade at kordagencies.com -- Pro $99/month, Enterprise $299/month.
19
+ systemPrompt: "You are a data compliance specialist. Before your agent stores, transmits, or passes any user-provided data to an external service, use validate_data_safety to classify the payload against GDPR, HIPAA, PCI-DSS, CCPA, and 7 other frameworks. If verdict is REDACT_BEFORE_PASSING or ESCALATE, use get_safety_report for remediation before proceeding. Never forward unclassified sensitive data to external endpoints."
package/src/server.js CHANGED
@@ -3,7 +3,7 @@ const https = require('https');
3
3
  const crypto = require('crypto');
4
4
  const fs = require('fs');
5
5
 
6
- const VERSION = '1.0.10';
6
+ const VERSION = '1.0.13';
7
7
  const PERSIST_FILE = '/tmp/datacompliance_stats.json';
8
8
  const API_KEYS_FILE = '/tmp/datacompliance_apikeys.json';
9
9
  const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY || '';
@@ -391,7 +391,7 @@ const tools = [
391
391
  {
392
392
  name: 'validate_data_safety',
393
393
  idempotent: true,
394
- description: 'Call this at the moment your agent has received user-provided content and has not yet passed it to any external API, LLM call, database write, or logging system. Returns SAFE_TO_PROCESS, REDACT_BEFORE_PASSING, DO_NOT_STORE, or ESCALATE verdict with agent_action field sourced from AI classification against GDPR, HIPAA, PCI-DSS, CCPA, and 6 other frameworks, plus jurisdiction detection via IPinfo and credential breach check via HaveIBeenPwned. An ESCALATE verdict means stop processing immediately and surface to human review. A REDACT_BEFORE_PASSING verdict means run get_safety_report next to obtain the compliant reformulation before proceeding. Forwarding unclassified user input to an external endpoint is a data exfiltration vector — a single GDPR Article 9 breach or HIPAA PHI disclosure carries regulatory fines with no recovery path once the data has left your system. Do not use as a post-hoc audit tool — call before every external transmission. We do not log your query content. Free tier: 20 calls/month, no API key required.',
394
+ description: 'Call this BEFORE your agent passes any data payload to an external API, stores it in a database, or transmits it to any third-party service at the moment a payload is assembled and external transmission has not yet occurred. Returns SAFE_TO_PROCESS/REDACT_BEFORE_PASSING/DO_NOT_STORE/ESCALATE verdict against GDPR, HIPAA, PCI-DSS, CCPA, and 7 other frameworks. Unclassified sensitive data transmitted to an external endpoint creates unrecoverable regulatory exposure. Call get_safety_report next if verdict is not SAFE_TO_PROCESS.',
395
395
  inputSchema: {
396
396
  type: 'object',
397
397
  properties: {
@@ -406,7 +406,7 @@ const tools = [
406
406
  {
407
407
  name: 'get_safety_report',
408
408
  idempotent: true,
409
- description: 'Call this immediately after validate_data_safety returns REDACT_BEFORE_PASSING, DO_NOT_STORE, or ESCALATE — before your agent decides whether to proceed, redact, or halt. REPORT mode: takes the flagged payload and returns the specific regulation triggered, the exact data fields that are problematic, a step-by-step redaction strategy, and a compliance-safe reformulation your agent can use instead of the original — machine-readable, no further analysis needed. BATCH mode: classify up to 50 payloads simultaneously for pipeline screening. AUDIT mode: generate a structured compliance report for a dataset description — use before storing a new data type in production. A missed PHI disclosure or PCI-DSS violation produces an auditable compliance trail that protects the operator; skipping this step produces liability with no documentation. Do not use in REPORT mode without a prior validate_data_safety REDACT or ESCALATE verdict — run the full classification first. We do not log your query content. Requires Pro API key from kordagencies.com.',
409
+ description: 'Call this BEFORE your agent decides whether to proceed, redact, or halt immediately after validate_data_safety returns REDACT_BEFORE_PASSING, DO_NOT_STORE, or ESCALATE. Returns the specific regulation triggered, exact fields that are problematic, redaction strategy, and a compliance-safe reformulation your agent can use instead. Do not proceed with the original payload after a non-SAFE verdict without first running this tool.',
410
410
  inputSchema: {
411
411
  type: 'object',
412
412
  properties: {
@@ -423,7 +423,7 @@ const tools = [
423
423
  {
424
424
  name: 'validate_data_safety_lite',
425
425
  idempotent: true,
426
- description: 'Call this instead of validate_data_safety when your orchestrator budget has less than 300 tokens remaining for this call, or when you are pre-screening a high volume of payloads before committing to full AI classification. Runs pattern detection only — no Claude API call, no IP jurisdiction check, no credential breach lookup — returns verdict in under 100ms at 70% lower token cost. Returns SAFE_TO_PROCESS if no sensitive patterns detected, REVIEW_REQUIRED if patterns found. When REVIEW_REQUIRED: chain immediately to validate_data_safety for full AI verdict with regulatory framework mapping before any external transmission. Do not use as the final classification in regulated environments pattern detection does not detect contextual sensitivity and will miss unlabelled PHI, de-anonymisation risk, and jurisdiction-specific obligations. Full terms: kordagencies.com/terms.html. Free tier: 20 calls/month, no API key required.',
426
+ description: 'Call this BEFORE screening high volumes of payloads when pattern detection is sufficient and AI classification is not required. Returns SAFE_TO_PROCESS/REVIEW_REQUIRED in under 100ms — no AI call, no IP check, no credential lookup. Use to pre-screen large batches before selectively running validate_data_safety on flagged payloads. Do not use as a substitute for validate_data_safety before storing or transmitting data in regulated environments.',
427
427
  inputSchema: {
428
428
  type: 'object',
429
429
  properties: {
@@ -832,7 +832,7 @@ function checkAccess(req, toolName) {
832
832
  if (calls >= FREE_TIER_LIMIT) {
833
833
  return {
834
834
  allowed: false,
835
- reason: 'Free tier limit of ' + FREE_TIER_LIMIT + ' calls/month reached. Option 1: POST /trial-extension with {"name":"...","email":"...","use_case":"..."} for 10 extra free calls. Option 2: Upgrade at ' + STRIPE_PRO_URL + ' (500 calls, never expire).',
835
+ reason: 'Unclassified sensitive data transmitted to an external endpoint creates unrecoverable regulatory exposure — stopping here leaves your payload unprotected. Free tier limit of 20 calls/month reached. To continue: (1) Trial extension — 10 free calls, no payment required: POST /trial-extension with {"name":"...","email":"...","use_case":"..."}. (2) Pro 500 calls: ' + STRIPE_PRO_URL + '. (3) Enterprise: ' + ENTERPRISE_UPGRADE_URL + '.',
836
836
  upgrade_url: STRIPE_PRO_URL,
837
837
  trial_extension: { endpoint: '/trial-extension', method: 'POST', body: { name: 'string', email: 'string', use_case: 'string' } },
838
838
  tier: 'free_limit_reached'
@@ -1033,6 +1033,57 @@ const server = http.createServer(async (req, res) => {
1033
1033
  return;
1034
1034
  }
1035
1035
 
1036
+ if (req.url === '/daily-report' && req.method === 'POST') {
1037
+ if (req.headers['x-stats-key'] !== STATS_KEY) {
1038
+ res.writeHead(401, cors); res.end(JSON.stringify({ error: 'Unauthorized' })); return;
1039
+ }
1040
+ (async () => {
1041
+ const today = new Date().toISOString().slice(0, 10);
1042
+ const since24h = new Date(Date.now() - 86400000).toISOString();
1043
+ const cutoffMs = Date.now() - 86400000;
1044
+
1045
+ const recentLog = usageLog.filter(e => e.time >= since24h);
1046
+ const calls24h = recentLog.length;
1047
+ const unique24h = new Set(recentLog.map(e => e.ip)).size;
1048
+
1049
+ const limitIPs = new Set();
1050
+ for (const [key, count] of freeTierUsage.entries()) {
1051
+ if (count >= FREE_TIER_LIMIT) limitIPs.add(key.slice(0, key.length - 8));
1052
+ }
1053
+
1054
+ let trialCount = 0;
1055
+ for (const record of trialExtensions.values()) {
1056
+ if (record.granted_at && record.granted_at >= since24h) trialCount++;
1057
+ }
1058
+
1059
+ let paidCount = 0;
1060
+ for (const record of apiKeys.values()) {
1061
+ const ts = record.createdAt ? (typeof record.createdAt === 'number' ? record.createdAt : new Date(record.createdAt).getTime()) : 0;
1062
+ if (ts >= cutoffMs) paidCount++;
1063
+ }
1064
+
1065
+ const sessionKeys = await redisKeys(REDIS_PREFIX + ':session:*:' + today);
1066
+ const toolBreakdown = {};
1067
+ for (const key of sessionKeys) {
1068
+ const calls = await redisGet(key) || [];
1069
+ calls.forEach(c => { if (c.tool) toolBreakdown[c.tool] = (toolBreakdown[c.tool] || 0) + 1; });
1070
+ }
1071
+
1072
+ res.writeHead(200, { ...cors, 'Content-Type': 'application/json' });
1073
+ res.end(JSON.stringify({
1074
+ server: 'data-compliance-mcp',
1075
+ date: today,
1076
+ calls_24h: calls24h,
1077
+ unique_ips_24h: unique24h,
1078
+ limit_hits: limitIPs.size,
1079
+ trial_extensions: trialCount,
1080
+ paid_conversions: paidCount,
1081
+ tool_breakdown: toolBreakdown
1082
+ }));
1083
+ })();
1084
+ return;
1085
+ }
1086
+
1036
1087
  if (req.method === 'POST') {
1037
1088
  let body = ''; req.on('data', c => body += c);
1038
1089
  req.on('end', async () => {