An MCP client connects an AI application to an MCP server, discovers its tools, and sends arguments when those tools are invoked. This provides a consistent integration point for capabilities that may be backed by existing APIs, databases, or SDKs. section 9.6
The host manages one or more clients; each client communicates with a server. The host or agent decides when to call a tool, while the server runs it and returns the result through the client. MCP supports stdio connections between local processes and HTTP connections to remote servers. section 9.6.1 section 9.6.3
A DSPy client connects a ReAct agent to server tools in a few steps:
- Start the server over stdio and establish a client session. section 9.6.3
- Initialize the session, then request the server’s available tools and their schemas. section 9.6.3
- Convert discovered tools with dspy.Tool.from_mcp_tool() and give them to the ReAct agent; calls run asynchronously through the server. section 9.6.3
Figure 9.5 During initialization, the agent connects to the set of MCP servers that may be used by the host, creating a pool of MCP clients to communicate with them. Whenever the agent chooses to execute an MCP-based tool, the appropriate MCP client communicates with its server, passing the necessary arguments and collecting the tool’s output.
Shows how a host’s pool of clients connects to servers and routes tool calls. section 9.6.1







