Loading video player...
I keep hearing about MCP and how useful
it is for AI apps. At this point, I'm
almost afraid to ask, what is it and how
does it work?
>> Well, Martin, let me show you.
[Music]
>> Welcome to the show, Jack. What do you
do here at Google?
>> Thanks for having me, Martin. Well, I'm
a Python devel developer advocate here
at Google Cloud and my background is in
open source client libraries
specifically on databases and making the
connection experience smooth.
>> Excellent. So, what is MCP and why is it
useful?
>> Yeah. Well, MCP stands for model context
protocol. It's an open protocol
developed by Enthropic that standardizes
how we provide context to large language
models or LLMs. There are three main
components to MCP, but today we are
going to focus on tools.
>> Okay, tools. That sounds a bit abstract
to me. What What are they? Well, tools
give an LLM or agent the ability to take
action in the real world through
discovering and calling external APIs,
querying a database, or running custom
code, you name it.
>> That makes sense. Who would use MCP?
MCP really is useful for a wide
audience, but I see most users falling
into one of two groups of people. If you
provide an API or a service, you may
want to use MCP to package your API into
MCP tools so that clients and agents
have an easier time using it. If you are
a developer using AI assisted or
building AI agents, MCP makes it easier
for agents to use an API or perform
actions on your behalf. For example, an
MCP server for Cloud Run. A developer
can ask in plain English to deploy a
Cloud Run service instead of having to
know all those pesky G-Cloud commands.
>> Those pesky G-Cloud commands. Yes, I
feel you. Uh, and where would you deploy
this MCP server?
>> Good question. You have lots of
different options. You can run an MCP
server locally. For example, if you want
AI help when you are writing code in
your editor. You can also have remote
MCP servers if you want to share it with
others. I think deploying MCP to Cloud
Run on Google Cloud is a great option.
>> All right, let's get down to brass tax.
What might a real use case of MCP look
like?
>> Yeah, let's say Alice is an API
provider. Her company sells sprinkler
systems for lawns. She partners with
lawn care companies who install these
sprinkler systems. To make life easier
for them, she provides an MCP server
with a tool that they can call to get a
price quote. She has deployed the MCP
server on Cloud Run, which is
serverless, so that she doesn't have to
worry about the infrastructure.
>> Got it.
>> David runs a lawn care company. He
provides an AI chatbot that his
customers can use to get lawn care tips,
to schedule visits, or to place orders,
and so on. If David points his AI agent
to Alice's MCP server, the agent can now
provide quotes for installing sprinkler
systems.
>> Oh, shadow, please get down. Okay. All
right. Sorry about that, Jack. I see.
Uh, so what would the end user
experience be?
>> Yeah. Let's say we have Eve, who is the
end user. She might use David's AI
chatbot to ask for general lawn care
tips, like when is the best time to
water her lawn.
She might also ask how much it would
cost to install a new sprinkler system.
David's chatbot can actually answer this
question thanks to Alice's MCP server
and API. That makes sense. Now, I'm a
developer. What does the code for all
this look like?
>> That's an important part. Let's start
with Alice's MCP server. She has
imported the fast MCP library and added
this MCP.tool decorator to the calculate
quote function. That annotation is all
it takes to expose this method via the
MCP protocol. So AI agents can now use
it. The body of that function is the
business logic for calculating the quote
itself. The price quote depends on which
country the customer in as well as the
square meters their lawn.
>> All right. Uh, that looked pretty
simple. Now, how would David's agent
call Alice's tool to calculate a quote?
>> Let's take a look at the actual code for
David's agent. When you build an agent,
you can provide an array of tools or
functions that it can call. David's
provides a single tool of type MCP tool
set which contains the address of
Alice's MCP server.
>> Okay. And when I've given tools to
agents before, I remember having to
provide which input and output
parameters each function takes and a
description of what each function does.
Uh, but David didn't have to do that
here.
>> That's right. He didn't. He just pointed
the agent to Alice's MCP server URL and
it figured out the rest.
>> And then David's agent called Alice's
API.
>> Yep, it did. Alice is running her MCP
server on Cloud Run. So, if she clicks
on the Cloud Run service logs in the
console, here's what it looks like. Here
is the actual call made by David's
agent.
>> That makes sense. And where would David
run his agent?
>> Another good question. The agent was
built using Google's ADK or agent
development kit and it was also deployed
to Cloud Run.
>> Wow, a lot of Cloud Run in this example,
huh?
Yeah, Cloud Run is serverless which
makes it really easy to deploy agents,
MCP servers or APIs. Google handles the
configuration and scaling so that you
can release faster.
>> Very good. But I have some questions for
you Jack.
>> All right. All right. Go ahead, Martin.
>> So, the point of MCP is that agent
developers like David don't have to tell
the AI what the input and output
parameters are.
That's one advantage of MCP. Another
reason for MCP is that previously your
tools had to be built for a specific
framework like lang chain or visual
studio code. MCP is a common protocol
that many clients can use. On the other
side, developers who expose their APIs
with MCP. That way, Alice's API or the
API for a calendar, email, or local file
system all appear the same and make it
easier for AI agents. M and you said
before that we'd put the MCP server in
the cloud to make it available for
everyone, but Alice might want some
authentication for MCP server, so only
registered partners like David can use
it right?
Yes. Luckily, MCP has support for
authentication. I will note that it is
fairly new and still evolving. MCP
supports OOTH, which is great for when
users like you or me want to
authenticate. You can also lean into
cloud run existing authentication infra
to use with MCP like bear off. This is a
great choice when you are wanting
servicetoervice authentication.
>> I see. What does this MCP protocol
actually look like?
>> Good question. Let's take a look. I have
the MCP inspector pulled up on my
computer. Here we can see that the tools
is an array with a single entry called
calculate quote. That tool takes two
inputs, square meters and country code.
Both are required.
>> That looks a little bit like an open API
spec. What's the difference?
>> That's an important question. An open
API spec is lower level. For example, it
includes the HTTP status codes that an
API can return. The MCP server skips
those implementation details.
>> In the code you showed, Alice used uh
Python and the fast MCP library. All is
good. But what if Alice already has a
well- tested API and doesn't want to
change it? Uh, she just wants to expose
her existing API to AI agents.
>> Totally. Fast MCP actually has built-in
support for this exact functionality.
You can point it to your open API spec
and it will actually generate an MCP
server. Another option is to write a
small proxy using fast MCP that forwards
any calls to the underlying API.
>> Very good. Now, let's recap. What are
the main takeaways here, Jack?
>> As I was first learning about MCP and
writing my first MCP servers, here's
what I learned along the way. One, MCP
is super useful as a common language for
declaring tools for our AI agents. Two,
if you want agents to use your API,
expose it with MCP. And three, it's
super easy to run an MCP server on Cloud
Run.
>> Great takeaways and thanks for joining
me today, Jack. Thanks for having me,
Martin.
>> And thank you everyone for watching. If
you have any questions for Jack or me,
ask in the comments. And do let me know
what you thought of today's episode. I
read every single comment. I can't wait
to see what you build.
[Music]
What is MCP (Model Context Protocol) and how does it make life easier for AI agent developers? In this video, Jack Wotherspoon explains MCP to Martin Omander. Watch the duo as they walk through a practical demo of building an MCP server (using FastMCP) and deploying it on Google Cloud Run. Learn why a serverless platform like Cloud Run is a great fit for developers, letting anyone deploy their tools without worrying about managing infrastructure. Martin and Jack dig into the code, covering how an agent (built with ADK) calls an MCP tool and how to handle service to service authentication using Cloud Run's built in OIDC tokens. Chapters: 0:00 - Intro 0:42 - What is MCP? 1:26 - Why is MCP useful for AI agent tools? 2:28 - [Demo] How an AI agent uses an MCP tool 3:55 - Code walkthrough 5:10 - MCP on Cloud Run 6:02 - [Q&A] Why MCP? 6:40 - [Q&A] How to authenticate with MCP? 7:20 - [Q&A] What does MCP look like on the wire? 7:40 - [Q&A] MCP vs OpenAPI? 7:58 - [Q&A] How to use MCP with an existing API? 8:30 - Recap Watch more Serverless Expeditions ā https://goo.gle/ServerlessExpeditions š Subscribe to Google Cloud Tech ā https://goo.gle/GoogleCloudTech #GoogleCloud #CloudRun #Serverless Speakers: Martin Omander, Jack Wotherspoon Products Mentioned: Cloud Run, Agent Development Kit