From the course: Hands-On AI: Building AI Agents with Model Context Protocol (MCP) and Agent2Agent (A2A)

What is Model Context Protocol?

- [Instructor] In this chapter, we will discuss the concepts of Model Context Protocol, or MCP for short, and how it will be used to build generative AI integrations. We begin by discussing the need for this protocol in this video. Let's briefly review the typical setup of a GenAI system or application. The system is provided with inputs by a user or a client system, mostly in the form of text, data, or other formats. The system would then proceed to use this input and execute the request. An orchestration engine helps to orchestrate the request across multiple entities to determine a response. It connects to a set of resources to fetch data or context. These resources can be structured databases, files, web services, or vector databases, or graph databases. In the case of AI agents, the orchestration layer also integrates with a set of agent tools to execute actions. To send data to GenAI models, prompt templates are used. These templates can be bundled inside code or made available in external data stores. The orchestration layer also talks to GenAI models for various activities like planning, reflection, and generation. The final output is generated based on the orchestrated actions and delivered back to the client. What are some key challenges in building such GenAI systems? Enterprise GenAI systems typically integrate with several types of resources to get data. Each resource type supports its own interface for data retrieval. This could be SQL, REST, gRPC, or simple file reads. AI agents through their tools need to integrate with external systems like web services, third party services, and cloud services for performing actions like creation, retrieval, and updates on data stored in these systems. Prompt templates also are not standardized, so each developer or team uses their own methods to store and retrieve them. Each such external entity needs custom integration to be built for each application. This significantly increases the integration efforts needed to build a GenAI system. Here is where Model Context Protocol, or MCP, comes in to help. MCP provides a single standard protocol through which a GenAI system can integrate with resources, tools, or prompt templates. For the protocol to work, the provider of each of these external systems need to support the MCP interface on their side. Once implemented, any client can then access these systems using MCP. A given GenAI system may integrate with multiple such external systems. They can use a single standard protocol to integrate with all such systems. As the integrations grow in complexity, MCP helps in standardizing them and significantly reducing development efforts. Let's explore more of MCP in the next few videos.

Contents