What is Model Context Protocol?
MCP (Model Context Protocol) is an open-source standard for connecting AI applications to external systems.
Using MCP, AI applications like Claude or ChatGPT can connect to data sources (e.g. local files, databases), tools (e.g. search engines, calculators) and workflows (e.g. specialized prompts)—enabling them to access key information and perform tasks.
Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect electronic devices, MCP provides a standardized way to connect AI applications to external systems.
Concepts of MCP
Participants
MCP follows a client-server architecture where an MCP host — an AI application like Claude Code or Claude Desktop — establishes connections to one or more MCP servers. The MCP host accomplishes this by creating one MCP client for each MCP server. Each MCP client maintains a dedicated one-to-one connection with its corresponding MCP server.The key participants in the MCP architecture are:- MCP Host: The AI application that coordinates and manages one or multiple MCP clients
- MCP Client: A component that maintains a connection to an MCP server and obtains context from an MCP server for the MCP host to use
- MCP Server: A program that provides context to MCP clients
MCP Host: IDE Like VS Code, Cursor, Claude Desktop or any Python AI application that coordinates and manages one or multiple MCP clients
MCP Client: This lies within the AI Application that maintains a connection to the MCP Server and obtains the context from the MCP Server for the MCP Host to use.
MCP Server: Created by Service providers on a specific functionality for the MCP Hosts to use.
Advantages of MCP:
1. Ease of usage
MCP provides a common, universal protocol for AI models to interact with tools, databases, APIs, and systems.
Avoids vendor lock-in — tools built for MCP can work across different LLMs (OpenAI, Anthropic, local LLMs, etc.).
2. Reduces Developer Effort
No need to write LLM-specific adapters for each tool or system. Can integrate and use the services distributed by the service providers.
Updates in the Services does not affect the Host application and is completely encapsulated in the service and is managed by the Service Providers. No code updates are needed at the Host and Client end.
3. Tool Reusability & Modular Design
Tools such as “SQL executor”, “file system access”, “vector search” can be reused across applications.
Encourages modular engineering instead of custom integration per use case.
Communication Flow between these Components:
Consider the case when the MCP receives a Question as an Input(I/P). MCP Host and MCP server are together as an entity in an Application.
First call is sent from the application to the MCP Servers and the list of available MCP Servers are returned.
Second call contains Question + Available Tools list is sent from the the application(MCP Host + MCP Client) to the LLM and LLM returns the Tool to be used for the Question sent along with it.
Third call is sent from the application to the specific tool and the relevant MCP Server returns the information to the Host.
In the Final call, with the information received from the Server + Context, MCP Host sends it to the LLM and the LLM generates the final output.
No comments:
Post a Comment