一个使用自己的私钥与 Solana 区块链交互的 MCP 服务器,可实现获取最新槽、钱包地址及余额等功能,还能进行 SOL 转账。
本服务器可帮助你使用私钥与 Solana 区块链交互。下面将为你介绍设置及使用方法。
要通过 Smithery 自动安装 Solana MCP 对于 Claude 桌面版,可使用以下命令:
npx -y @smithery/cli install @Grandbusta/solana-mcp --client claude
git clone https://github.com/your-repository.git
npm install
npm run build
注意:在创建密钥对文件时,确保设置正确的 RPC 端点。默认情况下,使用 https://api.mainnet-beta.solana.com,但可以根据需要进行修改。
要将此服务器与 Cursor 集成,请按照以下步骤操作:
示例路径:
/path/to/your/solana-mcp-server
curl http://localhost:8080/api/latest-slot
curl --header "Content-Type: application/json" --request POST --data '{"name":"your-wallet-name"}' http://localhost:8080/api/wallet-address
curl --header "Content-Type: application/json" --request POST --data '{"address":"your-solana-address"}' http://localhost:8080/api/wallet-balance
curl --header "Content-Type: application/json" --request POST --data '{"from": "from-address", "to": "to-address", "amount": 1}' http://localhost:8080/api/transfer-sol
示例输出:
{
"blockhash": "最新区块哈希",
"slot": 12345,
"fee": 0.001 SOL,
"status": "success"
}
欢迎贡献!请打开问题或提交拉取请求。
本项目采用 WTFPL 许可证。