liveBook · Manning

MCP

As explained in Building LLM Applications with DSPy

Model Context Protocol is a standard protocol for connecting language-model applications with external tools and data sources.

Model Context Protocol (MCP) connects language-model applications with external tools and data sources. A host is the application the user interacts with; it manages MCP clients, which communicate with servers providing services. section 9.6.1

MCP supports two connection types:

  • stdio connects processes on the same machine, such as when using a local filesystem. section 9.6.1
  • HTTP connects remote machines to remote MCP servers. section 9.6.1
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.
figure

The diagram shows a host coordinating clients for multiple servers and routing tool calls through the appropriate client. section 9.6.1

How Building LLM Applications with DSPy covers it

How deep it goes
Defines host, client, server, and stdio/HTTP connections, stopping short of a broader protocol treatment.
Examples
Uses a host connected to three MCP servers and a server exposing WixQA retrieval methods.
What you can do after
Understand how a host uses clients to communicate with servers and execute tools.
How it connects
Links hosts, clients, servers, tools, stdio, and HTTP.

Also explained in

Compare how 14 books explain MCP →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building LLM Applications with DSPy. The section links point to the parts of the book it draws on.