How Model Context Protocol (MCP) actually works

por Google Cloud Tech

Inglês · Intermediário · 7:58 · 431 palavras únicas

Google MCPs → https://goo.gle/3PYkjky Build an ADK agent with Google MCPs → https://goo.gle/4o6h8DP Connect an MCP server to an AI agent → https://goo.gle/4uk7YW2 APIs were built for deterministic programs, but AI models reason probabilistically. So how do you get your AI agents to talk to your tools and data without writing messy, custom integration code every time? Enter the Model Context Protocol (MCP). In this video, Smitha Kolan explains what MCP is, how it standardizes the way AI model

Letra e tradução

Letra em Inglês. Tradução em português ainda não disponível para esta lição.

If you've ever tried to make an AI model, talk to your tools

or your data, you've probably realized something.

It's messy.

Every API behaves differently, every integration

needs custom code, and every time the model changes,

your connection breaks.

The model context protocol, or MCP,

was created to fix exactly that.

By the end of this video, you'll understand

what the model context protocol actually is, why it exists,

and how it's changing the way models interact with the world.

We'll walk through the core ideas step by step,

see how it compares to traditional APIs,

and talk about what this means for developers, building agents,

or AI powered applications.

So what is the model context protocol.

At its core, MCP is an open standard

for connecting models to tools, data, and context

in a really consistent and structured way.

You can think of it as a shared language between models

and the systems around them.

It defines how a model can discover available tools,

ask for information, and perform actions

without having to know the specific implementation

details behind each one.

This protocol was introduced by Anthropic

and is now being adopted across the industry

because it solves one of the biggest pain

points in AI development today.

How to make models use external resources safely and reliably.

So here's why that matters.

APIs were never designed for AI models.

They were designed for programs that already

know exactly what they want, programs

that can form precise, deterministic requests.

A language model doesn't work that way.

It generates text probabilistically.

It reasons about uncertain inputs

and often needs to ask questions, clarify or explore

before it knows what to do.

MCP bridges that gap.

It gives models a structured way to discover and describe

the resources they can use.

So things like functions, data sets, documents or prompts

are all available through a consistent interface.

Instead of hard coding every integration,

the model can now dynamically query

what's available, use it, and even

chain multiple tools together, so all

while staying within a safe, standardized framework

to understand how MCP actually works,

let's unpack the main idea.

The protocol defines two sides clients and servers.

The client is usually the language model

or the agent system that wants to perform a task, something

like Cloud, Gemini app or an agent built on top of OpenAI

or Google's frameworks.

The server is the environment that exposes resources

that the model can use a database, a file

system, a company's internal tools or even a document search

engine.

When the client connects to the server,

the server doesn't just respond with data.

Instead, it advertises what capabilities

it supports, what resources exist,

what actions can be taken, and what inputs are required.

This means the model doesn't need

to be pre-programmed with every API or every endpoint.

It can dynamically discover them.

The communication between these two sides

happens through a really simple and well-defined schema.

The client sends requests like list available resources,

call this action, or retrieve this data.

The server then responds with a structured JSON

describing what's possible and what happened.

That's the essence of MCP, a standardized way for models

to talk to their environment.

Now let's go a bit deeper.

Technically, the MCP protocol defines a few main resource

types tools, prompts, resources, and context that together form

what the model can see and use.

Tools are actions that the model can invoke.

For example, a tool could be a search database,

send email, or even analyze a file.

Resources are pieces of data and state

like a text document or database role, or even an image.

Prompts are reusable templates that

describe how the model should behave for specific tasks,

and context represents external information

that the model can pull into its reasoning process.

Things like recent chat history, company data,

or user preferences.

When an MCP client connects, it can

request a list of all of these things from the server.

Each tool or resource comes with metadata

that describes what it does, what input it expects,

and what output it returns.

This allows models to interact intelligently.

The protocol enforces a consistent schema

across all tools.

So whether the model is using a GitHub server, a CRM

server or a calendar server, it speaks the same language.

Now let's address the big question.

If we already have APIs, why do we need MCP at all.

The answer comes down to who the consumer is.

APIs were designed for programs written by humans.

MCP is designed for models that reason like humans.

You can think of MCP as an abstraction above APIs.

APIs still exist.

MCP just makes them model friendly.

Under the hood, your MCP server might still

call your existing REST or GraphQL APIs,

but the model never sees that it only

interacts through the structured MCP schema, which

handles discovery, validation, and execution in a uniform way.

That's what makes MCP powerful.

It lets you expose your system to any compliant model

without custom integrations each time.

Let's take a practical example.

Say you're building a personal assistant agent that

can check your calendar, pull meeting notes,

and draft follow up emails.

In the old world, you would integrate with Google Calendar,

notion, and Gmail APIs.

You'd write code for each service,

handle authentication, rate limits,

and all of the weird edge cases.

Then you teach the model how to use

those endpoints through really long, fragile system

prompts with MCP.

You build or install servers for each of those systems

a calendar server, a node server, an email server.

Each one advertises what it can do.

The model automatically sees the available tools

like list events, get meeting summary, or send email.

It can reason about what to use, in what order and what data

to pass between them.

The key difference is that the developer

doesn't have to write glue code for each new tool.

The model knows how to interact because the protocol is

consistent.

That's the kind of simplicity that MCP

brings to AI development.

So this shift is already underway,

the same way that HTTP unified the web.

MCP is already beginning to unify how models talk to tools.

And that's why learning it now matters.

Because soon every serious AI developer

will need to know how to make their systems MCP aware.

For a full list of Google Cloud related MCP servers,

check out the description box below, as well as a blog post

regarding how MCP servers work.

I hope this video was helpful.

If you want to Continue Watching and learning about MCP and APIs,

check out the next video called MCP versus API.

Vocabulário (431 palavras)

seesserverintelligentlyneedsresourceslimitsweremessyusuallyqueryintegrationsendsclienttheyroleorderdatawhetherwrittenexplorediscoverypointsnextyou'vefilegenerateshumanscanintegrationsuserrealizeddynamicallygraphqltoolsaboutwatchingunifiedhistorykeysocontinuebehindtoplanguagecodinggogeministayingfollowconsistentimplementationdatabasebelowbyacrossworldinputexiststypesa

Estude com a lição completa

Crie uma conta grátis e ganhe 15 novas palavras por dia.

Criar conta grátis

← Ver todas as lições