Skip to main content

Crate fastmcp_client

Crate fastmcp_client 

Source
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.
ClientBuilder
Builder for configuring an MCP client.
ClientSession
Client-side session state.

Type Aliases§

ProgressCallback
Callback for receiving progress notifications during tool execution.