Provides comprehensive blockchain payment functionality including balance queries, secure transfers, transaction tracking, gas estimation, and wallet management across Ethereum mainnet and testnet networks
Enables blockchain payment operations on Polygon networks including mainnet and Amoy testnet, supporting native MATIC transfers and ERC20 token transactions
Supports blockchain operations on Solana mainnet and devnet for decentralized payment functionality
区块链支付MCP服务器
基于Base网络的区块链支付MCP(Model Context Protocol)服务器,提供完整的区块链支付功能。
🌟 功能特性
- 多网络支持: 支持多个测试网和主网,包括Base Sepolia、Base Mainnet、Ethereum Sepolia、Ethereum Mainnet等
- 代币支持: ETH、USDC、USDT、DAI、WETH等主流代币
- 余额查询: 查询任意地址的ETH和代币余额
- 安全转账: 支持ETH和ERC20代币转账
- 交易追踪: 实时查询交易状态和确认数
- Gas估算: 智能估算交易Gas费用
- 钱包管理: 创建新钱包、验证地址格式
- 安全限制: 内置交易金额限制和安全检查
🚀 快速开始
1. 安装MCP包
2. MCP配置文件
项目根目录的 mcp_config.json
文件已经配置好了MCP服务器:
3. 环境变量配置
在 mcp_config.json
中配置以下环境变量:
PRIVATE_KEY
: 你的私钥(用于发送交易)DEFAULT_NETWORK
: 默认网络(base_sepolia, ethereum_mainnet 等)DEBUG
: 调试模式(true/false)MAX_TRANSACTION_VALUE
: 最大交易金额限制
支持的MCP工具
余额和查询工具
- get_balance - 查询指定地址的余额
- 参数:
address
(必需),token_symbol
(可选),network
(可选)
- 参数:
- get_network_info - 获取当前网络信息
- 参数:
network
(可选)
- 参数:
- get_supported_tokens - 获取支持的代币列表
- 参数:
random_string
(必需,用于无参数工具)
- 参数:
- validate_address - 验证以太坊地址格式
- 参数:
address
(必需)
- 参数:
交易工具
- send_transaction - 发送代币转账交易
- 参数:
to_address
(必需),amount
(必需),token_symbol
(可选),network
(可选)
- 参数:
- get_transaction_status - 查询交易状态和详情
- 参数:
tx_hash
(必需),network
(可选)
- 参数:
- estimate_gas_fees - 估算Gas费用
- 参数:
to_address
(可选),amount
(可选),token_symbol
(可选),network
(可选)
- 参数:
钱包管理工具
- create_wallet - 创建新的钱包地址和私钥
- 参数:
label
(可选)
- 参数:
- set_user_wallet - 设置用户钱包私钥
- 参数:
private_key
(必需),label
(可选)
- 参数:
- list_wallets - 列出所有已添加的钱包
- 参数:
random_string
(必需)
- 参数:
- switch_wallet - 切换当前使用的钱包
- 参数:
label
(必需)
- 参数:
- remove_wallet - 移除指定标签的钱包
- 参数:
label
(必需)
- 参数:
支持的网络
base_sepolia
- Base Sepolia 测试网base_mainnet
- Base 主网ethereum_mainnet
- 以太坊主网ethereum_sepolia
- 以太坊 Sepolia 测试网bsc_mainnet
- BSC 主网bsc_testnet
- BSC 测试网polygon_mainnet
- Polygon 主网polygon_amoy
- Polygon Amoy 测试网avalanche_mainnet
- Avalanche 主网avalanche_fuji
- Avalanche Fuji 测试网solana_mainnet
- Solana 主网solana_devnet
- Solana 开发网
支持的代币
ETH
- 以太币USDC
- USD CoinUSDC_BASE
- Base 网络上的 USDCUSDC_BSC
- BSC 网络上的 USDCUSDC_POLYGON
- Polygon 网络上的 USDCDAI
- Dai 稳定币DAI_BASE
- Base 网络上的 DAIDAI_BSC
- BSC 网络上的 DAIDAI_POLYGON
- Polygon 网络上的 DAIWETH
- Wrapped EtherWETH_BASE
- Base 网络上的 WETH
本地下载代码
1. 安装依赖
2. 环境配置
3. 本地代码-配置MCP客户端
在Cursor的mcp.json
中添加:
4. 测试服务器
send_transaction
发送代币转账交易
参数:
to_address
: 接收方地址(必需)amount
: 转账金额(必需)token_symbol
: 代币符号(可选,默认"ETH")network
: 网络名称(可选)private_key
: 发送方私钥(可选,如未提供则使用环境变量)
示例:
get_transaction_status
查询交易状态
参数:
tx_hash
: 交易哈希(必需)network
: 网络名称(可选)
estimate_gas_fees
估算Gas费用
参数:
to_address
: 接收方地址(可选)amount
: 转账金额(可选)token_symbol
: 代币符号(可选)network
: 网络名称(可选)
create_wallet
创建新的钱包地址和私钥
参数: 无
get_network_info
获取当前网络信息
参数:
network
: 网络名称(可选)
get_supported_tokens
获取支持的代币列表
参数: 无
validate_address
验证以太坊地址格式
参数:
address
: 要验证的地址(必需)
🌐 支持的网络
Base Sepolia (测试网)
- Chain ID: 84532
- RPC: https://base-sepolia-rpc.publicnode.com
- 浏览器: https://sepolia.basescan.org
- 原生代币: ETH
Base Mainnet (主网)
- Chain ID: 8453
- RPC: https://base-rpc.publicnode.com
- 浏览器: https://basescan.org
- 原生代币: ETH
Ethereum Sepolia (测试网)
- Chain ID: 11155111
- RPC: https://ethereum-sepolia-rpc.publicnode.com
- 浏览器: https://sepolia.etherscan.io
- 原生代币: ETH
Ethereum Mainnet (主网)
- Chain ID: 1
- RPC: https://ethereum-rpc.publicnode.com
- 浏览器: https://etherscan.io
- 原生代币: ETH
BSC Testnet (测试网)
- Chain ID: 97
- RPC: https://bsc-testnet-rpc.publicnode.com
- 浏览器: https://testnet.bscscan.com
- 原生代币: BNB
BSC Mainnet (主网)
- Chain ID: 56
- RPC: https://bsc-rpc.publicnode.com
- 浏览器: https://bscscan.com
- 原生代币: BNB
Polygon Amoy (测试网)
- Chain ID: 80002
- RPC: https://polygon-amoy-rpc.publicnode.com
- 浏览器: https://amoy.polygonscan.com
- 原生代币: MATIC
Polygon Mainnet (主网)
- Chain ID: 137
- RPC: https://polygon-rpc.com
- 浏览器: https://polygonscan.com
- 原生代币: MATIC
Avalanche Fuji (测试网)
- Chain ID: 43113
- RPC: https://avalanche-fuji-c-chain-rpc.publicnode.com
- 浏览器: https://testnet.snowtrace.io
- 原生代币: AVAX
Avalanche Mainnet (主网)
- Chain ID: 43114
- RPC: https://avalanche-c-chain-rpc.publicnode.com
- 浏览器: https://snowtrace.io
- 原生代币: AVAX
🔒 安全特性
- 交易限制: 内置最大交易金额限制(默认10 ETH)
- 地址验证: 严格验证所有以太坊地址格式
- 私钥保护: 支持环境变量和可选私钥传入
- 错误处理: 完善的异常处理和错误信息
- 日志记录: 详细的操作日志和调试信息
🧪 测试
运行测试脚本验证功能:
测试包括:
- 配置加载测试
- 网络连接测试
- 钱包功能测试
- 地址验证测试
- Gas估算测试
📝 示例用法
在AI对话中使用
在测试链上进行操作
程序化使用
🔧 开发
项目结构
🧪 测试链支持
本系统支持在多个测试链上进行支付操作,包括:
- Ethereum Sepolia (ETH)
- Base Sepolia (ETH)
- BSC Testnet (BNB)
- Polygon Amoy (MATIC)
- Avalanche Fuji (AVAX)
获取测试代币
要获取测试链上的代币用于测试,请访问相应的水龙头:
- Ethereum Sepolia:
- Base Sepolia:
- BSC Testnet:
- Polygon Amoy:
- Avalanche Fuji:
测试链注意事项
- 测试链上的代币没有实际价值,仅用于开发和测试目的
- 测试链的Gas价格通常比主网低得多
- 不同测试链可能有不同的区块时间和确认时间
- 测试链可能会重置,导致测试资产丢失
🤝 贡献
欢迎提交Issue和Pull Request!
📄 许可证
MIT License
⚠️ 免责声明
本软件仅用于教育和开发目的。使用前请充分测试,作者不承担任何资金损失责任。在主网使用前请确保充分的安全测试。
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables blockchain payment operations across multiple networks including Base, Ethereum, BSC, Polygon, and Avalanche. Supports balance queries, token transfers, transaction tracking, wallet management, and gas fee estimation with built-in security limits.
Related MCP Servers
- AsecurityAlicenseAqualityFacilitates interaction with Ethereum blockchain data via Etherscan's API, providing real-time access to balances, transactions, token transfers, contract ABIs, gas prices, and ENS name resolutions.Last updated -626MIT License
- AsecurityAlicenseAqualityProvides Ethereum blockchain data tools via Etherscan's API, enabling users to check ETH balances, view transactions, track token transfers, fetch contract ABIs, monitor gas prices, and resolve ENS names.Last updated -61MIT License
- AsecurityAlicenseAqualityProvides tools for AI assistants to interact with the Ethereum blockchain through standard JSON-RPC methods, enabling queries for account balances, gas prices, and smart contract code.Last updated -310MIT License
- -securityFlicense-qualityA backend service that executes transactions across multiple blockchains, enabling users to manage wallets, transfer tokens, and interact with smart contracts using the Model Context Protocol framework.Last updated -1