使用说明
🚀 Monad MCP服务器
MCP(Monad Control Panel)服务器,用于提供Monad Testnet网络中钱包的详细信息。该项目允许您通过API轻松检索余额和代币的数据。
📋 特性
服务器提供对以下信息的访问:
- 💰 原生代币余额(MONAD)
- 🪙 ERC-20代币余额
- 📊 一般钱包信息
- ⚠️ 令牌错误分析
🛠️ 技术
⚙️ 安装和运行
先决条件
- Node.js v16或更新版本
- npm或纱线
- 连接到Monad测试网的互联网接入
安装步骤
# Clone the repository
git clone https://github.com/LOFT228/Monad-MCP-Server.git
cd Monad-MCP-Server
# Install dependencies
npm install
# Start the server
npm start
对于自动重新加载的开发:
npm run dev
🌐 API终点
首页
GET /
返回有关服务器和可用终结点的常规信息。
钱包信息
GET /wallet/:address
返回有关钱包的完整信息,包括本地令牌余额和所有已知的ERC-20令牌。
本地代币余额
GET /wallet/:address/balance
仅返回本机令牌余额(MONAD)。
特定代币余额
GET /wallet/:address/token/:tokenAddress
返回指定钱包中特定ERC-20代币的信息。
📝 示例响应
{
"address": "0x418bF6023b30c53072bcDcc653d6e14C20ba569F",
"nativeBalance": {
"symbol": "MONAD",
"name": "Monad",
"balance": "0.121916140766047236",
"rawBalance": "121916140766047236",
"decimals": 18
},
"tokens": [
// List of ERC-20 tokens if they exist in the wallet
],
"tokenErrors": [
// Information about errors when trying to retrieve token data
]
}
⚙️ 配置
服务器设置位于 config.js 文件。在那里,您可以更改:
- 服务器端口
- 用于连接到Monad测试网的RPC URL
- 已知令牌列表
module.exports = {
PORT: 8080,
MONAD_RPC_URL: 'https://testnet-rpc.monad.xyz/',
TOKENS: {
// Add real token contracts here
'TOKEN_NAME': 'TOKEN_CONTRACT_ADDRESS'
}
};
🔍 项目结构
mcp-monad/
├── config.js # Project configuration
├── index.js # Main server file
├── package.json # Dependencies and scripts
├── utils/ # Utilities
│ └── blockchain.js # Functions for working with blockchain
└── routes/ # API routes
└── wallet.js # Routes for wallet operations
🔮 未来改进
- []添加NFT令牌支持
- []实现请求缓存以提高性能
- []创建用于显示信息的web界面
- []添加钱包交易分析功能
- []实现钱包更改通知
🤝 贡献
我们始终欢迎对该项目的贡献!如果你有改进的想法:
- 分叉项目
- 为您的功能创建分支(
git checkout -b feature/amazing-feature) - 提交您的更改(
git commit -m 'Add some amazing feature') - 推动更改(
git push origin feature/amazing-feature) - 打开拉取请求
📄 许可证
此项目在ISC许可证下分发。请参阅 LICENSE 文件以获取更多信息。
📬 联系
LOFT228- @github
项目链接: https://github.com/LOFT228/Monad-MCP-Server
Created with ❤️ for the Monad community
