CosmWasm MCP服务器
一个模型上下文协议(MCP)服务器,提供与CosmWasm智能合约交互的工具,使AI代理能够以编程方式管理和与基于区块链的合约交互。了解更多信息,请访问 模型上下文协议.
此MCP服务器是用Rust编写的,并使用 cw编排器 与CosmWasm智能合约进行交互。
开始
- 构建服务器(反例)
cargo build --release这将构建一个标准的输入/输出MCP服务器二进制文件。
- 在您的
PATH-TO/claude_desktop_config.json
视窗
{
"mcpServers": {
"cosmwasm-mcp": {
"command": "PATH-TO/rust-sdk/target/release/examples/cw-orch-mcp.exe",
"args": [],
"env": {
"TEST_MNEMONIC": "",
"RUST_LOG": "info"
}
}
}
}MacOS/Linux(~/Library/Application\ Support/Claude/claude_desktop_config.json)
{
"mcpServers": {
"cosmwasm-mcp": {
"command": "PATH-TO/rust-sdk/target/release/examples/cw-orch-mcp",
"args": [],
"env": {
"TEST_MNEMONIC": "",
"RUST_LOG": "info"
}
}
}
}- 确保MCP UI元素出现在Claude Desktop中
如果至少有一台服务器配置正确,MCP UI元素将仅显示在Claude for Desktop中。可能需要重新启动Claude for Desktop。
- Claude Desktop运行后,尝试聊天:
Please query `neutron14kjnjnmeyz2pzaa9ga50dnsu5dwr39q0jhnz50nwr6yyqdkg6ayqwfsur2` for `get_count`.Please increment `neutron14kjnjnmeyz2pzaa9ga50dnsu5dwr39q0jhnz50nwr6yyqdkg6ayqwfsur2`Please get the balance of neutron14kjnjnmeyz2pzaa9ga50dnsu5dwr39q0jhnz50nwr6yyqdkg6ayqwfsur2全部
- \[\]不要硬编码链,允许通过env传入或传入任何命令
- \[\]立即签订合同
