rust-sdk/examples
Repository files (latest commit first)
Filename Latest commit message Latest commit date
jokemanfire 3196c95f1d
chore(deps): update schemars requirement from 0.8 to 1.0 (#258)
* chore(deps): update schemars requirement from 0.8 to 0.9

* fix: adapt the new openApi structure

* fix : fix the shemar deps in example
2025-07-11 11:15:45 +08:00
..
clients feat: unified error type (#308) 2025-07-09 11:23:39 +08:00
rig-integration feat(examples): add streamable HTTP section in configs (#296) 2025-07-03 11:07:28 +08:00
servers chore(deps): update schemars requirement from 0.8 to 1.0 (#258) 2025-07-11 11:15:45 +08:00
simple-chat-client feat(examples): add streamable HTTP section in configs (#296) 2025-07-03 11:07:28 +08:00
transport chore(deps): update schemars requirement from 0.8 to 1.0 (#258) 2025-07-11 11:15:45 +08:00
wasi chore: release v0.2.0 (#300) 2025-07-02 14:50:51 -04:00
README.md docs: fix broken links in example readme (#273) 2025-06-20 09:42:48 +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