Model Context Protocol (MCP)

Model Context Protocol (MCP)

Tags
MCP
LLM
Published
May 28, 2025
Author
Yonghai Gong

1 MCP

MCP (Model Context Protocol) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. It enhance the flexibility, functionality and scalability of LLM applications by standardizing the integration mechanisms between models and external resources.
notion image

2 The core

Model context is the core of MCP, which are all external resources and tools needed during running LLM applications. MCP enables LLMs to dynamically access and integrate the following by defining standardized interfaces and protocols:
  • External Data Sources: Databases, APIs, document repositories, etc., providing real-time or historical data to LLMs.
  • Tools & Services: Computational tools, search engines, third-party services, etc., extending LLM capabilities.
  • Context Management: Dynamically maintains LLM dialogue context to ensure coherence and consistency.

3 Architecture

The MCP framework comprises four core components:
  1. Host
    1. The AI application (e.g., IDE, chatbot) that requests data from servers. Manages client initialization, user authorization, and context aggregation.
  1. Client
    1. Acts as a bridge between Host and Server. Handles message routing, capability management, protocol negotiation, and subscription management. Ensures secure and efficient communication.
  1. Server
    1. Provides external data/tools (e.g., Gmail/Slack APIs, databases). Augments LLMs with additional context via tools, resources, and prompt templates.
  1. Base Protocol
    1. Defines communication standards (message formats, lifecycle management, transport mechanisms).
      Analogous to USB-C: enables universal interoperability across devices via a standardized interface.
      notion image

4 Key Features

  • Standardized Interfaces: Unified interfaces and protocols ensure compatibility between LLMs and external resources.
  • Dynamic Integration: Enables LLMs to dynamically access and integrate external data sources and tools.
  • Context Awareness: Supports dynamic dialogue context management for improved multi-turn conversation coherence.
  • Openness & Extensibility: Allows third-party developers to extend functionalities and resources for LLM applications.

5 Application

  • Enhanced QA Systems: Integrates external data sources to deliver real-time, accurate answers.
  • Intelligent Assistants: Performs complex tasks (e.g., bookings, calculations, searches) by integrating tools and services.
  • Knowledge Management: Provides domain-specific expertise by connecting to document libraries and databases.
  • Multi-turn Dialogues: Maintains coherent conversations through dynamic context management.