MCP.so
Sign In

CosmWasm MCP Server Template

@drewstaylor

About CosmWasm MCP Server Template

MCP server template for CosmWasm smart contract projects

Basic information

Category

Developer Tools

License

Apache-2.0

Runtime

rust

Transports

stdio

Publisher

drewstaylor

Config

No standard config provided

This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.

Repository

Tools

No tools detected

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is CosmWasm MCP Server Template?

A Rust-based MCP (Model Context Protocol) server template for wrapping CosmWasm contract query and execute entry point messages into formats that can be broadcast by a signer. It works with any CosmWasm contract and is intended for developers building MCP servers that enable AI agents to interact with on-chain contracts.

How to use CosmWasm MCP Server Template?

Requires Rust on the nightly channel. Adapt the template to your contract by updating Cargo.toml with your contract dependency, feature‑gating entry points, replacing imports in src/server.rs, and setting deployed contract addresses in src/contract.rs. Optionally customize LLM instructions, enable custom tool schemas, and choose a transport mode (stdio, SSE, or HTTP‑streamable). Build with cargo build --release. Connect to Claude Desktop via stdio, or to LangGraph via @langchain/mcp-adapters.

Key features of CosmWasm MCP Server Template

  • Wraps CosmWasm query and execute entry points
  • Generates JSON schemas for AI agents
  • Supports stdio, SSE, and HTTP‑streamable transports
  • Customizable LLM instructions and tool descriptions
  • Works with any CosmWasm contract via template adaptation
  • Provides 6 default MCP tools for contract interaction

Use cases of CosmWasm MCP Server Template

  • Building MCP servers for CosmWasm smart contracts
  • Enabling AI agents to query and transact with on‑chain contracts
  • Automating contract interactions in LangGraph or Claude Desktop
  • Creating custom tooling for marketplace, NFT, or multi‑contract systems

FAQ from CosmWasm MCP Server Template

What are the build requirements?

The server requires the Rust nightly build channel (edition 2024). Build with cargo build for development or cargo build --release for deployment.

How do I adapt the template to my own contract?

Update Cargo.toml with your contract’s dependency, ensure entry points are feature‑gated for library mode, replace the contract import in src/server.rs with your own QueryMsg and ExecuteMsg, and update the deployed contract addresses in src/contract.rs. Optional steps include enabling custom tool schemas and customizing LLM instructions.

What transport modes are supported?

Three transport modes are supported: stdio (default), SSE (Server‑Side Events), and HTTP‑streamable (a newer standard for remote MCP servers). The mode can be set in the server configuration.

How do I connect the server to Claude Desktop?

For stdio mode, set the command in claude_desktop_config.json to the path of the release binary. For WSL or VM setups, use the VM executable as the command and provide run arguments to the binary path.

How can I improve AI accuracy when using the server?

Add detailed doc comments (triple‑slash ///) to your contract’s QueryMsg and ExecuteMsg variants. The schemars crate emb

Comments

More Developer Tools MCP servers