Solana X402 Compliance

io.github.msantagiulianab由 GitHub 账号 msantagiulianab 发布v1.0.7更新于 Oct 25, 2026

RFC 9110 x402 Solana compliance screening and micropayments gateway for AI agents.

已验证STDIO仅桌面金融安全与监控

概览

AI 生成的概览

对照制裁与威胁名单筛查 Solana 地址和交易,并通过支付网关自动结算 x402 小额支付。

可以做什么
筛查 Solana 地址是否命中制裁与威胁情报,返回判定结果、风险评分和标记,每次调用都会自动协商并结算 x402 小额支付。为钱包地址或交易签名生成不可篡改的合规报告,同一会话中未经实时筛查的标识会保持 UNSCREENED 状态。查询 x402 支付通道的状态、限额与结算情况。
适用场景
适合助手在与某个钱包交易前需要按需进行 Solana 合规检查或生成审计式报告,且调用方已配置好通过网关按次支付 x402 小额费用。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js。它会连接远程支付网关,网关地址和通道 ID 通过 X402_GATEWAY_URL 和 X402_CHANNEL_ID 环境变量设置。可选的 X402_PRIVATE_KEY_SEED 提供签名密钥材料,未设置时使用确定性的冒烟测试种子。
安装前请注意
每次筛查都会结算真实的 USDC x402 小额支付,调用会花钱。签名种子(X402_PRIVATE_KEY_SEED)属于密钥材料,除测试外不应保留公开的默认值。地址和交易签名会发送到远程网关。报告保存在内存会话账本中,未筛查前按失败关闭原则返回 UNSCREENED。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Solana X402 Compliance,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

x402 MCP Server

A lightweight, zero-bloat Model Context Protocol (MCP) server that exposes the Solana Enterprise Payment Gateway's POST /api/v1/compliance/screen-address endpoint as an autonomous tool for AI agents (Claude Desktop, Cursor, VS Code Cline, ElizaOS).

The agent transparently negotiates and settles the x402 micro-payment on every screen: it receives the HTTP 402 Payment Required challenge, signs an Ed25519 channel voucher in-memory (Node.js built-in crypto, no Web3 SDK), and retries with a PAYMENT-SIGNATURE header.

Standalone npm package

The server is published to the npm registry as a standalone package — no clone or build step is required to run it:

bash
npx -y @msantagiulianab/x402-mcp-server

See package.json for the current version and metadata. The package ships the compiled ESM dist/ bundle plus this README and the LICENSE.

Layout

agent-tools/mcp-server/├── src/│   ├── base58.ts          # zero-dependency Base58 codec│   ├── ed25519.ts         # Node crypto Ed25519 keypair + canonical payload│   ├── x402-client.ts     # autonomous X402Client (402 -> sign -> retry)│   └── index.ts           # MCP server + tool registration├── test/                  # offline unit + stdio integration tests├── test-agent-call.js     # live verification against the running Docker stack├── package.json├── smithery.yaml          # Smithery registry manifest└── tsconfig.json

Install & build

bash
cd agent-tools/mcp-servernpm installnpm run build          # tsc -> dist/ (ESM)

Run (stdio transport)

bash
npx -y @msantagiulianab/x402-mcp-server   # published package# or, from a local checkout:npm start# or: node dist/index.js

Environment variables:

VariableDefaultPurpose
X402_GATEWAY_URLhttps://msb-solana-enterprise-payment-gateway.duckdns.orgGateway root URL
X402_CHANNEL_IDchan_smoke_test_001x402 payment channel id
X402_PRIVATE_KEY_SEEDsha256 of smoke-test-payer-seed-v164-hex or UTF-8 material seed

X402_GATEWAY_URL and X402_CHANNEL_ID are injected by the MCP host (Claude Desktop, Cline, Smithery, etc.); X402_PRIVATE_KEY_SEED is optional and defaults to the deterministic smoke-test payer.

The tool screen_solana_address:

  • Description: Inspect a Solana address against sanctions and threat intelligence databases. Automatically negotiates and settles micro-payments via x402.
  • Input: address — a valid Base58 Solana public key (decodes to 32 bytes).
  • Output: formatted JSON text containing verdict, riskScore, flags, and the evaluation timestamp.

The tool get_channel_status:

  • Description: Retrieve current operational status, limits, and settlement state of a given x402 payment channel.
  • Input: channel_id — the unique identifier of the payment channel.
  • Output: formatted JSON text containing status ("ACTIVE"), currency ("USDC"), network ("solana-devnet"), capacity ("10000.00"), and lastSettlementBlock.

