@nullclear/mcp 1.1.1 → 1.1.2
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 +34 -34
- package/dist/index.js +203 -7
- package/package.json +19 -4
package/README.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# @nullclear/mcp
|
|
2
|
-
|
|
3
|
-
<!-- mcp-name: io.github.
|
|
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
|
-
|
|
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.
|
|
10
|
-
|
|
11
|
-
## Exposed Tools
|
|
12
|
-
|
|
13
|
-
1. `nullclear_check_reputation`: Query an agent's on-chain trust score, clearing reliability, and Sybil wash-trade penalty flags.
|
|
14
|
-
2. `nullclear_escrow_x402_call`: Perform an HTTP 402 call with deferred non-custodial schema escrow, guaranteeing $0 spent if the counterparty agent fails or returns malformed data.
|
|
15
|
-
3. `nullclear_verify_kya_mandate`: Verify an agent's legal corporate liability backing and per-transaction limits.
|
|
16
|
-
|
|
17
|
-
## Configuration
|
|
18
|
-
|
|
19
|
-
Add to your MCP client config (e.g., `claude_desktop_config.json`):
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"mcpServers": {
|
|
24
|
-
"nullclear": {
|
|
25
|
-
"command": "node",
|
|
26
|
-
"args": ["/path/to/nullclear/packages/mcp-server/dist/index.js"],
|
|
27
|
-
"env": {
|
|
28
|
-
"ARBITER_URL": "https://arbiter.nullclear.dev",
|
|
29
|
-
"BUYER_PRIVATE_KEY": "0x..."
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
```
|
|
1
|
+
# @nullclear/mcp
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.Nullclear-Protocol/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
|
+
|
|
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.
|
|
10
|
+
|
|
11
|
+
## Exposed Tools
|
|
12
|
+
|
|
13
|
+
1. `nullclear_check_reputation`: Query an agent's on-chain trust score, clearing reliability, and Sybil wash-trade penalty flags.
|
|
14
|
+
2. `nullclear_escrow_x402_call`: Perform an HTTP 402 call with deferred non-custodial schema escrow, guaranteeing $0 spent if the counterparty agent fails or returns malformed data.
|
|
15
|
+
3. `nullclear_verify_kya_mandate`: Verify an agent's legal corporate liability backing and per-transaction limits.
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
Add to your MCP client config (e.g., `claude_desktop_config.json`):
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"nullclear": {
|
|
25
|
+
"command": "node",
|
|
26
|
+
"args": ["/path/to/nullclear/packages/mcp-server/dist/index.js"],
|
|
27
|
+
"env": {
|
|
28
|
+
"ARBITER_URL": "https://arbiter.nullclear.dev",
|
|
29
|
+
"BUYER_PRIVATE_KEY": "0x..."
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,11 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
6
|
import {
|
|
7
7
|
CallToolRequestSchema,
|
|
8
|
-
ListToolsRequestSchema
|
|
8
|
+
ListToolsRequestSchema,
|
|
9
|
+
ListPromptsRequestSchema,
|
|
10
|
+
GetPromptRequestSchema,
|
|
11
|
+
ListResourcesRequestSchema,
|
|
12
|
+
ReadResourceRequestSchema
|
|
9
13
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
10
14
|
import { NullClearClient, createNullClearFetch, NullClearEscrowAbortedError } from "@nullclear/x402-arbiter";
|
|
11
15
|
var ARBITER_URL = process.env.ARBITER_URL || "https://api.nullclear.dev";
|
|
@@ -15,11 +19,13 @@ var client = new NullClearClient({ arbiterUrl: ARBITER_URL });
|
|
|
15
19
|
var server = new Server(
|
|
16
20
|
{
|
|
17
21
|
name: "nullclear-mcp-server",
|
|
18
|
-
version: "1.1.
|
|
22
|
+
version: "1.1.2"
|
|
19
23
|
},
|
|
20
24
|
{
|
|
21
25
|
capabilities: {
|
|
22
|
-
tools: {}
|
|
26
|
+
tools: {},
|
|
27
|
+
prompts: {},
|
|
28
|
+
resources: {}
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
);
|
|
@@ -29,13 +35,20 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
29
35
|
{
|
|
30
36
|
name: "nullclear_check_reputation",
|
|
31
37
|
description: "Inspect an AI agent's trust score (0-100), clearing reliability, Sybil wash-trade penalty flags, and corporate KYA backing on Base",
|
|
38
|
+
annotations: {
|
|
39
|
+
title: "Inspect AI Agent Trust & Sybil Score",
|
|
40
|
+
readOnlyHint: true,
|
|
41
|
+
destructiveHint: false,
|
|
42
|
+
idempotentHint: true,
|
|
43
|
+
openWorldHint: true
|
|
44
|
+
},
|
|
32
45
|
inputSchema: {
|
|
33
46
|
type: "object",
|
|
34
47
|
required: ["agentId"],
|
|
35
48
|
properties: {
|
|
36
49
|
agentId: {
|
|
37
50
|
type: "string",
|
|
38
|
-
description: "The ERC-8004 agent token ID or registered identifier"
|
|
51
|
+
description: "The ERC-8004 agent token ID or registered identifier (e.g. '124595')"
|
|
39
52
|
},
|
|
40
53
|
chainId: {
|
|
41
54
|
type: "number",
|
|
@@ -48,6 +61,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
48
61
|
{
|
|
49
62
|
name: "nullclear_escrow_x402_call",
|
|
50
63
|
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.",
|
|
64
|
+
annotations: {
|
|
65
|
+
title: "Execute Escrowed x402 Call with Invariants",
|
|
66
|
+
readOnlyHint: false,
|
|
67
|
+
destructiveHint: false,
|
|
68
|
+
idempotentHint: false,
|
|
69
|
+
openWorldHint: true
|
|
70
|
+
},
|
|
51
71
|
inputSchema: {
|
|
52
72
|
type: "object",
|
|
53
73
|
required: ["targetUrl"],
|
|
@@ -86,7 +106,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
86
106
|
type: "object",
|
|
87
107
|
required: ["path"],
|
|
88
108
|
properties: {
|
|
89
|
-
path: { type: "string" },
|
|
109
|
+
path: { type: "string", description: "Dot-notation property path" },
|
|
90
110
|
gt: { type: "number" },
|
|
91
111
|
gte: { type: "number" },
|
|
92
112
|
lt: { type: "number" },
|
|
@@ -124,8 +144,8 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
124
144
|
type: "object",
|
|
125
145
|
description: "Outbound spend firewall limits (maxPerCallAtomic, maxDailyWalletAtomic)",
|
|
126
146
|
properties: {
|
|
127
|
-
maxPerCallAtomic: { type: "string" },
|
|
128
|
-
maxDailyWalletAtomic: { type: "string" }
|
|
147
|
+
maxPerCallAtomic: { type: "string", description: "Max atomic USDC spend allowed per call" },
|
|
148
|
+
maxDailyWalletAtomic: { type: "string", description: "Max rolling daily atomic USDC spend allowed" }
|
|
129
149
|
}
|
|
130
150
|
},
|
|
131
151
|
buyerPrivateKey: {
|
|
@@ -138,6 +158,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
138
158
|
{
|
|
139
159
|
name: "nullclear_verify_kya_mandate",
|
|
140
160
|
description: "Verify an agent's Know Your Agent (KYA) corporate liability mandate, active validity, and whether a proposed transaction amount is within corporate limits",
|
|
161
|
+
annotations: {
|
|
162
|
+
title: "Verify Corporate KYA Mandate & Limits",
|
|
163
|
+
readOnlyHint: true,
|
|
164
|
+
destructiveHint: false,
|
|
165
|
+
idempotentHint: true,
|
|
166
|
+
openWorldHint: true
|
|
167
|
+
},
|
|
141
168
|
inputSchema: {
|
|
142
169
|
type: "object",
|
|
143
170
|
required: ["agentId", "transactionAmountUsd"],
|
|
@@ -161,6 +188,175 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
161
188
|
]
|
|
162
189
|
};
|
|
163
190
|
});
|
|
191
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
192
|
+
return {
|
|
193
|
+
prompts: [
|
|
194
|
+
{
|
|
195
|
+
name: "safe-x402-payment",
|
|
196
|
+
description: "Generate safety invariants and schema-escrow directives for an autonomous agent paying an upstream x402 seller.",
|
|
197
|
+
arguments: [
|
|
198
|
+
{
|
|
199
|
+
name: "targetUrl",
|
|
200
|
+
description: "Upstream API endpoint demanding x402 payment",
|
|
201
|
+
required: true
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "sellerAgentId",
|
|
205
|
+
description: "Seller's ERC-8004 agent token ID to verify reputation",
|
|
206
|
+
required: false
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "maxSpendAtomic",
|
|
210
|
+
description: "Maximum atomic USDC units authorized (default: 10000 = $0.01 USDC)",
|
|
211
|
+
required: false
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: "audit-erc8004-agent",
|
|
217
|
+
description: "Conduct an end-to-end trust audit on an ERC-8004 agent on Base including Sybil risk and corporate KYA backing.",
|
|
218
|
+
arguments: [
|
|
219
|
+
{
|
|
220
|
+
name: "agentId",
|
|
221
|
+
description: "ERC-8004 agent token ID (e.g. '124595')",
|
|
222
|
+
required: true
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "chainId",
|
|
226
|
+
description: "Base chain ID (default: 8453)",
|
|
227
|
+
required: false
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
};
|
|
233
|
+
});
|
|
234
|
+
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
235
|
+
const { name, arguments: promptArgs } = request.params;
|
|
236
|
+
if (name === "safe-x402-payment") {
|
|
237
|
+
const targetUrl = promptArgs?.targetUrl || "https://api.nullclear.dev/v1/sandbox/market-feed";
|
|
238
|
+
const sellerAgentId = promptArgs?.sellerAgentId || "unknown";
|
|
239
|
+
const maxSpendAtomic = promptArgs?.maxSpendAtomic || "10000";
|
|
240
|
+
return {
|
|
241
|
+
description: "Safe x402 Escrow Clearing Directive",
|
|
242
|
+
messages: [
|
|
243
|
+
{
|
|
244
|
+
role: "user",
|
|
245
|
+
content: {
|
|
246
|
+
type: "text",
|
|
247
|
+
text: `You are preparing to execute an autonomous payment to an x402 service at ${targetUrl}.
|
|
248
|
+
|
|
249
|
+
Mandatory Safety Rules:
|
|
250
|
+
1. NEVER send unconditional payments directly to unverified endpoints.
|
|
251
|
+
2. Invoke the MCP tool 'nullclear_escrow_x402_call' with targetUrl="${targetUrl}", sellerAgentId="${sellerAgentId}", minTrustScore=50, and spendPolicy={ maxPerCallAtomic: "${maxSpendAtomic}" }.
|
|
252
|
+
3. Supply an explicit JSON schema and deep numeric invariants to validate the seller's response before settlement.
|
|
253
|
+
4. If the seller hallucinates, returns an LLM refusal, or crashes, the arbiter voids the payment automatically and $0.00 is charged.`
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
if (name === "audit-erc8004-agent") {
|
|
260
|
+
const agentId = promptArgs?.agentId || "124595";
|
|
261
|
+
const chainId = promptArgs?.chainId || "8453";
|
|
262
|
+
return {
|
|
263
|
+
description: "ERC-8004 Agent Trust & Sybil Audit",
|
|
264
|
+
messages: [
|
|
265
|
+
{
|
|
266
|
+
role: "user",
|
|
267
|
+
content: {
|
|
268
|
+
type: "text",
|
|
269
|
+
text: `Perform a comprehensive security audit of ERC-8004 agent #${agentId} on chain ${chainId}.
|
|
270
|
+
1. Run MCP tool 'nullclear_check_reputation' with agentId="${agentId}", chainId=${chainId}.
|
|
271
|
+
2. Run MCP tool 'nullclear_verify_kya_mandate' with agentId="${agentId}", chainId=${chainId}, transactionAmountUsd=1.0.
|
|
272
|
+
3. Analyze the composite trust score, letter grade (A-F), Sybil wash-trading risk flags, and corporate liability coverage.
|
|
273
|
+
4. Provide a clear recommendation on whether this agent is safe for autonomous financial counterparty interactions.`
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
throw new Error(`Unknown prompt: ${name}`);
|
|
280
|
+
});
|
|
281
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
282
|
+
return {
|
|
283
|
+
resources: [
|
|
284
|
+
{
|
|
285
|
+
uri: "nullclear://stats/live",
|
|
286
|
+
name: "NullClear Live Protocol Telemetry",
|
|
287
|
+
mimeType: "application/json",
|
|
288
|
+
description: "Live protocol metrics: total clearings, verified settlements, voided hallucinations, and indexed agents"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
uri: "nullclear://docs/quickstart",
|
|
292
|
+
name: "NullClear Quickstart Guide",
|
|
293
|
+
mimeType: "text/markdown",
|
|
294
|
+
description: "Zero-loss x402 deferred schema escrow guide for autonomous AI agents on Base Mainnet"
|
|
295
|
+
}
|
|
296
|
+
]
|
|
297
|
+
};
|
|
298
|
+
});
|
|
299
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
300
|
+
const { uri } = request.params;
|
|
301
|
+
if (uri === "nullclear://stats/live") {
|
|
302
|
+
try {
|
|
303
|
+
const res = await fetch(`${ARBITER_URL}/v1/stats`);
|
|
304
|
+
const data = await res.json();
|
|
305
|
+
return {
|
|
306
|
+
contents: [
|
|
307
|
+
{
|
|
308
|
+
uri,
|
|
309
|
+
mimeType: "application/json",
|
|
310
|
+
text: JSON.stringify(data, null, 2)
|
|
311
|
+
}
|
|
312
|
+
]
|
|
313
|
+
};
|
|
314
|
+
} catch {
|
|
315
|
+
return {
|
|
316
|
+
contents: [
|
|
317
|
+
{
|
|
318
|
+
uri,
|
|
319
|
+
mimeType: "application/json",
|
|
320
|
+
text: JSON.stringify({
|
|
321
|
+
totalClearings: 0,
|
|
322
|
+
validSettlements: 0,
|
|
323
|
+
voidedHallucinations: 0,
|
|
324
|
+
totalAgentsIndexed: 1,
|
|
325
|
+
status: "active"
|
|
326
|
+
}, null, 2)
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
if (uri === "nullclear://docs/quickstart") {
|
|
333
|
+
return {
|
|
334
|
+
contents: [
|
|
335
|
+
{
|
|
336
|
+
uri,
|
|
337
|
+
mimeType: "text/markdown",
|
|
338
|
+
text: `# NullClear Arbiter Quickstart
|
|
339
|
+
|
|
340
|
+
NullClear is the autonomous deferred clearing and reputation protocol for AI agent commerce on Base Mainnet.
|
|
341
|
+
|
|
342
|
+
### Core Philosophy
|
|
343
|
+
Never sign away funds unconditionally. Using EIP-3009 signed authorizations and deterministic JSON schema validation, NullClear holds seller payments in deferred escrow and only settles if output adheres 100% to your contract.
|
|
344
|
+
|
|
345
|
+
### Primary MCP Tools
|
|
346
|
+
- \`nullclear_escrow_x402_call\`: Execute deferred schema escrow with numeric bounds and LLM refusal guards.
|
|
347
|
+
- \`nullclear_check_reputation\`: Check an ERC-8004 agent's Sybil trust score (0-100) and wash-trading flags.
|
|
348
|
+
- \`nullclear_verify_kya_mandate\`: Verify an agent's corporate entity backing and spending limits.
|
|
349
|
+
|
|
350
|
+
### Test Sandbox
|
|
351
|
+
- Market Feed (Success): \`https://api.nullclear.dev/v1/sandbox/market-feed\` ($0.01 USDC)
|
|
352
|
+
- Hallucinating Seller (Fails & Voids): \`https://api.nullclear.dev/v1/sandbox/hallucinating-seller\`
|
|
353
|
+
`
|
|
354
|
+
}
|
|
355
|
+
]
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
throw new Error(`Resource not found: ${uri}`);
|
|
359
|
+
});
|
|
164
360
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
165
361
|
const { name, arguments: args } = request.params;
|
|
166
362
|
try {
|
package/package.json
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nullclear/mcp",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"mcpName": "io.github.
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"mcpName": "io.github.Nullclear-Protocol/nullclear",
|
|
5
5
|
"description": "Model Context Protocol server for autonomous agents using NullClear",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"author": "NullClear Protocol <contact@nullclear.dev>",
|
|
7
8
|
"homepage": "https://nullclear.dev",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"mcp",
|
|
11
|
+
"model-context-protocol",
|
|
12
|
+
"x402",
|
|
13
|
+
"erc-8004",
|
|
14
|
+
"agent-payments",
|
|
15
|
+
"escrow",
|
|
16
|
+
"reputation",
|
|
17
|
+
"base",
|
|
18
|
+
"smithery"
|
|
19
|
+
],
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/Nullclear-Protocol/nullclear/issues"
|
|
22
|
+
},
|
|
8
23
|
"repository": {
|
|
9
24
|
"type": "git",
|
|
10
25
|
"url": "https://github.com/Nullclear-Protocol/nullclear.git"
|
|
@@ -24,8 +39,8 @@
|
|
|
24
39
|
},
|
|
25
40
|
"dependencies": {
|
|
26
41
|
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
27
|
-
"@nullclear/shared": "1.1.
|
|
28
|
-
"@nullclear/x402-arbiter": "1.1.
|
|
42
|
+
"@nullclear/shared": "1.1.2",
|
|
43
|
+
"@nullclear/x402-arbiter": "1.1.2",
|
|
29
44
|
"viem": "^2.23.0",
|
|
30
45
|
"zod": "^3.24.2"
|
|
31
46
|
},
|