Expand description
MCP client implementation for FastMCP.
This crate provides the client-side implementation:
- Client builder pattern
- Tool invocation
- Resource reading
- Prompt fetching
§Example
ⓘ
use fastmcp_rust::Client;
let client = Client::stdio("uvx", &["my-mcp-server"]).await?;
// List tools
let tools = client.list_tools().await?;
// Call a tool
let result = client.call_tool("greet", json!({"name": "World"})).await?;§Role in the System
fastmcp-client is the companion client to fastmcp-server. It uses
the same protocol models and transport layer to:
- Spawn MCP servers as subprocesses (stdio)
- Initialize sessions and negotiate capabilities
- Call tools, read resources, and fetch prompts
If you are embedding FastMCP into a larger application (e.g. testing, orchestration, or local agent tooling), this is the crate that drives the client side of the protocol.
Modules§
- mcp_
config - MCP Configuration file support for server registry.
Structs§
- Client
- An MCP client instance.
- Client
Builder - Builder for configuring an MCP client.
- Client
Session - Client-side session state.
Type Aliases§
- Progress
Callback - Callback for receiving progress notifications during tool execution.