paean-pay-mcp

paean-pay-mcp

Enables AI agents to send and receive USDC stablecoin payments on Base and Solana blockchains through MCP tools for wallet operations, balance checks, payment requests, and transfers.

Category
访问服务器

README

paean-pay-mcp

Stablecoin payment MCP server — USDC on Base & Solana for AI agents.

⚠ AI-Generated Software — Use at Your Own Risk

This software was generated with AI assistance. It has not been independently audited for security vulnerabilities. Use of this software for handling real funds is entirely at your own risk. The authors and contributors accept no liability for any loss of funds, security breaches, or damages resulting from use of this software. Before using with real wallets or mainnet assets, you should conduct your own security review or engage a professional auditor.

npm version license

Give your AI agent economic sovereignty: accept payments for services, pay for external APIs, and transact with other agents — all through standard MCP tool calls.

Quick Start

No install needed — run directly with npx or bunx:

npx paean-pay-mcp
# or
bunx paean-pay-mcp

The server communicates via stdio and is compatible with any MCP client: PaeanClaw, OpenPaean CLI, Claude Desktop, Cursor, and more.

Why This Exists

AI agents need to transact. Whether your agent charges users for a service, pays for external API calls, or settles with other agents, it needs a payment rail that is:

  • Fast — sub-second (Solana) to 2-second (Base) finality
  • Cheap — fractions of a cent per transaction
  • Programmable — no bank APIs, no KYC for agent-to-agent transfers
  • Stablecoin-native — USDC avoids crypto volatility

This MCP server wraps both chains behind a clean set of 7 tools that any LLM agent can call.

Supported Chains

Chain Token Tx Cost Finality Best For
Base (Coinbase L2) USDC < $0.01 ~2s General payments, EVM ecosystem
Solana USDC < $0.001 ~400ms High-frequency micro-payments

Configuration

All configuration is via environment variables, passed through your MCP client config.

Wallet Configuration

The server supports two wallet modes. Private keys take precedence — if both a private key and a mnemonic are set for the same chain, the private key is used.

Option A: Private Keys (direct)

Set a separate private key per chain. Best for agents with dedicated hot-wallets.

PAYMENT_PRIVATE_KEY_BASE=0xabc...    # Hex private key for Base (EVM)
PAYMENT_PRIVATE_KEY_SOLANA=5Kb8...   # Base58 private key for Solana

Option B: Mnemonic (HD wallet)

Set a single BIP-39 mnemonic phrase to derive wallets for both chains. Compatible with Phantom, MetaMask, and other HD wallets.

PAYMENT_MNEMONIC="abandon abandon abandon ... about"     # 12 or 24 words
PAYMENT_HD_PATH_BASE="m/44'/60'/0'/0/0"                   # optional, default shown
PAYMENT_HD_PATH_SOLANA="m/44'/501'/0'/0'"                  # optional, default shown

Default derivation paths:

  • Base (EVM): m/44'/60'/0'/0/0 — standard Ethereum/MetaMask path (first account)
  • Solana: m/44'/501'/0'/0' — standard Phantom/Solflare path (first account)

To use a different account index, change the last number, e.g. m/44'/60'/0'/0/1 for the second Base account.

Mixing modes

You can use a private key for one chain and a mnemonic for the other:

PAYMENT_PRIVATE_KEY_BASE=0xabc...                          # direct key for Base
PAYMENT_MNEMONIC="abandon abandon abandon ... about"       # mnemonic for Solana

Environment Variables

Variable Required Default Description
PAYMENT_PRIVATE_KEY_BASE For sending† Hex private key for Base wallet
PAYMENT_PRIVATE_KEY_SOLANA For sending† Base58 private key for Solana wallet
PAYMENT_MNEMONIC For sending† BIP-39 mnemonic phrase (12 or 24 words)
PAYMENT_HD_PATH_BASE No m/44'/60'/0'/0/0 HD derivation path for Base wallet
PAYMENT_HD_PATH_SOLANA No m/44'/501'/0'/0' HD derivation path for Solana wallet
PAYMENT_RPC_URL_BASE No https://mainnet.base.org Custom Base RPC endpoint
PAYMENT_RPC_URL_SOLANA No https://api.mainnet-beta.solana.com Custom Solana RPC endpoint
PAYMENT_NETWORK No mainnet mainnet or testnet
PAYMENT_DEFAULT_CHAIN No base Default chain: base or solana

† At least one of PAYMENT_PRIVATE_KEY_* or PAYMENT_MNEMONIC is needed to send USDC. Without any wallet, the server runs in read-only mode (balance checks, transaction lookups, payment request tracking).

Testnet mode: Set PAYMENT_NETWORK=testnet to use Base Sepolia and Solana Devnet. Get test USDC from Circle's faucet.

Tools

get_wallet_address

Returns the configured wallet address(es) for the agent.

Input:

Parameter Type Required Description
chain "base" | "solana" No Specific chain. Omit for all chains.

Output: Wallet address(es) for the configured chains.


get_usdc_balance

Check the USDC balance for any wallet address.

Input:

Parameter Type Required Description
address string No Address to check. Defaults to the agent's own wallet.
chain "base" | "solana" No Chain to check. Defaults to PAYMENT_DEFAULT_CHAIN.

Output: Balance in human-readable format (e.g. "42.50") plus raw integer.


create_payment_request

Create a payment request with a unique ID. The agent presents the payment details to the payer, then uses check_payment_status to verify receipt.

Input:

Parameter Type Required Description
amount string Yes USDC amount, e.g. "5.00"
chain "base" | "solana" No Chain to receive on
memo string No Note for the payment
expires_in_minutes number No Expiry (default: 30 minutes)

