Practical AI: Machine Learning, Data Science, LLM

Model Context Protocol Deep Dive

May 8, 2025
Listen Now

Summary

The podcast episode offers an in-depth exploration of the Model Context Protocol (MCP), a newly emerging standard designed to facilitate AI agents' interaction with external systems, APIs, and data sources. The hosts, Daniel and Chris, discuss the significant challenges currently faced in AI development related to the fragmentation and incompatibility of custom-made integration code, often referred to as glue code. MCP is presented as a middleware protocol employing a client-server architecture, where the client runs within an end-user application and communicates with MCP servers exposing tools, resources, and prompts. This standardized approach promotes modularity, interoperability, and extensibility, enabling AI systems to dynamically discover and invoke external capabilities without tight coupling. The conversation emphasizes the categorization of MCP entities into tools (model-controlled actions), resources (application-controlled data), and prompts (user-controlled templates), enhancing control and security. The discovery mechanism within MCP enables clients to dynamically understand available operations, akin to service discovery in microservices, improving scalability and flexibility. The episode highlights practical implementation details, including FastAPI-MCP, which allows existing FastAPI servers to be rapidly converted into MCP servers, and mentions Rust SDKs expanding language support beyond Python. Security considerations form a critical theme, focusing on the need for dual-layer authentication at both connection and tool invocation levels, especially when MCP servers are exposed publicly. The discussion also contemplates MCP’s adaptability to embedded or single-node environments, broadening its applicability beyond cloud deployments. The hosts note early adoption momentum from major organizations like Anthropic and OpenAI, while addressing challenges for open models requiring prompt engineering to conform with MCP. Reflecting on AI industry trends, the podcast situates MCP as part of an evolutionary trajectory similar to previous milestones like instruction tuning and tool calling, positioning MCP as a foundational protocol for the anticipated rise of agentic AI in 2025. Overall, the episode balances technical detail with practical examples and strategic insights, highlighting both the promise and complexities of standardizing AI tooling integration via MCP.

Key Takeaways

  • 1Tool calling empowers LLMs to interact effectively with external APIs by having the model generate structured requests based on API schemas while delegating execution to reliable external code.
  • 2MCP introduces a client-server middleware architecture that standardizes AI agents' access to external tools, resources, and prompts, fostering interoperability and scalability.
  • 3MCP’s separation of entities into tools, resources, and prompts clarifies control boundaries and operational roles, supporting secure and user-aligned AI interactions.
  • 4MCP’s dynamic discovery mechanism allows AI agents to query available tools, resources, and prompts at runtime, supporting flexible, scalable, and evolving AI integrations.
  • 5FastAPI-MCP and multi-language SDKs accelerate MCP server development and ecosystem growth by simplifying protocol adoption across different programming environments.
  • 6Security in MCP requires layered authentication and careful management to prevent vulnerabilities, especially when servers are publicly accessible.
  • 7MCP’s flexible design supports not only cloud-distributed deployments but also embedded and single-node scenarios, broadening AI middleware applicability.
  • 8MCP reduces the complexity and fragility of bespoke AI tooling integrations by offering a standard protocol that enables composability, improved governance, and ecosystem growth.
  • 9The AI industry is rapidly evolving towards agentic AI systems capable of autonomously orchestrating multiple tools and workflows, with MCP serving as a critical middleware enabling this shift.

Notable Quotes

"You would give the LLM context for maybe the schema of the kayak.com API. You would then ask a query and have the LLM generate the appropriate maybe JSON body to call the kayak.com API. And then you would just use regular good old fashioned code, you know, Python requests or what have you to actually execute the API call to the external tool and get a response. Does that flow? Yeah. Generally, you know, am I misspeaking anything? No, no, that's my understanding."

"But in the system that's using MCP, there are hosts, there are clients, and then there are servers. So the host would be an application that, like the end-user application."

""The notion of connecting different aspects of services and systems together in a way to try to simplify and standardize. And so, you know, it's a different way of putting it. But yeah. Yeah, I think that's a great way. Even Phil in his blog post has this kind of MCP in the middle as this mediator. So I think that that's a good analogy.""

""I know in that particular article you pointed out one of the things that I had really keyed in on that helped me kind of grok that immediately was that tools are model controlled, resources are application controlled, and prompts are user controlled. And that was easy enough for me to wrap my mind around quickly. So, yeah, that's a great explanation from you there.""

""So we've talked a little bit about MCP clients and MCP servers. There's certainly much more that is available to talk about and dig into in the protocol itself. And, you know, we've scratched a little bit of the surface here. We're not going to go through the whole protocol on the podcast. Maybe that's a relief to our listeners. But there is a whole protocol there.""

""So, you know, from my experience, I just added a few lines of code to my fast API endpoint, wrapped my fast API application in this framework and then ran the application, which is, again, this fast API application. And that was immediately discoverable as an MCP server, meaning that I could, if I had an AI system, which we'll talk about that bit here in a second. If I had an AI system that could interact with MCP servers, my service now, the text to SQL system that we use, would be available to that agent to use as a potential tool that's plugged into, you know, a database that we would connect it to. Does that make sense? It does.""

