x402-mcp-server
Verified Safeby serenorg
Overview
Enables AI agents to pay for x402-protected database queries and API calls using USDC on the Base blockchain.
Installation
npx @serendb/x402-mcp-serverEnvironment Variables
- X402_GATEWAY_URL
- WALLET_PRIVATE_KEY
- BASE_RPC_URL
- WALLET_TYPE
- WALLETCONNECT_PROJECT_ID
- NODE_ENV
- LOG_LEVEL
Security Notes
The server uses environment variables (`WALLET_PRIVATE_KEY`, `WALLETCONNECT_PROJECT_ID`) for sensitive configurations, which is good practice to avoid hardcoding. However, the default and recommended setup in the `src/index.ts` uses `PrivateKeyWalletProvider`, which explicitly states it's 'NOT recommended for production' due to its reliance on a private key directly in environment variables. While it's suitable for development, this introduces a significant security risk if used carelessly in a production environment. Input validation for `sql` queries is basic (`startsWith('SELECT')`), delegating full SQL injection protection to the upstream x402 gateway. The server's core function involves EIP-712 signing, which relies on the security of the `viem` library and the provided private key/WalletConnect setup.
Similar Servers
solana-mcp-server
A Solana MCP (Multi-Chain Protocol) server that acts as a proxy for Solana RPC requests, offering enhanced capabilities like caching, metrics, and local sBPF program testing and management.
solx402-mcp-server
The SOLx402 MCP Server enables AI assistants to interact with the x402 payment protocol on Solana, providing tools for service discovery, consumption, USDC payments, and access to Solana development resources.
mcp-x402
Generates X402 payment headers and looks up associated wallet addresses for internet-native payments using the Model Context Protocol.
x402-mcp-server
Enables native x402 payments for AI agents via a Spring Boot server, exposing payment operations as MCP tools.