MCP is awesome and here is why.
By Underfitted
Key Concepts:
- mCP (Model Context Protocol): A protocol designed for AI-first communication, enabling dynamic exchange of capabilities between clients and servers.
- API (Application Programming Interface): A traditional method for exposing functionality, often requiring versioning to manage breaking changes.
- Capabilities: The features, tools, and resources that an mCP server or client supports, exchanged during session initialization.
- Tools: Specific functionalities exposed by an mCP server, such as
invoke_model, with self-describing documentation via code and type hints. - Sampling: A feature where an mCP server requests the client to run a query using its LLM, enabling bidirectional communication.
- Resources: Additional context provided by the server to the client, such as documentation URLs or files.
- Prompts: Templates or instructions provided by the server to guide the client in using specific tools.
- Self-describing: The ability of mCP tools to include documentation within the code itself, eliminating the need for separate documentation files.
1. mCP vs. Traditional APIs:
- APIs: The speaker explains that traditional APIs expose fixed endpoints (e.g.,
/products,/users). Changes to the API contract (e.g., adding pagination) require corresponding changes in the client. Breaking changes necessitate versioning, creating entirely new APIs. - mCP: mCP addresses the limitations of APIs in an AI-dominated world. It allows for dynamic exchange of capabilities between clients and servers. The server advertises its supported tools and their usage, enabling clients to adapt to changes without code modifications.
- Example: If a traditional API's
get_producttool requires a new parameter, all clients using that API must be updated. With mCP, the server updates its advertised capabilities, and the client dynamically adjusts.
2. How mCP Works:
- Session Initialization: When a client connects to an mCP server, they exchange capabilities. The server informs the client about the available tools, their parameters, and expected responses.
- Self-Describing Tools: Tools are self-describing, meaning their documentation (arguments, return types, usage examples) is embedded within the code using type hints and docstrings. This eliminates the need for separate documentation files like Swagger or OpenAPI specifications.
- Dynamic Adaptation: If a tool's contract changes (e.g., adding a new parameter), the server updates its advertised capabilities. The client automatically adapts to the new contract during the next session initialization.
- Bidirectional Communication: Unlike traditional APIs where clients primarily call servers, mCP enables bidirectional communication. Servers can request clients to perform tasks, such as running queries using the client's LLM (Sampling).
3. mCP Architecture:
- Client-Server Relationship: There is a one-to-one connection between an mCP client and an mCP server.
- Host: The host application (e.g., Cursor IDE) initializes the client, which connects to the server.
- Capability Exchange: The client announces its capabilities to the server, and the server responds with its supported tools, resources, and prompts.
- Sampling Workflow: The server requests the client to run a query. The client presents the request to the user for approval. If approved, the client sends the request to the LLM. The LLM's response is presented to the user for approval before being sent back to the server.
4. Key Features and Capabilities:
- Tools: Functionalities exposed by the server (e.g.,
invoke_model). - Resources: Additional context provided by the server, such as documentation URLs or files.
- Prompts: Templates or instructions provided by the server to guide the client in using specific tools.
- Sampling: The server requests the client to run a query using its LLM. This allows the server to leverage the client's resources and models.
5. Sampling in Detail:
- Use Case: A server needs to perform sentiment analysis using an LLM. Instead of directly connecting to an LLM API, the server can request the client to run the query.
- Model Selection: The server can specify which LLM model the client should use (e.g., GPT-4).
- Human-in-the-Loop: Sampling requests and responses should be presented to the user for approval to ensure trust, safety, and security.
6. Benefits of mCP:
- Dynamic Adaptation: Clients can adapt to changes in the server's capabilities without code modifications.
- Self-Describing Tools: Documentation is embedded within the code, eliminating the need for separate documentation files.
- Bidirectional Communication: Servers can request clients to perform tasks, enabling more flexible and collaborative interactions.
- Leveraging Client Resources: Servers can leverage the client's LLM and other resources through sampling.
7. Conclusion:
mCP is presented as a forward-looking protocol designed for AI-first communication. It addresses the limitations of traditional APIs by enabling dynamic exchange of capabilities, self-describing tools, and bidirectional communication. The speaker believes that mCP has significant potential and is worth learning, even though its future success is not guaranteed. The key takeaway is that mCP aims to create a more flexible and adaptable communication framework for AI agents and systems.
Chat with this Video
AI-PoweredLoad the transcript when you're ready to chat so the initial page stays lighter.
Related Videos

How the hometown humiliation of Putin marks a turning point for Ukraine | DW News
DW News

Shocking video shows moment paramedics are hit by Israel in 'double-tap' strike
Sky News

Putin Xi, To Catch a Castro, Red Carpet Rebellion • FRANCE 24 English
FRANCE 24 English

Trump's supporters furious over Trump smartphone scam.
ABC News In-depth

Nvidia Crushes Earnings again — What Jensen Huang sees next for AI
CGTN America

Samsung union suspends strike after reaching tentative pay deal • FRANCE 24 English
FRANCE 24 English

OH SH*T! The Banks are Dumping AI Loans!
Steven Van Metre