iotpay-mcp 0.0.0-stage → 0.9.5
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/README.md +14 -2
- package/bin/iotpay-mcp.mjs +85 -0
- package/package.json +28 -4
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# iotpay-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Zero-dependency MCP stdio-to-Streamable-HTTP bridge for [iotpay.eu](https://iotpay.eu) European B2B compliance oracles (EN 16931 / XRechnung, EU Sanctions, GDPR PII Shield, EUDAMED UDI, DORA LEI, § 14a EnWG).
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx -y iotpay-mcp --niche en16931
|
|
9
|
+
npx -y iotpay-mcp --niche sanctions-kyb
|
|
10
|
+
npx -y iotpay-mcp --niche dora-ict-oracle
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- **Website & Live Playground:** https://iotpay.eu
|
|
14
|
+
- **Source & Integrations:** https://github.com/AWR69/iotpay-mcp
|
|
15
|
+
- **License:** MIT (Free Pre-GmbH Technical Preview, § 521 BGB, Zero-PII RAM execution)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* iotpay-mcp — Zero-dependency MCP stdio-to-Streamable-HTTP bridge.
|
|
4
|
+
* Connects Claude Desktop, Cursor, Windsurf, or Cline to https://iotpay.eu/mcp*
|
|
5
|
+
* License: MIT | Free Technical Preview (§ 521 BGB), Zero-PII RAM execution.
|
|
6
|
+
*/
|
|
7
|
+
import readline from "node:readline";
|
|
8
|
+
|
|
9
|
+
const NICHE_ENDPOINTS = {
|
|
10
|
+
"en16931": "https://iotpay.eu/mcp",
|
|
11
|
+
"en16931-validator": "https://iotpay.eu/mcp",
|
|
12
|
+
"sanctions-kyb": "https://iotpay.eu/mcp/sanctions-kyb",
|
|
13
|
+
"privacy-pii-shield": "https://iotpay.eu/mcp/privacy-pii-shield",
|
|
14
|
+
"de-grid-oracle": "https://iotpay.eu/mcp/de-grid-oracle",
|
|
15
|
+
"eudamed-udi-verify": "https://iotpay.eu/mcp/eudamed-udi-verify",
|
|
16
|
+
"dora-ict-oracle": "https://iotpay.eu/mcp/dora-ict-oracle",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function parseArgs(argv) {
|
|
20
|
+
let niche = process.env.IOTPAY_NICHE || "en16931";
|
|
21
|
+
let url = process.env.IOTPAY_MCP_URL || "";
|
|
22
|
+
for (let i = 2; i < argv.length; i++) {
|
|
23
|
+
if ((argv[i] === "--niche" || argv[i] === "-n") && argv[i + 1]) {
|
|
24
|
+
niche = argv[++i].trim().toLowerCase();
|
|
25
|
+
} else if (argv[i] === "--url" && argv[i + 1]) {
|
|
26
|
+
url = argv[++i].trim();
|
|
27
|
+
} else if (argv[i] === "--help" || argv[i] === "-h") {
|
|
28
|
+
process.stderr.write(
|
|
29
|
+
"Usage: iotpay-mcp [--niche en16931|sanctions-kyb|privacy-pii-shield|de-grid-oracle|eudamed-udi-verify|dora-ict-oracle] [--url https://iotpay.eu/mcp]\n"
|
|
30
|
+
);
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return url || NICHE_ENDPOINTS[niche] || NICHE_ENDPOINTS.en16931;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const targetUrl = parseArgs(process.argv);
|
|
38
|
+
let sessionId = "";
|
|
39
|
+
|
|
40
|
+
const rl = readline.createInterface({ input: process.stdin, crlfDelay: Infinity });
|
|
41
|
+
|
|
42
|
+
rl.on("line", async (line) => {
|
|
43
|
+
const trimmed = line.trim();
|
|
44
|
+
if (!trimmed) return;
|
|
45
|
+
let parsedId = null;
|
|
46
|
+
try {
|
|
47
|
+
const reqObj = JSON.parse(trimmed);
|
|
48
|
+
parsedId = reqObj?.id ?? null;
|
|
49
|
+
const headers = {
|
|
50
|
+
"Content-Type": "application/json",
|
|
51
|
+
"Accept": "application/json, text/event-stream",
|
|
52
|
+
"User-Agent": "iotpay-mcp-npm/0.9.5",
|
|
53
|
+
};
|
|
54
|
+
if (sessionId) headers["Mcp-Session-Id"] = sessionId;
|
|
55
|
+
|
|
56
|
+
const controller = new AbortController();
|
|
57
|
+
const timer = setTimeout(() => controller.abort(), 30000);
|
|
58
|
+
const resp = await fetch(targetUrl, {
|
|
59
|
+
method: "POST",
|
|
60
|
+
headers,
|
|
61
|
+
body: trimmed,
|
|
62
|
+
signal: controller.signal,
|
|
63
|
+
});
|
|
64
|
+
clearTimeout(timer);
|
|
65
|
+
|
|
66
|
+
const newSid = resp.headers.get("mcp-session-id");
|
|
67
|
+
if (newSid) sessionId = newSid;
|
|
68
|
+
|
|
69
|
+
if (resp.status === 202) return; // JSON-RPC notification accepted
|
|
70
|
+
const bodyText = await resp.text();
|
|
71
|
+
if (bodyText.trim()) {
|
|
72
|
+
process.stdout.write(bodyText.trim() + "\n");
|
|
73
|
+
}
|
|
74
|
+
} catch (err) {
|
|
75
|
+
if (parsedId !== null) {
|
|
76
|
+
process.stdout.write(
|
|
77
|
+
JSON.stringify({
|
|
78
|
+
jsonrpc: "2.0",
|
|
79
|
+
id: parsedId,
|
|
80
|
+
error: { code: -32000, message: `Bridge error: ${err?.message || err}` },
|
|
81
|
+
}) + "\n"
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iotpay-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.9.5",
|
|
4
|
+
"description": "Zero-retention EU Compliance MCP stdio-to-HTTP bridge for iotpay.eu (EN 16931 / XRechnung, EU Sanctions, GDPR PII Shield, EUDAMED, DORA, EnWG 14a). Free Pre-GmbH Technical Preview (§ 521 BGB).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"iotpay-mcp": "./bin/iotpay-mcp.mjs"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"mcp",
|
|
11
|
+
"model-context-protocol",
|
|
12
|
+
"en16931",
|
|
13
|
+
"xrechnung",
|
|
14
|
+
"sanctions",
|
|
15
|
+
"kyb",
|
|
16
|
+
"gdpr",
|
|
17
|
+
"dora",
|
|
18
|
+
"eudamed",
|
|
19
|
+
"iotpay"
|
|
20
|
+
],
|
|
21
|
+
"homepage": "https://iotpay.eu",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/AWR69/iotpay-mcp.git"
|
|
25
|
+
},
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18.0.0"
|
|
29
|
+
}
|
|
30
|
+
}
|