Loading video player...
LUKE SCHLANGEN: If you're doing anything with generative AI,
you've probably heard of MCP.
So what is MCP, and what is it good for?
MCP is Model Context Protocol.
So that protocol is a communication layer where
your large language model can communicate with other software
programs to extend its capabilities,
make it good at things that it's not normally very good at.
For example, large language models
are not known for being the world's best mathematicians.
And while they continue to get better thanks
to things like reasoning, it's still not what they're best at.
Luckily, traditional computer programs
are really good at math.
It's kind of their thing.
So we can help our LLM by giving it access
to traditional computer programs through the Model Context
Protocol.
The protocol is simply the agreed-upon way,
the agreed-upon standard that our LLM will communicate
with our other programs.
So let me show you what that looks like.
So I've created an MCP server by writing some code.
My server is written in JavaScript.
You can write yours in Python as long
as it uses the Model Context Protocol, which
is the agreed-upon way that we can interact
with our LLM-based AI agent.
So let's walk through this code.
So we start by creating the MCP server,
and then we register a few tools.
We have one for addition and one for subtraction.
In order for our LLM to know when to use a particular tool,
it's important to give it a description.
And that way, when the user asks for something,
the AI agent can check to see if it has
a tool that can help with that.
For the addition tool, it adds two numbers together.
And when the agent wants to use this tool,
the input schema says that what it needs to provide
is two numbers.
So when it provides two numbers, our code
will add those two numbers together.
So now the agent knows when I need
to add two numbers together, I have this tool available to me.
Now, this looks different in different languages.
Here's an example written in Python,
but you still see the same things.
You've got a title, you've got a description,
and you have the expected input schema.
They show up in different places,
but you still need to communicate
the same information--
because again, even if it's a different language,
it still needs to adhere to the model context protocol.
As long as it does that, we have a way to communicate.
So now that I've created my MCP server, I want to use it.
So I'm going to tell Gemini CLI how to interact with it.
I'm going to do that by updating my settings.json
file for Gemini CLI.
And now when I use Gemini CLI, I can run the /mcp command to see
the list of tools available.
And there's the tool that I just created.
Now I can ask Gemini CLI to add 1,234 plus 1,234,
and I get 2,468.
Now, granted, addition is something
that LLMs are getting much better at,
and you might not need a separate server for this,
but it doesn't just apply to math.
We can use MCP servers for a whole host
of different problems.
You can use an MCP server to get search results,
to get the latest weather, or to get any other information that
wasn't in the LLM's original training data.
Beyond retrieving information, MCP
can also be used to take actions on your behalf.
So that could be adding something to a database,
pushing some code to GitHub, or even updating your to-do list.
In these cases, you don't want anyone
to just be authorized to make changes as you,
so MCP uses OAuth authentication to validate that the request is
coming from you.
For this example, I'm going to use
Linear, which is a tool for planning and building products.
They provide a remote MCP server that
uses OAuth to verify that I am authenticated.
Quick side note-- for most of these examples,
I'm using Cloud Shell, which is a cloud-based terminal.
I couldn't do that for this example
because it doesn't have the permission
to open up a new tab in my browser, which is necessary
in order to complete the OAuth flow.
Just like before, I need to add the MCP server
to my geminisettings.json file.
Now I can start up Gemini and run /mcp to see that Linear is
a configured MCP server, but it's disconnected,
which means I can't use it.
To connect to the Linear MCP server,
I need to run /mcp auth linear.
A browser tab opens up, and I follow
the login flow for Linear.
It's successful, so I can head back to the Gemini CLI.
Now, this time when I type /mcp, I can see that Linear is
enabled, and I see a full list of all of the different tools
available.
So what can we do now that the Linear MCP server is enabled?
Well, the first thing I want to do
is see what are my issues in Linear.
Now, interestingly, it saw the word "my," and that actually
made a big difference here because it has two tools.
So this is something MCP-related that I want you to realize.
One of the tools is called list issues, and one of the tools
is called list my issues.
And so here, it told me that I don't have any issues in Linear.
And so what I really want to know
is what are all of the issues.
So that was my bad.
Get it?
My bad because my--
so I rewrote my prompt, and the Gemini CLI
was able to figure out which tool to use this time.
So since I'm the only one using this Linear project,
I want all of the tasks to be assigned to me.
So I'm going to ask the Gemini CLI to do that, assign
all of the tasks to me.
And voila.
There we go.
And I'm just going to check back on the Linear dashboard
to make sure that looks correct.
And it does.
There's my picture.
It looks like every single one of these tasks
is now assigned to me.
Now, for the first time, Gemini CLI
has taken an action on my behalf.
It's not just retrieving information,
but it's also making changes.
It assigned all of these tasks to me.
And now I want to keep going in that flow.
So I feel pretty good about how I've integrated Linear and using
Linear in general, so I'm going to say that, yes, I have
gotten familiar with Linear.
So let's go ahead and mark that task complete.
So Gemini handled marking it as complete,
and it is no longer in my list of active tasks.
I'll add one more task, which is to create a video about MCP
and the Gemini CLI, the one I'm making right now.
So the task has been created, and it
has been added to the backlog, but I
don't want it in the backlog.
I'm actually doing that right now.
It's in progress.
So let's go ahead and mark it as active and in progress.
And there we go.
Gemini CLI and the Linear MCP server
are able to work together to do that.
You can see that it is in progress.
The magic here is that I can update issues in Linear
without ever leaving my terminal.
And for some folks, if you're someone
who uses the terminal for everything,
it's one less tab you need to have open in your browser.
So you know that MCP stands for Model Context Protocol,
but you may have originally thought
that MCP stood for Monkeys Cooking Pancakes or Mayonnaise
Can Popper or Manatees Choosing Pineapples.
And those are just normal things that anybody
could have thought of.
Anybody could have thought those things.
Anybody.
But now you know that MCP stands for Model Context Protocol.
And we can use it to extend the capabilities of our LLM-based AI
agents, including to create custom generative AI
videos with Veo 3, like the ones you just saw.
Now, this MCP server is a little bit more
involved than the other ones that I've demoed,
so I'm going to include a link to how
to do this in the description of the video below.
So to get this MCP server running on my computer,
I had to clone the repository, I had to navigate to this MCP Gen
Media directory, and then I had to install it
by running this shell script.
Once I installed the MCP server locally,
I updated the Gemini CLI settings
to include this MCP server.
Then I asked the Gemini CLI to create an animation
for MCP and the Gemini CLI.
So using text in video is still one
of the tougher tasks for video generation,
and it didn't get it right 100% of the time,
but I was still pretty impressed by what it came back with.
So once again, we were able to use
MCP to extend the capabilities of the Gemini CLI
to create some magnificent cartoon parrots.
So all of this is to say that MCP isn't limited
to solving math problems, or keeping
track of your to-do list, or even creating videos.
The power of MCP is that you can flexibly
extend your AI agents to do a bunch of different things.
And this will only become more powerful
as more MCP servers become available.
And now, I can use MCP one last time
to mark this video complete.
[MUSIC PLAYING]
Level up your LLM game with Model Context Protocol (MCP)! Learn how MCP allows your Large Language Models to interact with traditional computer programs, expanding their functionality. This tutorial shows you how to build an MCP server, connect it to Gemini CLI, and use it to retrieve additional information, take actions on your behalf, or even generate videos. Chapters: 0:00 - What is Model Context Protocol (MCP)? 0:55 - Building an MCP Server 2:18 - Connecting Gemini CLI to your MCP Server 3:21 - Connecting Gemini CLI to Linear using OAuth 6:55 - Veo 3 MCP Server Subscribe to Google for Developers → https://goo.gle/developers GitHub repository for video creation: https://github.com/GoogleCloudPlatform/vertex-ai-creative-studio/tree/main/experiments/mcp-genmedia Speaker: Luke Schlangen Products Mentioned: Google AI, Gemini, Generative AI