Understanding the Model Context Protocol (MCP)

To Nha Notes | Aug. 31, 2025, 12:58 p.m.

From an architecture perspective, MCP is made of the following components:

  • MCP host: The AI application or environment that runs the LLM and facilitates communication. Examples include Claude Desktop, GitHub Copilot, and Cursor.
  • MCP server: An external service that exposes tools, resources, or prompts in a structured, discoverable format.
  • MCP client: A component inside the host that connects to one or more MCP servers. It handles protocol messaging and routing.

Unlike traditional clients that hardcode tool logic, MCP allows the LLM to choose which server to call based on user intent, enabled by JSON-RPC-based function calling.

Figure 8.3: MCP components

MCP uses JSON-RPC 2.0 to structure requests and responses. It supports multiple transports (including HTTP and STDIO), and MCP servers can even wrap traditional REST APIs, translating standardized MCP requests into custom backend logic.