home / mcp / cosmwasm mcp server

CosmWasm MCP Server

Provides tools to interact with CosmWasm contracts via a local MCP server, enabling AI workflows to query and modify contract state.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "adairrr-cosmwasm-mcp": {
      "command": "PATH-TO/rust-sdk/target/release/examples/cw-orch-mcp.exe",
      "args": [],
      "env": {
        "RUST_LOG": "info",
        "TEST_MNEMONIC": "<24 word mnemonic>"
      }
    }
  }
}

You run a CosmWasm MCP Server to provide tools for interacting with CosmWasm smart contracts, enabling AI agents to manage and interact with blockchain-based contracts programmatically. This server is built in Rust and uses a specialized orchestrator to communicate with contracts, making it easy to query, increment, and inspect contract state from automation or AI workflows.

How to use

You enable the MCP UI in your desktop client by configuring at least one MCP server. After configuring, restart the client if needed to reveal the MCP features. Once running, you can chat with the MCP server to query a contract, trigger state changes, or fetch balances using simple commands.

How to install

Prerequisites: you need a Rust toolchain and a functional build environment.

Build the server binary for a standard input/output MCP server.

cargo build --release

Configuration examples

Configure the MCP server for your client by adding one or more MCP server entries. The following examples show Windows and MacOS/Linux configurations. Replace PATH-TO with the actual path to your built binary and provide your mnemonic.

{
  "mcpServers": {
    "cosmwasm_mcp_windows": {
      "command": "PATH-TO/rust-sdk/target/release/examples/cw-orch-mcp.exe",
      "args": [],
      "env": {
        "TEST_MNEMONIC": "<24 word mnemonic>",
        "RUST_LOG": "info"
      }
    }
  }
}
{
  "mcpServers": {
    "cosmwasm_mcp_unix": {
      "command": "PATH-TO/rust-sdk/target/release/examples/cw-orch-mcp",
      "args": [],
      "env": {
        "TEST_MNEMONIC": "<24 word mnemonic>",
        "RUST_LOG": "info"
      }
    }
  }
}

Other notes

The MCP UI elements appear in your client once at least one server is properly configured. You may need to restart the client for Desktop to recognize the MCP server.

Once the client is running, you can initiate conversations to query a contract, increment a value, or retrieve the balance associated with a contract.

Sample interactions

Query a contract count, increment a counter, or fetch a balance using natural language prompts within the MCP-enabled chat.

Available tools

buildServer

Compile the MCP server into a release binary using cargo build --release to produce the standard input/output MCP server.

startMCP

Run the MCP server binary via the configured command and arguments in your MCP client.

queryCount

Query the contract for its current count value to read state from the blockchain.

incrementCount

Send a command to increment a contract counter or similar numeric state.

getBalance

Query the contract balance for a given address or token.

CosmWasm MCP Server - adairrr/cosmwasm-mcp