rust-sdk/examples
2025-04-09 10:50:26 +08:00
..
clients Add Claude desktop quick start and update Cargo.toml of examples/servers, examples/clients (#94) 2025-04-05 13:07:31 +08:00
rig-integration fix(rig-integration): implement ToolEmbeddingDyn trait for McpToolAdaptor (#99) 2025-04-07 10:28:19 +08:00
servers fix(macro): add generics marco types support (#98) 2025-04-07 10:01:28 +08:00
transport fix(typo): nit language corrections (#90) 2025-04-04 12:20:48 +08:00
wasi fix(typo): nit language corrections (#90) 2025-04-04 12:20:48 +08:00
README.md Fix typo for Claude desktop config file path correction and add more example for Windows, Linux, and MacOS (#107) 2025-04-09 10:50:26 +08:00

Quick Start With Claude Desktop

  1. Build the Server (Counter Example)

    cargo build --release --example servers_std_io
    

    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_std_io.exe",
          "args": []
        }
      }
    }
    

    McOS/Linux

    {
      "mcpServers": {
        "counter": {
          "command": "PATH-TO/rust-sdk/target/release/examples/servers_std_io",
          "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.

  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

  • Client SSE, using reqwest and eventsource-client.
  • Client stdio, using tokio to spawn child process.
  • Everything, test with @modelcontextprotocol/server-everything
  • Collection, How to transpose service into dynamic object, so they will have a same type.

Server Examples

Transport Examples

Integration

  • Rig A stream chatbot with rig

WASI

Use Mcp Inspector

npx @modelcontextprotocol/inspector