rust-sdk/examples
2025-06-16 01:09:53 +08:00
..
clients fix: error for status in post method of streamable http client (#238) 2025-05-29 14:51:24 +08:00
rig-integration chore(deps): update rig-core requirement from 0.12.0 to 0.13.0 (#259) 2025-06-16 01:09:53 +08:00
servers refactor: provide http server as tower service (#228) 2025-05-28 19:21:40 +08:00
simple-chat-client chore(deps): update thiserror requirement from 1.0 to 2.0 (#208) 2025-05-21 11:17:16 +08:00
transport chore(deps): update rand requirement from 0.8 to 0.9 (#226) 2025-05-26 18:58:33 +08:00
wasi fix: build errors for WASI target (#151) 2025-05-09 01:51:16 +08:00
README.md doc: fix typos in examples readme (#256) 2025-06-13 09:05:44 +08:00

Quick Start With Claude Desktop

  1. Build the Server (Counter Example)

    cargo build --release --example servers_counter_stdio
    

    This builds a standard input/output MCP server binary.

  2. Add or update this section in your PATH-TO/claude_desktop_config.json

    Windows

    {
      "mcpServers": {
        "counter": {
          "command": "PATH-TO/rust-sdk/target/release/examples/servers_counter_stdio.exe",
          "args": []
        }
      }
    }
    

    MacOS/Linux

    {
      "mcpServers": {
        "counter": {
          "command": "PATH-TO/rust-sdk/target/release/examples/servers_counter_stdio",
          "args": []
        }
      }
    }
    
  3. Ensure that the MCP UI elements appear in Claude Desktop The MCP UI elements will only show up in Claude for Desktop if at least one server is properly configured. It may require to restart Claude for Desktop.

  4. Once Claude Desktop is running, try chatting:

    counter.say_hello
    

    Or test other tools like:

    counter.increment
    counter.get_value
    counter.sum {"a": 3, "b": 4}
    

Client Examples

see clients/README.md

Server Examples

see servers/README.md

Transport Examples

Integration

  • Rig A stream chatbot with rig
  • Simple Chat Client A simple chat client implementation using the Model Context Protocol (MCP) SDK.

WASI

Use Mcp Inspector

npx @modelcontextprotocol/inspector