Output: Payment ID, recipient address, amount, memo, expiry, and human-readable instructions.


check_payment_status

Poll the blockchain to check if a payment request has been fulfilled.

Input:

Parameter Type Required Description
payment_id string Yes The payment request ID

Output: Status (pending, confirmed, or expired), and transaction details if confirmed.


send_usdc

Execute a USDC transfer to a target address. Requires a private key.

Input:

Parameter Type Required Description
to string Yes Recipient address
amount string Yes USDC amount, e.g. "10.00"
chain "base" | "solana" No Chain to send on

Output: Transaction hash, explorer URL, and transfer details.


get_transaction_status

Look up any transaction by hash.

Input:

Parameter Type Required Description
tx_hash string Yes Transaction hash
chain "base" | "solana" No Chain the tx is on

Output: Confirmation status, block number, timestamp, from/to/amount if available.


list_payment_requests

List all tracked payment requests from this session.

Input:

Parameter Type Required Description
status "pending" | "confirmed" | "expired" No Filter by status
chain "base" | "solana" No Filter by chain

Output: Array of payment requests with their current status.

Integration

PaeanClaw

Add to your paeanclaw.config.json:

{
  "mcpServers": {
    "payment": {
      "command": "npx",
      "args": ["-y", "paean-pay-mcp"],
      "env": {
        "PAYMENT_PRIVATE_KEY_BASE": "${BASE_PRIVATE_KEY}",
        "PAYMENT_PRIVATE_KEY_SOLANA": "${SOLANA_PRIVATE_KEY}",
        "PAYMENT_NETWORK": "mainnet"
      }
    }
  }
}

Or use a mnemonic to derive both wallets from one seed:

{
  "mcpServers": {
    "payment": {
      "command": "npx",
      "args": ["-y", "paean-pay-mcp"],
      "env": {
        "PAYMENT_MNEMONIC": "${WALLET_MNEMONIC}",
        "PAYMENT_NETWORK": "mainnet"
      }
    }
  }
}

Then customize your AGENT.md to instruct the agent on when to charge:

## Payment Policy

You are a paid assistant. Before answering premium questions, create a payment
request for $0.10 USDC on Base. Wait for the user to pay, verify the payment
using check_payment_status, then proceed with the answer.

OpenPaean CLI

Add to ~/.openpaean/mcp_config.json (global) or .openpaean/mcp.json (project):

{
  "mcpServers": {
    "payment": {
      "command": "npx",
      "args": ["-y", "paean-pay-mcp"],
      "env": {
        "PAYMENT_PRIVATE_KEY_BASE": "0x...",
        "PAYMENT_NETWORK": "mainnet"
      }
    }
  }
}

Claude Desktop

Add to your Claude Desktop MCP config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "payment": {
      "command": "npx",
      "args": ["-y", "paean-pay-mcp"],
      "env": {
        "PAYMENT_PRIVATE_KEY_BASE": "0x...",
        "PAYMENT_NETWORK": "testnet"
      }
    }
  }
}

Cursor

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "payment": {
      "command": "npx",
      "args": ["-y", "paean-pay-mcp"],
      "env": {
        "PAYMENT_PRIVATE_KEY_BASE": "0x..."
      }
    }
  }
}

Any MCP Client

The server uses stdio transport. Configure it the same way you would any other MCP server:

command: npx
args: ["-y", "paean-pay-mcp"]
env: { PAYMENT_PRIVATE_KEY_BASE: "0x...", PAYMENT_NETWORK: "mainnet" }

Example Workflows

Agent Charges for a Service

User: "Translate this document to Japanese"
Agent: → create_payment_request(amount: "2.00", chain: "base", memo: "translation-service")
Agent: "Please send 2.00 USDC to 0xABC...123 on Base. Payment ID: a1b2c3d4"
User: *sends payment*
Agent: → check_payment_status(payment_id: "a1b2c3d4")
Agent: "Payment confirmed! Here's your translation: ..."

Agent Pays for an External API

User: "Get me the latest market analysis"
Agent: → send_usdc(to: "0xDEF...789", amount: "0.50", chain: "base")
Agent: "Paid 0.50 USDC for premium market data. Here's the analysis: ..."

Agent-to-Agent Payment

Agent A: → send_usdc(to: "SOLANA_ADDRESS", amount: "1.00", chain: "solana")
Agent B: → check_payment_status(payment_id: "...")
Agent B: "Payment received. Processing your request..."

Security

  • Private keys and mnemonics are passed via environment variables and never logged or exposed through tool outputs
  • When using a mnemonic, derived private keys exist only in memory and are never persisted
  • Never commit private keys or mnemonics to version control. Use environment variables or a secrets manager.
  • Read-only by default — without any wallet configured, no funds can be sent
  • In-memory store — payment request tracking is ephemeral; restarting clears all state
  • Use testnet (PAYMENT_NETWORK=testnet) for development and testing

USDC Contract Addresses

Network Chain Address
Mainnet Base 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Mainnet Solana EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Testnet Base Sepolia 0x036CbD53842c5426634e7929541eC2318f3dCF7e
Testnet Solana Devnet 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU

Development

git clone https://github.com/paean-ai/paean-pay-mcp.git
cd paean-pay-mcp
npm install
npm run build
PAYMENT_NETWORK=testnet node dist/index.js

Test with the MCP Inspector:

npx @modelcontextprotocol/inspector node dist/index.js

Requirements

  • Node.js 20+ or Bun 1.0+

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选