- Explore MCP Servers
- mcp_client_rust
Mcp Client Rust
What is Mcp Client Rust
mcp_client_rust is a Rust SDK implementation of the Client for the Model Context Protocol (MCP), facilitating communication between AI models and their runtime environments.
Use cases
Use cases include managing resources in AI applications, invoking tools for processing data, and reading model outputs in a structured manner.
How to use
To use mcp_client_rust, you can create a client instance using the ClientBuilder, spawn a subprocess server, and interact with it using typed methods for resource management and tool calls.
Key features
Key features include easy server spawning, typed convenience methods for interacting with resources, and compliance with the MCP specification for error handling.
Where to use
mcp_client_rust can be used in AI development environments where seamless communication between AI models and their execution contexts is required.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Client Rust
mcp_client_rust is a Rust SDK implementation of the Client for the Model Context Protocol (MCP), facilitating communication between AI models and their runtime environments.
Use cases
Use cases include managing resources in AI applications, invoking tools for processing data, and reading model outputs in a structured manner.
How to use
To use mcp_client_rust, you can create a client instance using the ClientBuilder, spawn a subprocess server, and interact with it using typed methods for resource management and tool calls.
Key features
Key features include easy server spawning, typed convenience methods for interacting with resources, and compliance with the MCP specification for error handling.
Where to use
mcp_client_rust can be used in AI development environments where seamless communication between AI models and their execution contexts is required.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Model Context Protocol (MCP) Rust SDK
A Rust implementation of the Client of the Model Context Protocol (MCP), designed for seamless communication between AI models and their runtime environments.
Usage
Spawning the Server
The ClientBuilder allows you to spawn a subprocess server easily, attaching to its stdin and stdout.
Minimal Working Example:
use mcp_rust_sdk::client::ClientBuilder;
#[tokio::main]
async fn main() -> Result<()> {
let client = ClientBuilder::new("uvx")
.arg("notes-simple")
.spawn_and_initialize().await?;
Ok(())
}
Note this won’t work for any remote servers: they’re not running locally.
Remote server support is unplanned.
Spec Compliance
The servers used with this client should implement the protocol to specification.
Tool call responses error out if the wrong schema is used or the server returns an error.
Typed Convenience Methods
The Client provides typed methods to interact with the server:
list_resources() -> Result<ListResourcesResult, Error>call_tool(name, arguments) -> Result<CallToolResult, Error>read_resource(uri) -> Result<ReadResourceResult, Error>
For example:
let resources = client.list_resources().await?;
println!("Resources: {:?}", resources);
let tool_result = client.call_tool("add-note", serde_json::json!({
"name": "my_first_note",
"content": "This is some note content."
})).await?;
println!("Tool result: {:?}", tool_result);
let read_result = client.read_resource("note://internal/my_first_note").await?;
println!("Read resource: {:?}", read_result);
Contributing
Contributions are welcome! Please open an issue or submit a PR if you have improvements, bug fixes, or new features to propose.
- Fork the repo
- Create a new branch
- Add your changes and tests
- Submit a Pull Request
Please @ darinkishore in the PR if you do send one over.
Credits
License
This project is licensed under the MIT License. See LICENSE for details.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










