From the course: Unboxing AI: Build a Remote MCP Server from Zero to Deployed with OAuth
MCP's revolutionary approach - OAuth Tutorial
From the course: Unboxing AI: Build a Remote MCP Server from Zero to Deployed with OAuth
MCP's revolutionary approach
- MCP is a middle worker, a layer between the external service and the AI. It allows the external service to define exactly what capabilities the AI should have, and then informs the AI about what type of input is necessary to produce specific results. And the cool thing about the MCP's protocol is you, as a user, can choose to write your own MCP server to do things, or a service provider can write their MCP server to do things. And then, when you as a user use a chat agent, or you use a IDE for coding, or you use any other tool that supports MCP, you can plug in as many MCPs servers as you like and then lean on the AI, the chat agent, to figure out which server to use in what circumstance. That is the revolutionary part. It's a separation of concerns where you have the data on one hand, you have the chat agent on the other, and then you have this middle worker layer that facilitates communication between the two pieces. Now, when people talk about MCP, they often talk about it like USB, right? You take USB, a standardized protocol, and you plug any USB device into any USB-supporting device like a computer, and it will just run. That's sort of the idea, where the vendor, the company that created a service, can define how to connect it, and then you just plug it in and it just works. Now, the MCP server tells the MCP client, that would be your chat bot or the tool you're using, what is available, meaning you can get information, you can perform actions, here are instructions on how to do things, et cetera. It provides instructions to the AI about what is possible within the external service. These things can be tools, meaning actions that the AI can perform on a server. Think send an email, reorganize a folder, create a new file, make a search for a specific thing, do something with data. It can also be resources, that is, passive information. So if you went to a database and you wanted to retrieve information, that would be retrieving from a resource. So a library, like a physical library in the world, could offer up resources that could then allow you to chat with the library to find out if books were available. And then finally, it has what's called prompts, which are instructions from the MCP server to your AI chat bot about what is possible. And depending on how that's implemented, sometimes the MCP server will just write the prompts for you. Other times you can actually surface the prompts in the chat app and then use them. And other times, again, the chat app will take your instructions, combine them with a prompt, and then send them in. And that depends on how it's been implemented. You have custom functions in tools, you have data retrieval and resources, and you have prompt templates in prompt. And this is just the beginning. This is the first step in the MCP protocol. This is what was released at the beginning and is what is generally supported across all devices that use MCP right now. But it's not the only things. Coming up is elicitations, which allows the MCP server to pass questions back to the client, to the AI chat app, to get further information. You have, what is it called, sampling, which allows the MCP server to either tell the client to run further AI generation or to go elsewhere and run further AI generation on the returned data before it gets returned to the user. So think, you ask a question to find some information from a library, the MCP server connects you to the library and retrieves the information. Then the server says, "Actually, summarize this in a very specific way with links and anything else that's necessary." And it leans on your chat agent to actually do that summarization work before it gets returned to you. So the server is acting on the resources behalf in your agent. And yes, that is complicated for a myriad of reasons, including that you, the user, don't necessarily know what's going on. So this is not currently something that is live anywhere. You can't really do this yet, but it is coming. The client, so the application that is connected to the MCP server, that would be ChatGPT, Claude, Gemini, your application, whatever you're using that has MCP support, determines how to proceed. And when I say the client, I actually mean the AI determines how to proceed.