The Architecture of MCP

MCP follows a client-server architecture with four key components

  1. MCP Host: The AI model requesting data or actions (e.g., Claude, GPT)
  2. MCP Client: The intermediary service forwarding requests from the AI model to appropriate servers
  3. MCP Server: Lightweight applications exposing specific capabilities (APIs, databases, files)
  4. Data Sources: Backend systems including local storage, databases, and external APIs

The data flow works as follows:

  • The AI model sends a request (e.g., “fetch token price”)
  • The MCP client forwards the request to the appropriate MCP server
  • The MCP server retrieves the required data from a database or API
  • The response is sent back to the AI model via the MCP client