data-compliance-mcp 1.0.8 → 1.0.9

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,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.9] - 2026-06-02
4
+
5
+ ### Fixed
6
+ - fix: IP extraction fixed for Cloudflare proxy headers — free tier gate now enforces correctly
7
+
3
8
  ## [1.0.5] - 2026-04-28
4
9
 
5
10
  ### Changed
package/README.md CHANGED
@@ -92,6 +92,49 @@ With paid API key:
92
92
  }
93
93
  ```
94
94
 
95
+ ## Harness Integration
96
+
97
+ ### Claude Code / Claude Desktop (.mcp.json)
98
+ ```json
99
+ {
100
+ "mcpServers": {
101
+ "data-compliance": {
102
+ "type": "http",
103
+ "url": "https://data-compliance-mcp-production.up.railway.app"
104
+ }
105
+ }
106
+ }
107
+ ```
108
+
109
+ ### LangChain (Python)
110
+ ```python
111
+ from langchain_mcp_adapters.client import MultiServerMCPClient
112
+ client = MultiServerMCPClient({
113
+ "data-compliance": {
114
+ "url": "https://data-compliance-mcp-production.up.railway.app",
115
+ "transport": "http"
116
+ }
117
+ })
118
+ tools = await client.get_tools()
119
+ ```
120
+
121
+ ### OpenAI Agents SDK (Python)
122
+ ```python
123
+ from agents import Agent, HostedMCPTool
124
+ agent = Agent(
125
+ name="Assistant",
126
+ tools=[HostedMCPTool(tool_config={
127
+ "type": "mcp",
128
+ "server_label": "data-compliance",
129
+ "server_url": "https://data-compliance-mcp-production.up.railway.app",
130
+ "require_approval": "never"
131
+ })]
132
+ )
133
+ ```
134
+
135
+ ### LangGraph
136
+ Same as LangChain above — langchain-mcp-adapters works with LangGraph natively.
137
+
95
138
  ## Example call
96
139
 
97
140
  ```bash
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "data-compliance-mcp",
3
3
  "mcpName": "io.github.OjasKord/data-compliance-mcp",
4
- "version": "1.0.8",
4
+ "version": "1.0.9",
5
5
  "description": "Classify data safety before your agent stores or shares it. GDPR, HIPAA, PCI-DSS, CCPA. AI-powered.",
6
6
  "main": "src/server.js",
7
7
  "scripts": {
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.8';
6
+ const VERSION = '1.0.9';
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 || '';
@@ -714,7 +714,8 @@ function checkAccess(req, toolName) {
714
714
  return { allowed: true, tier: record.plan };
715
715
  }
716
716
 
717
- const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress || 'unknown';
717
+ const rawIp = req.headers['x-forwarded-for'] || req.socket.remoteAddress || 'unknown';
718
+ const ip = rawIp.split(',')[0].trim();
718
719
  const monthKey = getMonthKey(ip);
719
720
  const calls = freeTierUsage.get(monthKey) || 0;
720
721
  if (calls >= FREE_TIER_LIMIT) {
@@ -857,7 +858,8 @@ const server = http.createServer(async (req, res) => {
857
858
  if (!name || !email) { res.writeHead(400, { ...cors, 'Content-Type': 'application/json' }); res.end(JSON.stringify({ error: 'name and email are required', agent_action: 'PROVIDE_REQUIRED_FIELDS' })); return; }
858
859
  const emailKey = 'trial:' + email.toLowerCase().trim();
859
860
  if (trialExtensions.has(emailKey)) { res.writeHead(409, { ...cors, 'Content-Type': 'application/json' }); res.end(JSON.stringify({ error: 'Trial extension already granted for this email.', upgrade_url: STRIPE_PRO_URL, agent_action: 'INFORM_USER_TRIAL_ALREADY_USED' })); return; }
860
- const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress || 'unknown';
861
+ const rawIp = req.headers['x-forwarded-for'] || req.socket.remoteAddress || 'unknown';
862
+ const ip = rawIp.split(',')[0].trim();
861
863
  const monthKey = getMonthKey(ip);
862
864
  const currentCalls = freeTierUsage.get(monthKey) || 0;
863
865
  freeTierUsage.set(monthKey, Math.max(0, currentCalls - TRIAL_EXTENSION_CALLS));
@@ -915,7 +917,8 @@ const server = http.createServer(async (req, res) => {
915
917
  return;
916
918
  }
917
919
 
918
- const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress || 'unknown';
920
+ const rawIp = req.headers['x-forwarded-for'] || req.socket.remoteAddress || 'unknown';
921
+ const ip = rawIp.split(',')[0].trim();
919
922
  usageLog.push({ tool: name, tier: access.tier, time: nowISO(), ip: ip.slice(0, 8) + '...' });
920
923
  if (usageLog.length > 1000) usageLog.shift();
921
924
  toolUsageCounts[name] = (toolUsageCounts[name] || 0) + 1;