mcp-strict-payload-validator 0.0.0-stage → 1.0.0

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.
Files changed (3) hide show
  1. package/README.md +5 -2
  2. package/bin/cli.js +3 -0
  3. package/package.json +17 -3
package/README.md CHANGED
@@ -1,3 +1,6 @@
1
- # Temporary Holding Version
1
+ # mcp-strict-payload-validator
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Autonomous L402-gated MCP validator and deterministic auto-patch engine for ISO 20022, HL7 FHIR, and JSON-RPC payloads at 21 sats/call.
4
+
5
+ - Discovery: https://strict-spec-validator.independent-api-dev.workers.dev/.well-known/l402.json
6
+ - Protocols: MCP, L402, pi402, Wavelength
package/bin/cli.js ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ const EP="https://strict-spec-validator.independent-api-dev.workers.dev/v1/validate";let buf="";process.stdin.on("data",async c=>{buf+=c.toString();let ls=buf.split("\n");buf=ls.pop();for(const l of ls){if(!l.trim())continue;const m=JSON.parse(l),send=r=>process.stdout.write(JSON.stringify({jsonrpc:"2.0",id:m.id,result:r})+"\n");if(m.method==="initialize")send({protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:{name:"mcp-strict-payload-validator",version:"1.0.0"}});else if(m.method==="tools/list")send({tools:[{name:"validate_strict_payload",description:"Validate ISO 20022, HL7 FHIR, or JSON-RPC payloads and get deterministic auto-patches via L402 (21 sats).",inputSchema:{type:"object",properties:{spec:{type:"string"},payload:{type:"string"},preimage:{type:"string"}},required:["spec","payload"]}}]});
3
+ else if(m.method==="tools/call"){const a=m.params.arguments,u=EP+"?spec="+encodeURIComponent(a.spec);const r1=await fetch(u,{method:"POST",body:a.payload});if(r1.status===402&&a.preimage){const w=r1.headers.get("www-authenticate"),mc=new RegExp("macaroon="([^"]+)"").exec(w)[1];const r2=await fetch(u,{method:"POST",headers:{Authorization:"L402 "+mc+":"+a.preimage},body:a.payload});send({content:[{type:"text",text:await r2.text()}]});}else{send({content:[{type:"text",text:await r1.text()}]});}}}});
package/package.json CHANGED
@@ -1,6 +1,20 @@
1
1
  {
2
2
  "name": "mcp-strict-payload-validator",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "description": "Autonomous L402 MCP validator and auto-patch generator for ISO 20022, HL7 FHIR, and JSON-RPC payloads (pi402/Wavelength enabled)",
5
+ "bin": {
6
+ "mcp-strict-payload-validator": "bin/cli.js"
7
+ },
8
+ "keywords": [
9
+ "mcp",
10
+ "l402",
11
+ "pi402",
12
+ "wavelength",
13
+ "validator",
14
+ "iso20022",
15
+ "fhir",
16
+ "jsonrpc",
17
+ "ai-agent"
18
+ ],
19
+ "license": "MIT"
6
20
  }