
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.
概覽
對照制裁與威脅名單篩查 Solana 地址與交易,並透過支付閘道自動結算 x402 小額付款。
- 可以做什麼
- 篩查 Solana 地址是否命中制裁與威脅情報,回傳判定結果、風險分數與標記,每次呼叫都會自動協商並結算 x402 小額付款。為錢包地址或交易簽章產生不可竄改的合規報告,同一工作階段中未經即時篩查的識別碼會維持 UNSCREENED 狀態。查詢 x402 支付通道的狀態、限額與結算情形。
- 適用情境
- 適合助理在與某個錢包交易前需要隨選進行 Solana 合規檢查或產生稽核式報告,且呼叫端已設定好透過閘道按次支付 x402 小額費用。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js。它會連線遠端支付閘道,閘道位址與通道 ID 透過 X402_GATEWAY_URL 和 X402_CHANNEL_ID 環境變數設定。選用的 X402_PRIVATE_KEY_SEED 提供簽章金鑰材料,未設定時使用確定性的冒煙測試種子。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Solana X402 Compliance,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
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:
See package.json for the current version and metadata. The
package ships the compiled ESM dist/ bundle plus this README and the LICENSE.
Layout
Install & build
Run (stdio transport)
Environment variables:
X402_GATEWAY_URLandX402_CHANNEL_IDare injected by the MCP host (Claude Desktop, Cline, Smithery, etc.);X402_PRIVATE_KEY_SEEDis 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"), andlastSettlementBlock.
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,nullwhen unscreened),flags,sanctionsMatch,checkedLists([]when unscreened, otherwise["OFAC", "EU_SANCTIONS", "CHAIN_REPUTATION"]),lastEvaluated,evaluationTimestamp,timestamp, andreportId. The report fails closed: it references the session's in-memory screening ledger and returns"UNSCREENED"until the identifier has been live-screened viascreen_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:
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
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 matchsmoke-test.sh/ the JVMPaymentVoucherlayout.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 + callscreen_solana_address).
Live verification against the running stack
With the Docker stack up (docker compose up -d --build):
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
Windows
VS Code Cline
Add to cline_mcp_settings.json:
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版本歷史
1- v1.0.7最新Sep 23, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分