@kaditang/402sentinel-mcp 0.2.0 → 0.3.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.
- package/README.md +5 -1
- package/dist/index.js +65 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,12 +7,16 @@ decision, scored from on-chain settlement behaviour on Base (address age,
|
|
|
7
7
|
facilitator-aware payer diversity, settlement maturity) + a delivery-outcome
|
|
8
8
|
flywheel, with honest confidence/coverage.
|
|
9
9
|
|
|
10
|
-
Tools
|
|
10
|
+
Tools — vet the **seller**:
|
|
11
11
|
- `assess_counterparty` ($0.002) — risk score + decision + a ready-to-apply `recommended_policy`
|
|
12
12
|
- `assess_counterparty_deep` ($0.02) — same, scans more on-chain history
|
|
13
13
|
- `recommend_policy` ($0.002) — decision + wallet-ready spending policy (caps, denylist, approval)
|
|
14
14
|
- `report_outcome` (free) — after paying, report delivery to train the reliability flywheel
|
|
15
15
|
|
|
16
|
+
Tools — vet the **payment itself** (buyer-side):
|
|
17
|
+
- `firewall` ($0.002) — should YOUR agent make THIS payment now? Catches fraudulent routing (payTo swapped vs the address you usually pay), drain velocity, overcharge, and injection-sourced instructions. Pass your payer wallet as `agent_id`.
|
|
18
|
+
- `firewall_record` (free) — seed your agent's payment history so the firewall has a behavioural baseline.
|
|
19
|
+
|
|
16
20
|
It's a thin client for the hosted service at **https://402sentinel.com** — the
|
|
17
21
|
scoring model and facilitator-identification logic live server-side (closed); this
|
|
18
22
|
package only forwards the request and pays for it, so it's open source.
|
package/dist/index.js
CHANGED
|
@@ -111,6 +111,70 @@ const TOOLS = [
|
|
|
111
111
|
endpoint: "/api/report_outcome",
|
|
112
112
|
paid: false,
|
|
113
113
|
},
|
|
114
|
+
{
|
|
115
|
+
name: "firewall",
|
|
116
|
+
description: "Buyer-side payment firewall: should YOUR agent make THIS payment now? Where assess_counterparty vets the seller, this vets the payment instruction in the context of your agent's own history + provenance. Returns allow/hold/block + signals: routing_anomaly (payTo swapped vs the address you usually pay for this resource = fraudulent routing), velocity_anomaly (drain), amount_anomaly (overcharge), provenance_flag (injection/untrusted source), counterparty_risk. Pass your payer wallet as agent_id. Costs $0.002. Seed history free with firewall_record.",
|
|
117
|
+
inputSchema: {
|
|
118
|
+
type: "object",
|
|
119
|
+
required: ["agent_id", "payment"],
|
|
120
|
+
properties: {
|
|
121
|
+
agent_id: { type: "string", description: "stable id for your agent — use your payer wallet address" },
|
|
122
|
+
payment: {
|
|
123
|
+
type: "object",
|
|
124
|
+
required: ["payto_address"],
|
|
125
|
+
properties: {
|
|
126
|
+
payto_address: { type: "string", description: "address you're about to pay" },
|
|
127
|
+
amount: { type: "number" },
|
|
128
|
+
asset: { type: "string", description: "e.g. USDC" },
|
|
129
|
+
resource_url: { type: "string", description: "what you're paying for" },
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
context: {
|
|
133
|
+
type: "object",
|
|
134
|
+
properties: {
|
|
135
|
+
source: { type: "string", enum: ["tool_output", "web_content", "user", "unknown"], description: "where the payTo/instruction came from" },
|
|
136
|
+
metadata: { type: "object", description: "x402 description/reason strings (scanned for injection)" },
|
|
137
|
+
expected_payto: { type: "string", description: "known-good address for this resource (optional)" },
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
policy: {
|
|
141
|
+
type: "object",
|
|
142
|
+
properties: {
|
|
143
|
+
max_payment_usdc: { type: "number" },
|
|
144
|
+
velocity_window_min: { type: "number" },
|
|
145
|
+
velocity_cap_usdc: { type: "number" },
|
|
146
|
+
check_counterparty: { type: "boolean" },
|
|
147
|
+
block_on: { type: "array", items: { type: "string" } },
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
endpoint: "/api/firewall",
|
|
153
|
+
paid: true,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "firewall_record",
|
|
157
|
+
description: "FREE. Seed your agent's payment history so the firewall has a behavioural baseline (record past/known-good payments). Pass your payer wallet as agent_id.",
|
|
158
|
+
inputSchema: {
|
|
159
|
+
type: "object",
|
|
160
|
+
required: ["agent_id", "payment"],
|
|
161
|
+
properties: {
|
|
162
|
+
agent_id: { type: "string", description: "use your payer wallet address" },
|
|
163
|
+
payment: {
|
|
164
|
+
type: "object",
|
|
165
|
+
required: ["payto_address"],
|
|
166
|
+
properties: {
|
|
167
|
+
payto_address: { type: "string" },
|
|
168
|
+
amount: { type: "number" },
|
|
169
|
+
asset: { type: "string" },
|
|
170
|
+
resource_url: { type: "string" },
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
endpoint: "/api/firewall/record",
|
|
176
|
+
paid: false,
|
|
177
|
+
},
|
|
114
178
|
];
|
|
115
179
|
function clientOrNull() {
|
|
116
180
|
if (!RAW_PK || RAW_PK.startsWith("0xYour"))
|
|
@@ -119,7 +183,7 @@ function clientOrNull() {
|
|
|
119
183
|
return new GatewayClient({ chain: "base", privateKey: pk });
|
|
120
184
|
}
|
|
121
185
|
async function main() {
|
|
122
|
-
const server = new Server({ name: "402sentinel", version: "0.
|
|
186
|
+
const server = new Server({ name: "402sentinel", version: "0.3.0" }, { capabilities: { tools: {} } });
|
|
123
187
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
124
188
|
tools: TOOLS.map(({ name, description, inputSchema }) => ({ name, description, inputSchema })),
|
|
125
189
|
}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaditang/402sentinel-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "MCP tools
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "MCP tools for x402 payment safety — vet the counterparty (risk score, allow/review/block, spending policy) AND vet the payment itself (buyer-side firewall: routing/drain/injection). Thin client for 402sentinel.com.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": { "402sentinel-mcp": "./dist/index.js" },
|
|
7
7
|
"main": "dist/index.js",
|