使用说明
Monad MCP
MCP(模型上下文协议)服务器,用于与Monad区块链交互,提供令牌管理、合同部署等工具。
支持的工具
| 工具名称 | 描述 | 参数 |
|---|---|---|
get-wallet-address |
获取钱包地址 | 无 |
get-mon-balance |
获取MON代币余额 | checkOwnBalance:布尔值, address:string(可选) |
disperse-tokens |
将令牌分散到多个地址 | tokenAddress:字符串, recipients:{地址,金额}数组, useEqualAmounts:boolean(可选) |
disperse-mon |
将MON令牌分散到多个地址 | recipients:{地址,金额}数组, useEqualAmounts:boolean(可选) |
compile-contract |
编制Solidity合同 | contractCode:字符串, contractName:string |
deploy-contract |
将合约部署到Monad测试网 | contractName:字符串, bytecode:字符串, abi:字符串, constructorArgs:数组(可选), gasLimit:数字(可选) |
generate-sdk |
为已部署的合约生成SDK | contractAddress:字符串, contractName:字符串, abi:字符串, sdkName:string(可选), language:string(可选), includeExamples:boolean(可选) |
transfer-mon |
将MON代币转移到另一个地址 | to:字符串, amount:字符串, gasLimit:数字(可选) |
需求
入门指南
- 克隆此存储库
git clone https://github.com/AnasAli30/monad-mcp-server.git
- 安装依赖项
npm install
构建项目
npm run build
将MCP服务器添加到Claude Desktop
- 打开“克劳德桌面”
- 打开设置(Claude>设置>开发人员)
- 单击编辑配置并打开
claude_desktop_config.json - 添加有关MCP服务器的详细信息并保存文件
{
"mcpServers": {
"monad-mcp": {
"command": "node",
"args": [
"<absolute-path-to-project>/build/index.js"
],
"env": {
"PRIVATE_KEY": "",
"RPC_URL": "https://monad-testnet.g.alchemy.com/v2/your-api-key"
}
}
}
}
添加您的私钥(前缀为0x)。
您还可以添加自己的RPC,或将其留空以使用默认RPC。
- 重新启动“克劳德桌面”
使用示例
获取MON余额
{
checkOwnBalance: true
}
分散MON代币
{
recipients: [
{ address: "0x...", amount: "1.0" },
{ address: "0x...", amount: "2.0" }
],
useEqualAmounts: false
}
部署合约
{
contractName: "MyContract",
bytecode: "0x...",
abi: "[...]",
constructorArgs: ["arg1", "arg2"],
gasLimit: 3000000
}
生成SDK
{
contractAddress: "0x...",
contractName: "MyContract",
abi: "[...]",
language: "typescript",
includeExamples: true
}
贡献
欢迎投稿!请随时提交拉取请求。
许可证
此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。
