The Model Context Protocol (MCP)
1. The Model Context Protocol (MCP)
Let's reflect on the current state-of-play of our agentic architecture.2. Agent interoperability: the state-of-play
We've seen repeatedly the importance of integrating user and system data with our agents to make them robust and adaptable. Many tools used by agents also integrate data into the agent, retrieving it from databases or APIs if it's required to complete the user's task. This sounds straightforward, right?3. Agent interoperability: the state-of-play
Well, each data source often requires its own custom implementation to integrate it with the system, which can increase the complexity and consequently the development time and maintenance efforts for the system.4. Sockets/power outlets from around the world
Connecting data sources to agents is a lot like trying to charge your phone while on a trip around the world. You're likely to encounter different socket types as you travel, which may require you to buy a new phone charger each time to connect to the power. This is where the Model Context Protocol, or MCP, comes in.5. Model Context Protocol (MCP)
MCP was developed by Anthropic to provide a universal open standard for connecting AI systems, including agents, with data sources. This is like having a universal travel adaptor for your phone charger!6. The MCP architecture
To utilize the protocol, the architecture has three key elements: a host, clients, and servers.7. The MCP architecture
The host is an AI-powered application, such as an agentic system.8. The MCP architecture
MCP servers are systems or tools that provide access to data or functionality, and the host makes requests to a server to use these systems or tools.9. The MCP architecture
These requests are managed by clients, which act as an intermediary between the host and the server. There's a client for each MCP server.10. The MCP architecture
The MCP server then converts the request into an appropriate format to work with the connected system and vice versa. For example, transforming requests into the HTTPS protocol for internet data.11. MCP servers
These MCP servers expose their functionality in the form of three primitives, which are core building blocks:12. MCP servers
Resources, which can be any kind of data from database records, live system data, and images.13. MCP servers
Tools which are anything that the agent can call to perform an action. Agents are able to see what tools are available, call those tools and read the results to then communicate back to the user.14. MCP servers
And Prompts, which are pre-written prompt templates to guide more complex workflows.15. MCP vs. No framework
To summarize, MCP provides a standard open protocol for connecting AI applications with data sources. Instead of creating custom integrations for each new data source, MCP provides a standard for translating requests into the correct format for the data source. This brings a few benefits: there's dynamic tool discovery, where agents can receive a list of tools available from the server and descriptions of what they do. With standard APIs, these tools would need to be statically coded, and if anything changes in the API, then the integration code needs to change with it. MCP offers an “integrate once” approach which brings adaptability to the system. Next is interoperability, as MCP works across different LLMs. This is good for agentic systems because models are constantly evolving and getting better. Having a system that allows us to swap models out without refactoring the full codebase is great for maintainability. And lastly, standardized security. MCP has a standard authentication method that allows for better scalability when adding access to additional MCP servers. Compare this to APIs, which typically require different keys and authentication types for each tool.16. Let's practice!
Now let's apply this knowledge with a few exercises!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.