The tool generate_compliance_report:

  • Description: Generate an immutable audit summary report for a Solana wallet address or transaction signature against sanctions and threat intelligence logs.
  • Input: identifier — a Solana wallet address (32-byte Base58) or a transaction signature (64-byte Base58).
  • Output: formatted JSON text containing complianceStatus ("PASSED" | "FLAGGED" | "UNSCREENED"), riskScore (a number for screened identifiers, null when unscreened), flags, sanctionsMatch, checkedLists ([] when unscreened, otherwise ["OFAC", "EU_SANCTIONS", "CHAIN_REPUTATION"]), lastEvaluated, evaluationTimestamp, timestamp, and reportId. The report fails closed: it references the session's in-memory screening ledger and returns "UNSCREENED" until the identifier has been live-screened via screen_solana_address.

Architecture & Sync Workflow

This component is one of three independently deployable surfaces in the repository. Changes flow differently depending on where they live:

Where the change livesSync / deploy action
Java backend (src/main/...)Push to GitHub, then git pull on the Hetzner VPS to rebuild/restart the container or jar.
MCP server (agent-tools/mcp-server/src/...)Bump version in package.json, then npm publish.
Documentation / smithery.yaml (README.md, smithery.yaml)Push to GitHub only — no VPS reload and no npm publish required.

The backend and the MCP server deploy independently: a Java change does not require an npm publish, and an MCP change does not require a VPS reload. Documentation and registry metadata (smithery.yaml) ship purely via GitHub.

smithery.yaml

smithery.yaml is the Smithery registry manifest. It declares the stdio startCommand (npx -y @msantagiulianab/x402-mcp-server) and exposes two configurable fields — gatewayUrl and channelId — which map onto the X402_GATEWAY_URL and X402_CHANNEL_ID environment variables. Updating it only requires a GitHub push; the Smithery registry indexes it directly from the repository.

Tests

bash
npm test

This compiles the project and runs:

  • base58.test.js — Base58 codec round-trips and 32-byte address validation.
  • ed25519.test.js — golden-vector check that the canonical payload and Ed25519 signature exactly match smoke-test.sh / the JVM PaymentVoucher layout.
  • x402-client.test.js — full 402→sign→retry negotiation against a mock gateway, with independent Ed25519 signature verification of the emitted voucher.
  • mcp-server.test.js — spawns the real server and drives it with an MCP client over stdio (list tools + call screen_solana_address).

Live verification against the running stack

With the Docker stack up (docker compose up -d --build):

bash
npm run test:tool

This exercises the tool handler against http://localhost:8080:

  • Clean address 4Nd1mBQtrMJVYVfKf2PJy9NZGibCcTRxpETqdrBHu19Y → CLEAR_TO_TRANSACT.
  • Flagged address Fc1EwQUZyTEagaDvA1utHXCcZNyG1x2PLt2DfNu1cJdH → BLOCKED.

Client configuration

Claude Desktop

Add to claude_desktop_config.json:

macOS / Linux

json
{  "mcpServers": {    "solana-x402-compliance": {      "command": "npx",      "args": ["-y", "@msantagiulianab/x402-mcp-server"],      "env": {        "X402_GATEWAY_URL": "https://msb-solana-enterprise-payment-gateway.duckdns.org",        "X402_CHANNEL_ID": "chan_smoke_test_001"      }    }  }}

Windows

json
{  "mcpServers": {    "solana-x402-compliance": {      "command": "cmd",      "args": ["/c", "npx", "-y", "@msantagiulianab/x402-mcp-server"],      "env": {        "X402_GATEWAY_URL": "https://msb-solana-enterprise-payment-gateway.duckdns.org",        "X402_CHANNEL_ID": "chan_smoke_test_001"      }    }  }}

VS Code Cline

Add to cline_mcp_settings.json:

json
{  "mcpServers": {    "solana-x402-compliance": {      "command": "npx",      "args": ["-y", "@msantagiulianab/x402-mcp-server"],      "env": {        "X402_GATEWAY_URL": "https://msb-solana-enterprise-payment-gateway.duckdns.org",        "X402_CHANNEL_ID": "chan_smoke_test_001"      }    }  }}

Cursor

Add an MCP server entry (Settings → MCP) pointing at the same npx -y @msantagiulianab/x402-mcp-server command with the environment variables above.

ElizaOS

Register a stdio-based MCP client plugin using the same npx -y @msantagiulianab/x402-mcp-server command; the tool screen_solana_address becomes callable by the agent.

来源:agent-tools/mcp-server/README.md,提交 6b2749f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.7最新Sep 23, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分