@nullclear/mcp 1.0.0 → 1.1.1
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 +6 -0
- package/dist/index.js +63 -5
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @nullclear/mcp
|
|
2
2
|
|
|
3
|
+
<!-- mcp-name: io.github.mithgalalfayez/nullclear -->
|
|
4
|
+
|
|
5
|
+
[](https://mcpservers.org/servers/nullclear-protocol/nullclear)
|
|
6
|
+
[](https://glama.ai/mcp/servers/Nullclear-Protocol/nullclear)
|
|
7
|
+
[](https://glama.ai/mcp/servers/Nullclear-Protocol/nullclear)
|
|
8
|
+
|
|
3
9
|
Model Context Protocol (MCP) server enabling autonomous AI agents (Claude Desktop, Cursor, Gemini, OpenAI Agents) to safely transact over HTTP 402 with NullClear deferred escrow and reputation scoring.
|
|
4
10
|
|
|
5
11
|
## Exposed Tools
|
package/dist/index.js
CHANGED
|
@@ -8,13 +8,14 @@ import {
|
|
|
8
8
|
ListToolsRequestSchema
|
|
9
9
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
10
10
|
import { NullClearClient, createNullClearFetch, NullClearEscrowAbortedError } from "@nullclear/x402-arbiter";
|
|
11
|
-
var ARBITER_URL = process.env.ARBITER_URL || "https://
|
|
12
|
-
var
|
|
11
|
+
var ARBITER_URL = process.env.ARBITER_URL || "https://api.nullclear.dev";
|
|
12
|
+
var SANDBOX_TEST_KEY = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
|
|
13
|
+
var DEFAULT_BUYER_KEY = process.env.BUYER_PRIVATE_KEY || SANDBOX_TEST_KEY;
|
|
13
14
|
var client = new NullClearClient({ arbiterUrl: ARBITER_URL });
|
|
14
15
|
var server = new Server(
|
|
15
16
|
{
|
|
16
17
|
name: "nullclear-mcp-server",
|
|
17
|
-
version: "1.
|
|
18
|
+
version: "1.1.1"
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
21
|
capabilities: {
|
|
@@ -46,7 +47,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
name: "nullclear_escrow_x402_call",
|
|
49
|
-
description: "Execute an x402-gated HTTP API call through NullClear deferred schema escrow. The arbiter guarantees payment is only settled if upstream returns valid data matching your schema contract. If the seller hallucinates or crashes, $0 is spent.",
|
|
50
|
+
description: "Execute an x402-gated HTTP API call through NullClear deferred schema escrow. The arbiter guarantees payment is only settled if upstream returns valid data matching your schema contract. If the seller hallucinates or crashes, $0 is spent. Users can test immediately against https://api.nullclear.dev/v1/sandbox/market-feed (or fail over from https://api.nullclear.dev/v1/sandbox/hallucinating-seller to https://api.nullclear.dev/v1/sandbox/market-feed) with zero wallet setup.",
|
|
50
51
|
inputSchema: {
|
|
51
52
|
type: "object",
|
|
52
53
|
required: ["targetUrl"],
|
|
@@ -78,6 +79,55 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
78
79
|
type: "object",
|
|
79
80
|
description: "JSON Schema draft-07 contract that response must strictly satisfy"
|
|
80
81
|
},
|
|
82
|
+
invariants: {
|
|
83
|
+
type: "array",
|
|
84
|
+
description: "Deep value invariants (numeric bounds, regex, forbidden substrings, timestamp freshness)",
|
|
85
|
+
items: {
|
|
86
|
+
type: "object",
|
|
87
|
+
required: ["path"],
|
|
88
|
+
properties: {
|
|
89
|
+
path: { type: "string" },
|
|
90
|
+
gt: { type: "number" },
|
|
91
|
+
gte: { type: "number" },
|
|
92
|
+
lt: { type: "number" },
|
|
93
|
+
lte: { type: "number" },
|
|
94
|
+
eq: {},
|
|
95
|
+
neq: {},
|
|
96
|
+
minLength: { type: "number" },
|
|
97
|
+
maxLength: { type: "number" },
|
|
98
|
+
pattern: { type: "string" },
|
|
99
|
+
notContains: { type: "array", items: { type: "string" } },
|
|
100
|
+
maxStalenessSeconds: { type: "number" }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
rejectRefusals: {
|
|
105
|
+
type: "boolean",
|
|
106
|
+
description: "Reject canonical LLM refusal strings (default: true)",
|
|
107
|
+
default: true
|
|
108
|
+
},
|
|
109
|
+
fallbacks: {
|
|
110
|
+
type: "array",
|
|
111
|
+
description: "Ordered fallback candidates for autonomous multi-seller failover routing (max 3)",
|
|
112
|
+
items: {
|
|
113
|
+
type: "object",
|
|
114
|
+
required: ["targetUrl", "paymentSignatureHeader"],
|
|
115
|
+
properties: {
|
|
116
|
+
targetUrl: { type: "string" },
|
|
117
|
+
sellerAgentId: { type: "string" },
|
|
118
|
+
paymentSignatureHeader: { type: "string" },
|
|
119
|
+
headers: { type: "object" }
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
spendPolicy: {
|
|
124
|
+
type: "object",
|
|
125
|
+
description: "Outbound spend firewall limits (maxPerCallAtomic, maxDailyWalletAtomic)",
|
|
126
|
+
properties: {
|
|
127
|
+
maxPerCallAtomic: { type: "string" },
|
|
128
|
+
maxDailyWalletAtomic: { type: "string" }
|
|
129
|
+
}
|
|
130
|
+
},
|
|
81
131
|
buyerPrivateKey: {
|
|
82
132
|
type: "string",
|
|
83
133
|
description: "Optional buyer private key (defaults to BUYER_PRIVATE_KEY environment variable)"
|
|
@@ -148,6 +198,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
148
198
|
const minTrustScore = args?.minTrustScore ? Number(args.minTrustScore) : 50;
|
|
149
199
|
const requiredFields = args?.requiredFields || void 0;
|
|
150
200
|
const jsonSchema = args?.jsonSchema || void 0;
|
|
201
|
+
const invariants = args?.invariants || void 0;
|
|
202
|
+
const rejectRefusals = args?.rejectRefusals !== void 0 ? Boolean(args.rejectRefusals) : true;
|
|
203
|
+
const fallbacks = args?.fallbacks || void 0;
|
|
204
|
+
const spendPolicy = args?.spendPolicy || void 0;
|
|
151
205
|
const buyerPrivateKey = args?.buyerPrivateKey || DEFAULT_BUYER_KEY;
|
|
152
206
|
const nullclearFetch = createNullClearFetch({
|
|
153
207
|
accountOrPrivateKey: buyerPrivateKey,
|
|
@@ -162,7 +216,11 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
162
216
|
sellerAgentId,
|
|
163
217
|
minTrustScore,
|
|
164
218
|
schema: jsonSchema,
|
|
165
|
-
requiredFields
|
|
219
|
+
requiredFields,
|
|
220
|
+
invariants,
|
|
221
|
+
rejectRefusals,
|
|
222
|
+
fallbacks,
|
|
223
|
+
spendPolicy
|
|
166
224
|
}
|
|
167
225
|
});
|
|
168
226
|
const responseText = await response.text();
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nullclear/mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"mcpName": "io.github.mithgalalfayez/nullclear",
|
|
4
5
|
"description": "Model Context Protocol server for autonomous agents using NullClear",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"homepage": "https://nullclear.dev",
|
|
@@ -23,8 +24,8 @@
|
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
|
25
26
|
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
26
|
-
"@nullclear/shared": "1.
|
|
27
|
-
"@nullclear/x402-arbiter": "1.
|
|
27
|
+
"@nullclear/shared": "1.1.1",
|
|
28
|
+
"@nullclear/x402-arbiter": "1.1.1",
|
|
28
29
|
"viem": "^2.23.0",
|
|
29
30
|
"zod": "^3.24.2"
|
|
30
31
|
},
|