oceanalt-aml-mcp 0.2.1 → 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.
Files changed (3) hide show
  1. package/README.md +2 -1
  2. package/package.json +1 -1
  3. package/server.mjs +39 -2
package/README.md CHANGED
@@ -10,6 +10,7 @@ Built for [agentic payments](https://oceanalt.com/en/rap): ask *"is this payee s
10
10
 
11
11
  | Tool | Input | What it does | Price |
12
12
  |------|-------|--------------|-------|
13
+ | `payment_decision` | `to`, `amountUsdc?`, `purpose?`, `network?` | **Before your agent pays, call once** → allow / review / decline + evidence + retry + a verifiable settlement attestation | Free |
13
14
  | `screen_address` | `address` (0x… / T… / Solana), `network?` | AML verdict + risk score + verifiable evidence | Free |
14
15
  | `recent_flagged` | — | Recently flagged high-risk addresses | Free |
15
16
  | `compliance_decision` | `to`, `amountUsdc?`, `purpose?`, `network?` | Full gateway verdict (allow / review / decline) + evidence | $0.30 |
@@ -78,7 +79,7 @@ MIT © OceanAlt
78
79
 
79
80
  让 **Claude / Cursor / 任意 MCP 客户端**原生调用 OceanAlt 的链上地址合规筛查 + 合规网关。给收据,不给黑箱分:每条判决都带**可点开核验的证据**。覆盖 7 条 EVM 链 + 波场 TRON + Solana,付款前先问一句「这个收款方安不安全」。
80
81
 
81
- - **免费两工具**:`screen_address`(单查 + 证据)、`recent_flagged`(近期被标记)。无需 key、无需注册。
82
+ - **免费三工具**:`payment_decision`(付款前调一次 → allow/review/decline + 证据 + 可核验结算凭证)、`screen_address`(单查 + 证据)、`recent_flagged`(近期被标记)。无需 key、无需注册。
82
83
  - **付费三工具(x402)**:`compliance_decision`(网关判决)、`deep_trace`(波场深度追踪)、`batch_screen`(批量)。按需加载 `@x402`+`viem`,设置 `OCEANALT_PAYER_KEY` 才启用。
83
84
  - **⚠️ 真钱**:付费端点**当前在 Base 主网结算,USDC 为真实资金**(`eip155:8453`),上表 `$` 价按真实 USDC 收取。付款前务必以实时清单 <https://oceanalt.com/api/x402> 为准,并使用**小额专用付款钱包**。
84
85
  - **🔐 钱包安全**:`OCEANALT_PAYER_KEY` 只在本地签一次 EIP-3009 授权,**绝不随包发布/上传/打日志**;facilitator 代付 gas、不托管资金。**建议用小额专用钱包**,别用主资金钱包私钥。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oceanalt-aml-mcp",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "mcpName": "io.github.chrisssun18-bot/oceanalt-aml",
5
5
  "description": "OceanAlt AML 的 MCP server —— 让 Claude / 任意 MCP agent 原生调用地址合规筛查(免费)+ x402 付费判决/追踪/批量。",
6
6
  "type": "module",
package/server.mjs CHANGED
@@ -35,7 +35,7 @@ async function apiGet(path) {
35
35
  } finally { clearTimeout(t); }
36
36
  }
37
37
 
38
- const server = new McpServer({ name: "oceanalt-aml", version: "0.2.0" });
38
+ const server = new McpServer({ name: "oceanalt-aml", version: "0.3.0" });
39
39
 
40
40
  server.registerTool(
41
41
  "screen_address",
@@ -101,6 +101,43 @@ server.registerTool(
101
101
  }
102
102
  );
103
103
 
104
+ server.registerTool(
105
+ "payment_decision",
106
+ {
107
+ title: "Decide whether to pay an address before an agent pays (free)",
108
+ description:
109
+ "\"Before your agent pays, call OceanAlt once.\" Pass the payee address the agent is about to pay; get a machine-executable decision: allow | review | decline, plus verifiable evidence and retry semantics. Use this as a gate in an autonomous payment flow — if the decision is not \"allow\", do not pay. On allow/review it also returns a verifiable compliance attestation you can attach to the settlement so the payment carries proof it passed OceanAlt's decision. Free, no API key, no signup. (For the paid variant that also settles the payment on x402 rails, use compliance_decision.)",
110
+ inputSchema: {
111
+ to: z.string().describe("Payee address the agent is about to pay. EVM: 0x + 40 hex. Tron: T + 33 base58."),
112
+ amountUsdc: z.number().optional().describe("Amount in USDC (optional; recorded/echoed, not required for the decision)."),
113
+ purpose: z.string().optional().describe("Short purpose/memo for the payment (optional)."),
114
+ network: z.enum(NETWORKS).optional().describe("EVM chain for the payee (same set as screen_address). Optional; ignored for Tron."),
115
+ },
116
+ annotations: { title: "Payment decision (free)", readOnlyHint: true, idempotentHint: true, openWorldHint: true },
117
+ },
118
+ async ({ to, amountUsdc, purpose, network }) => {
119
+ const q = new URLSearchParams({ to });
120
+ if (amountUsdc != null) q.set("amountUsdc", String(amountUsdc));
121
+ if (purpose) q.set("purpose", purpose);
122
+ if (network) q.set("network", network);
123
+ const r = await apiGet(`/api/decide?${q.toString()}`);
124
+ const lines = [
125
+ `Decision: ${r.decision} (allow=${r.allow})`,
126
+ `Address: ${r.address} | Verdict: ${r.verdict} | Risk: ${r.risk == null ? "n/a" : r.risk + "/100"}`,
127
+ r.advice ? `Advice: ${r.advice}` : "",
128
+ r.retry_hint ? `Retry: ${r.retry_hint}` : "",
129
+ (r.signals && r.signals.length) ? `Signals:\n- ${r.signals.join("\n- ")}` : "",
130
+ (r.evidence && r.evidence.length)
131
+ ? `Evidence:\n${r.evidence.map((e) => `- ${e.label}: ${e.detail}${e.url ? ` (${e.url})` : ""}`).join("\n")}`
132
+ : "",
133
+ r.disclaimer ? `Note: ${r.disclaimer}` : "",
134
+ r.settlement ? `Attestation (attach to your settlement): ${r.settlement.attestation_id} · verify: ${r.settlement.verify_url}` : "",
135
+ `Standard: ${r.standard || "https://oceanalt.com/en/rap"}`,
136
+ ].filter(Boolean);
137
+ return { content: [{ type: "text", text: lines.join("\n") }], structuredContent: r };
138
+ }
139
+ );
140
+
104
141
  // ── Paid (x402) tools ────────────────────────────────────────────────────────
105
142
  // Require a payer wallet private key (env OCEANALT_PAYER_KEY, 0x-prefixed) plus the on-demand deps
106
143
  // @x402/core @x402/evm viem. Like the official SDK: the MCP signs one EIP-3009 authorization; the
@@ -198,4 +235,4 @@ server.registerTool(
198
235
  const transport = new StdioServerTransport();
199
236
  await server.connect(transport);
200
237
  // Once connected, don't print to stdout (stdio transport owns it); diagnostics go to stderr.
201
- console.error(`[oceanalt-aml-mcp] v0.2 started, base = ${BASE}, paid tools ${PAYER_KEY ? "enabled" : "disabled (OCEANALT_PAYER_KEY not set — free tools only)"}`);
238
+ console.error(`[oceanalt-aml-mcp] v0.3 started, base = ${BASE}, paid tools ${PAYER_KEY ? "enabled" : "disabled (OCEANALT_PAYER_KEY not set — free tools only)"}`);