#mcp #mcp-tool #llm #tool

mistralrs-mcp

MCP (Model Context Protocol) client for mistral.rs

6 releases

0.8.1 Apr 2, 2026
0.8.0 Apr 2, 2026
0.7.0 Jan 28, 2026
0.7.0-alpha.4 Jan 27, 2026

#876 in Development tools

Download history 94/week @ 2026-01-23 370/week @ 2026-01-30 386/week @ 2026-02-06 566/week @ 2026-02-13 1067/week @ 2026-02-20 1456/week @ 2026-02-27 2692/week @ 2026-03-06 2564/week @ 2026-03-13 2899/week @ 2026-03-20 1789/week @ 2026-03-27 2442/week @ 2026-04-03 1861/week @ 2026-04-10

9,622 downloads per month
Used in 26 crates (via mistralrs-core)

MIT license

105KB
1.5K SLoC

mistralrs-mcp

Model Context Protocol (MCP) client implementation for mistral.rs.

This crate provides a client library for connecting to MCP servers and integrating external tools with language models. It supports multiple transport protocols (HTTP, WebSocket, Process) and provides automatic tool discovery and registration.

Features

  • Multi-transport Support: HTTP, WebSocket, and Process-based connections
  • Automatic Tool Discovery: Discovers and registers tools from connected MCP servers
  • Bearer Token Authentication: Supports authentication for secured MCP servers
  • Concurrent Tool Execution: Handles multiple tool calls efficiently with configurable limits
  • Timeout Control: Configurable timeouts for individual tool calls
  • Resource Access: Access to MCP server resources like files and data

Usage

use mistralrs_mcp::{McpClient, McpClientConfig, McpServerConfig, McpServerSource};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let config = McpClientConfig {
        servers: vec![
            McpServerConfig {
                id: "web_search".to_string(),
                name: "Web Search MCP".to_string(),
                source: McpServerSource::Http {
                    url: "https://api.example.com/mcp".to_string(),
                    timeout_secs: Some(30),
                    headers: None,
                },
                enabled: true,
                tool_prefix: Some("web".to_string()),
                resources: None,
                bearer_token: Some("your-api-token".to_string()),
            },
        ],
        auto_register_tools: true,
        tool_timeout_secs: Some(30),
        max_concurrent_calls: Some(10),
    };
    
    let mut client = McpClient::new(config);
    client.initialize().await?;
    
    let tools = client.get_tools();
    println!("Discovered {} tools", tools.len());
    
    Ok(())
}

See the MCP Client documentation for more details.

Dependencies

~15–35MB
~417K SLoC