Back to Home
serenorg icon

x402-mcp-server

Verified Safe

by serenorg

Overview

Enables AI agents to pay for x402-protected database queries and API calls using USDC on the Base blockchain.

Installation

Run Command
npx @serendb/x402-mcp-server

Environment 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

Stats

Interest Score31
Security Score7
Cost ClassLow
Stars1
Forks1
Last Update2025-12-11

Tags

mcpx402paymentsusdcai-agents