Skip to content
LinkedInX

MCP Architecture

About 5 minutes

MCP is built on a client-server architecture. This architecture has three distinct roles: the Host (AI application), the Client (communication component), and the Server (tool-providing program).[1] Clear separation of these roles enables scalability and reusability.

The following diagram shows the communication flow in MCP:

graph LR
    U[User] --> H[Host\nClaude Desktop / Cursor]
    H --> C[Client\nMCP Client]
    C --> S1[Server A\nWeather MCP Server]
    C --> S2[Server B\nFile System\nMCP Server]
    S1 --> T1[Weather API]
    S2 --> T2[Local\nFiles]

The user sends instructions to the Host. The Host communicates with MCP servers through the Client to retrieve tools and information, then generates a response.

The Host is the AI application that faces the user directly and coordinates one or more MCP Clients.[1]

Responsibilities

  • Receive user input (text, voice, etc.)
  • Maintain conversation history and manage context
  • Call the AI model to generate responses
  • Initiate connections to MCP servers when needed
  • Display the final response to the user

Examples

Host ApplicationType
Claude DesktopDesktop AI assistant
CursorAI-powered code editor
WindsurfAI-powered code editor
ZedAI-powered text editor
ChainlitAI chat app building framework

The Client is a component embedded inside the Host that maintains a connection to a specific MCP Server and obtains context for the Host to use.[1] It acts like an “adapter” or “messenger.”

Responsibilities

  • Send and receive messages according to the MCP protocol
  • Retrieve the list of available tools, resources, and prompts from servers
  • Convert Host instructions into MCP messages and send them to the Server
  • Return Server results to the Host

Relationship Between Host and Client

Host and Client are conceptually separate but exist within the same application in practice:

  • Host: Determines the AI’s intent (decides “I should look up the weather”)
  • Client: Actually communicates via the MCP protocol (sends a request to the weather MCP server)

The Server is an external program or service that provides context and capabilities to MCP Clients.[1]

Responsibilities

  • Expose available capabilities (Tools, Resources, Prompts) in a standardized format
  • Respond to tool-list requests from the Client
  • Receive tool-call requests and execute the actual processing
  • Return results to the Client

Deployment Options

TypeDescriptionExample
Local serverRuns on the same machine and usually uses stdio transportFile system MCP server
Remote serverRuns over the network and usually uses Streamable HTTP transportRemote MCP servers such as Sentry

The following sequence diagram shows how a tool is invoked through MCP:

sequenceDiagram
    participant U as User
    participant H as Host
    participant C as Client
    participant S as Server

    U->>H: "What is the weather in Tokyo today?"
    H->>C: Fetch available tools
    C->>S: tools/list request
    S-->>C: [get_weather, get_forecast, ...]
    C-->>H: Return tool list
    H->>H: LLM decides to call get_weather
    H->>C: Execute get_weather(location="Tokyo")
    C->>S: tools/call request
    S->>S: Call weather API
    S-->>C: {"temp": 18, "condition": "sunny"}
    C-->>H: Return tool result
    H->>H: LLM generates answer from result
    H-->>U: "Tokyo is 18°C and sunny today."

Using Claude Desktop as an example, here is how the three roles map to the actual application:

Claude Desktop (Host + Client)
├── Chat UI (Host role)
│   - Accepting user input
│   - Displaying conversation history
│   - Communicating with the Anthropic API

└── MCP Client (Client role)
    - Managing connections to MCP servers
    - Sending and receiving messages per the protocol

Connected MCP Servers (Server role)
├── filesystem: File system operations
├── brave-search: Web search
└── github: GitHub repository operations

Adding MCP servers to Claude Desktop’s configuration file (claude_desktop_config.json) enables Claude to use the tools those servers provide. In Claude Code, the official documentation describes scope-specific configuration such as project-scoped .mcp.json and user-scoped ~/.claude.json.[2]

Loose coupling is a design principle that minimizes dependencies between components.

In MCP’s architecture, the Host does not need to know the implementation details of any Server. MCP separates a JSON-RPC-based data layer from stdio or Streamable HTTP transport, so Server implementations can change while the Host’s connection model remains stable.[1]

In MCP, the Host creates a Client for each Server connection.[1] This lets the same AI application use multiple MCP servers, such as file system, search, and GitHub servers, in the same environment.

RoleWhat It IsPrimary Responsibility
HostThe AI app the user interacts withUser interaction, running the AI model
ClientCommunication component inside the HostServer communication per the MCP protocol
ServerTool-providing programExposing capabilities, executing tool calls

Q: Can a single AI app have multiple MCP clients?

A: The official MCP documentation describes a Host creating one MCP Client for each MCP Server and maintaining a dedicated connection for that server.[1]

Q: Where do I run MCP servers?

A: MCP servers run either on a local machine or remotely. The official architecture guide describes stdio as the typical local transport and Streamable HTTP as the typical remote transport.[1]

Q: What programming languages can I use to implement a Server?

A: MCP is a protocol, and the official architecture guide treats language-specific SDKs as part of the MCP project set.[1] Check the SDK documentation for the language you plan to use.

  1. Model Context Protocol, Architecture overview
  2. Anthropic, Connect Claude Code to tools via MCP