""One of my pet peeves is kind of the Python only nature of a lot of AI. At least it starts there. And I think I've said in previous episodes, it's a maturity thing when you can get to where you're supporting lots of different approaches to accommodate the diversity that real life tends to throw at us. That's good. I love, and MCP has shot up that very, very quickly.""

"And so it's, like I said, it really is pushing it up the maturity, you know, up the maturity level from we're all writing custom glue code to now, hey, I'm going to standardize on MCP and away we go. Yeah, and I think similar to people can carry over some of their intuitions from working with web servers into this world. Like you wouldn't necessarily just download some code from GitHub and expect there to be no vulnerabilities in it when you run that server, you know, locally. Same goes with MCP, right? You would definitely want to know what you're running, you know, what's included, where you're running it, how authentication is set up, et cetera, et cetera."

"There's one kind of glaring thing here, which is Anthropic released or announced this model context protocol, and certainly others have picked up on it. And you see OpenAI also now supporting MCP, where before they had this kind of their version of tool calling in the API. So there's a more general question here, which is, well, I'm using Llama 3.1 or DeepSeek. Can I use model context protocol? And more generally, like as models proliferate, which they are, and people really think about being model agnostic, meaning they're building systems where they want to switch in and out models. Do I have to use Anthropic or now OpenAI to use MCP? So the answer to this question, at least as far as, you know, what we've discovered in our own work is, as of now, sort of yes and no. But in the future, definitely there will be flexibility to many things."

"So if you remember, you know, tool calling was released. Everybody, the progression, I kind of see it this way. It's like people found out there have been a lot of cases of this. People found out that models generally can follow instructions. And so at a certain point, people developed prompt formats like Alpaca, ChatML, et cetera, that had like a generalized form of instruction following. And those generally got more standardized. And now all training sets, well, not all training sets, but many training sets for kind of the main families of models like LAMA and others include instruction following examples. Then people started doing tool calling. And then people started developing tool calling specific examples to include in their data sets that they're using for models, including like tool calling formats, which are in kind of like Hermes and other data sets now. And so now many models do have tool calling examples in their training data sets. Now we're going to have the exact same progression with MCP."

"The MCP inspector can help you check if your, you know, connect to your MCP server, validate which tools are listed, um, execute example interactions, see what's successful, see what's returned from the MCP server, all of those sorts of things. So very useful little tool that is actually also linked in the fast API dash MCP documentation as well."

"But I think that the key point that I'm trying to make is and that you're making clearly is that the the world has changed in that way, in a small way, in terms of, you know, everyone's going to now have to level up into having this kind of AI specific middleware that ties the model into all the resources, the resourcing and tooling and prompting that it needs."

"You know, new model releases, new tooling, new frameworks. Of course, it does seem like 2025 is set to be the year of agentic AI. And it's what a lot of people are talking about. And, you know, of course, it keeps coming up for us."

"So an AI model, everybody was on their own to integrate tools into their AI models using whatever custom code, whatever custom prompts, whatever custom stuff. Which means, Chris, if you have created a tool calling agent and I now want to use some of your tools that you've developed, and I have my own tool calling agent, I may have to modify my agent to use your tools or you may have to modify your tools to be compatible with my agentic framework. And that's kind of the situation that we've been in for some time, which I guess is painful, reasonably painful."

Episode questions

What problem does the Model Context Protocol aim to solve in AI development?

MCP addresses the fragmentation and complexity of integrating AI models with various external systems like APIs, databases, and automation tools. Without MCP, developers rely on custom, incompatible glue code that is costly and hard to maintain. By providing a standardized protocol, MCP facilitates interoperability between AI agents and tools, enabling scalable, modular AI ecosystems. This standardization helps reduce development overhead and fosters a community-driven ecosystem of integrations.

How does tool calling or function calling work in conjunction with LLMs according to the podcast?

Tool calling involves giving the LLM context about an API’s schema, allowing it to generate the correct request payload (commonly JSON). However, the LLM itself does not execute the call; instead, external code (e.g., Python requests) performs the API call and returns the result. This separation enables LLMs to handle intent and data generation while relying on existing, reliable code for execution. It makes AI systems more modular and easier to integrate with various tools.

Why is agentic AI expected to be significant in 2025, and how does MCP support it?

Agentic AI refers to autonomous AI systems capable of managing multiple tools, data, and workflows to perform complex tasks without human intervention. 2025 is anticipated to be the breakout year for this paradigm as AI matures beyond single-step generation to multi-tool orchestration. MCP supports agentic AI by providing a protocol that enables various AI assistants, automations, and APIs to communicate and operate together in a standardized way. This allows agentic systems to integrate diverse functionalities effectively, accelerating adoption in practical applications.

What lessons can be drawn from the web’s evolution to standard protocols like HTTP when considering MCP?

The early web was fragmented with incompatible formats and custom solutions, limiting interoperability. The adoption of HTTP standardized communication, enabling browsers and servers to interact predictably, which catalyzed the web’s explosive growth. Similarly, AI tool integration suffers from fragmentation; MCP aspires to be the HTTP for AI agents and tools, creating agreed-upon standards and interfaces. This analogy highlights the necessity of MCP to foster ecosystem scalability, developer efficiency, and broad adoption.