WEBVTT

00:00.160 --> 00:04.520
And as always, we begin our new topic with the core concepts.

00:05.040 --> 00:14.240
So MCP has three pieces to it, three types of thing which makes up an MCP solution.

00:14.560 --> 00:17.840
So the first thing is called a host.

00:18.120 --> 00:19.840
Now these terms you're going to get used to them.

00:19.840 --> 00:20.720
You're going to hear them a lot.

00:20.760 --> 00:22.680
And some of them are overloaded.

00:22.720 --> 00:25.840
Terms that we use in other contexts like host can mean a lot of things.

00:25.840 --> 00:27.560
So just to be very clear.

00:27.720 --> 00:32.320
So a host means like a host environment, a host application.

00:32.440 --> 00:39.320
And it's something that the most common host that is referred to is the clawed desktop app, which is

00:39.320 --> 00:42.680
often used as the host for MCP.

00:43.200 --> 00:48.760
And the host represents the place where the application software is running.

00:48.760 --> 00:52.960
That's going to take advantage of these tools that we're going to equip it with.

00:53.120 --> 01:01.120
So, uh, Clawed Desktop is a typical example you can't use, at least as of now, the clawed chat,

01:01.160 --> 01:03.490
the web based chat, you have to use the desktop.

01:03.650 --> 01:10.050
But another example would be our own agent architectures, our own agent solutions that we will build

01:10.210 --> 01:12.010
in cursor and run it there.

01:12.050 --> 01:19.330
And since I mentioned cursor, cursor itself is also actually a host in that cursor can connect to MCP

01:19.370 --> 01:19.850
servers.

01:19.850 --> 01:22.850
So a host can also be the cursor environment.

01:22.890 --> 01:29.290
It can be a generic applications that we write like the one we did in Autogen last week, and like the

01:29.290 --> 01:32.490
one we're going to do in using open AI agents SDK.

01:32.890 --> 01:35.330
And it can be your desktop that is the host.

01:35.330 --> 01:36.490
It's an application.

01:37.490 --> 01:42.970
An MCP client is a is something which runs within the host.

01:43.250 --> 01:46.290
And there are there can be many MCP clients.

01:46.290 --> 01:54.330
In fact, you need an MC client for every MCP server, every set of tools that you're going to use in

01:54.330 --> 01:56.610
your host, like your desktop.

01:56.810 --> 02:03.820
So supposing you wanted to give Claude desktop access to Google Maps, Then you would need an MCP client

02:03.820 --> 02:09.180
for Google Maps running inside the the host inside your desktop.

02:09.180 --> 02:13.540
If you wanted to access the local file system, that would be another MCP client.

02:13.700 --> 02:18.140
If you wanted to look up stock prices, that would be another MCP client.

02:18.340 --> 02:22.100
You'd have each of these sets of tools offered by somebody.

02:22.460 --> 02:28.060
They would be, uh, managed by an MCP client living inside that host.

02:28.060 --> 02:32.420
And if for some reason you had a couple of different hosts, you had Claude Desktop and you also had

02:32.420 --> 02:37.580
cursor running some tools, and you also had an agent app, then all three of these hosts would all

02:37.580 --> 02:41.780
have their own MCP clients for each MCP server.

02:41.980 --> 02:44.980
So now that I've said MCP server, I better introduce that.

02:44.980 --> 02:54.020
So an MCP server is the actual process which provides tools and context or resources as the proper MCP

02:54.060 --> 03:00.380
word for IT tools, resources represented, context and prompts, and most importantly, tools.

03:00.380 --> 03:02.380
That's what we'll mostly use.

03:02.800 --> 03:09.560
uh, and an MCP server is one particular offering that supplies a group of tools.

03:09.560 --> 03:15.560
It might be like a file system MCP server that gives tools that give you access to the file system.

03:15.560 --> 03:20.960
It might be a weather MCP server that is able to look up the weather for any given city using a weather

03:20.960 --> 03:21.560
API.

03:21.840 --> 03:27.000
So these different MCP servers are these processes which can carry out some capabilities.

03:27.000 --> 03:30.160
And they advertise, hey, I can do these tools.

03:30.360 --> 03:33.640
I can look up these resources, I can give you these prompts.

03:33.920 --> 03:38.560
And an MCP client running in a host takes advantage of it.

03:38.600 --> 03:41.800
And don't worry if you're a visual type, there's going to be a visual in just a second.

03:42.440 --> 03:50.320
Uh, and so yeah, to give a quick example, fetcher is the name of an MCP server that can fetch web

03:50.360 --> 03:50.840
pages.

03:50.840 --> 03:56.560
And the way it does it behind the scenes is it actually uses that playwright Microsoft product that

03:56.560 --> 04:02.560
brings up a browser heedlessly without a screen and is able to to collect a web page.

04:02.680 --> 04:05.050
And so that is the name of an MCP server.

04:05.610 --> 04:08.650
And you can configure Claude Desktop.

04:08.650 --> 04:14.850
If you want to use that you have to set up an MCP client inside Claude.

04:15.090 --> 04:21.490
And that will launch the fetcher MCP server on your computer as a separate process.

04:21.970 --> 04:25.210
And we actually did that last week with Autogen.

04:25.530 --> 04:29.050
That was the thing we did, which I sort of talked quickly through.

04:29.050 --> 04:36.610
But we we launched we can we used some autogen code to have an MCP client running within our Autogen

04:36.650 --> 04:44.570
agent, and that spawned a process on our box, which was an MCP server that was the fetcher server

04:44.570 --> 04:47.650
and that was able to bring up a headless browser.

04:48.370 --> 04:52.290
So hopefully you're halfway following me, mostly following me, hearing these new terms.

04:52.290 --> 04:55.610
It's going to be much clearer when we see it visually.

04:55.650 --> 04:56.450
Okay, let's do it.

04:56.450 --> 04:57.490
Let's look at it visually.

04:57.490 --> 05:02.050
The architecture diagram you've been waiting for, and you may have seen this a few times because anyone

05:02.050 --> 05:06.100
that's done any googling and people have seen this, but maybe now that we've walked through the terms

05:06.100 --> 05:07.300
and stuff, it's going to become clearer.

05:07.300 --> 05:10.540
And then I'm going to point out a few things that are like a common misconception.

05:10.540 --> 05:12.580
So you have your computer.

05:12.620 --> 05:14.300
That's what that big box there is.

05:14.300 --> 05:18.900
It represents your machine, your box, which is going to be an important player here.

05:19.220 --> 05:24.020
Uh, that blue box, there is a host running on your computer.

05:24.020 --> 05:29.020
Remember, whilst sometimes people use the word host to refer to a whole computer, in this case we're

05:29.020 --> 05:34.460
talking about like a host application, an MCP host is like an application that could be your desktop,

05:34.500 --> 05:40.500
it could be your agent application, it could be a cursor, the application, or many other applications

05:40.500 --> 05:43.980
that are able to to take advantage of MCP.

05:44.900 --> 05:47.620
And then we collect a couple of MCP servers.

05:47.620 --> 05:50.180
Maybe the one on the bottom left is an MCP server.

05:50.180 --> 05:53.380
That's to do with using the local file system.

05:53.420 --> 05:58.500
And the one on the bottom right is one that is able to to look for the weather using Google's weather

05:58.540 --> 05:59.180
API.

05:59.460 --> 06:01.420
Let's say, uh, okay.

06:01.860 --> 06:08.510
Well then within the host we will need to have two MCP clients, because there needs to be an MCP client

06:08.510 --> 06:11.270
in the host for every MCP server.

06:11.270 --> 06:12.870
And so that's what we have.

06:13.230 --> 06:18.230
And really those white arrows you see there, that is what MCP actually is.

06:18.270 --> 06:19.750
That is the protocol.

06:19.750 --> 06:26.910
It's a protocol for talking from a thing running in your host called the MCP client, to a process running

06:26.910 --> 06:29.710
outside your host called the MCP server.

06:29.710 --> 06:32.950
And anthropic have given libraries to help build these.

06:33.110 --> 06:37.670
But really, the MCP protocol itself is just the way that they communicate.

06:38.710 --> 06:44.550
And let's suppose we also have a remote server, a box somewhere else.

06:45.030 --> 06:52.910
Then that could also be running an MCP server, and you could have another MCP client on your host that's

06:52.910 --> 06:58.070
talking remotely to that MCP server that's running on a different server.

06:58.070 --> 07:00.270
And that would be another configuration.

07:00.670 --> 07:03.350
And so that is also something that that happens.

07:03.710 --> 07:07.360
Um, so those are the different ways that it can fit together.

07:07.480 --> 07:13.080
And now, just before I explain that the misconception that some people have about MCP, let me just

07:13.080 --> 07:14.760
quickly clarify that.

07:14.800 --> 07:20.960
You remember I said that that that box on the bottom right could be, say, an MCP server that's looking

07:20.960 --> 07:24.720
up the weather in Google using Google's weather API.

07:25.160 --> 07:30.040
Well, of course, what that means is that there is, in fact another remote computer, Google's remote

07:30.040 --> 07:36.200
computer, in this case, and we are calling a remote process on that computer to look up the weather

07:36.240 --> 07:37.880
passing in Google's API.

07:38.880 --> 07:41.160
So it is going off to another server.

07:41.600 --> 07:46.560
But in that architecture, the MCP server is running on our box.

07:47.120 --> 07:49.120
So there's two ways that this could happen.

07:49.160 --> 07:51.680
When you can see there's three different ways.

07:51.680 --> 07:53.520
Let's talk about all three different ways.

07:53.680 --> 07:57.440
On the bottom left you've got example of where the client is on.

07:57.440 --> 08:00.960
Our host is on our box, the server is on our box.

08:00.960 --> 08:04.160
And the work it's doing is happening right there on our box.

08:04.320 --> 08:05.920
That is one model.

08:06.420 --> 08:12.060
The second model is if you come a long one and you see the client is on our box, they always are.

08:12.420 --> 08:19.260
The server is also on our box, but to do its work, it's calling out to an external API like like the

08:19.260 --> 08:19.740
weather.

08:20.300 --> 08:24.780
Or it could be looking at your Google Drive, or it could be looking up stock prices or whatever.

08:24.780 --> 08:30.380
There's many, many, many MCP servers that run on your box, but call out to different APIs.

08:30.380 --> 08:34.860
But then the MCP server turns it into a tool which can be used on your host.

08:35.220 --> 08:37.700
And then the third model is that model.

08:37.740 --> 08:39.580
Now we're moving anti-clockwise.

08:39.580 --> 08:44.900
The third model is that model on the on the top right which is saying, okay, you have an MCP client

08:44.900 --> 08:50.020
on your box as always, and it's calling out to an MCP server running somewhere else.

08:50.060 --> 08:51.980
And that is the third model.

08:52.180 --> 08:54.180
And so what is the misconception?

08:54.180 --> 09:02.100
Well, the misconception is that I think when people hear about MCP servers and they hear that MCP servers

09:02.100 --> 09:08.190
are like open source and and hosted on various hubs that will have a look at they sort of assume that

09:08.190 --> 09:15.110
the architecture is that top right architecture that most of the time MCP clients are calling out to

09:15.150 --> 09:20.950
MCP servers running somewhere else, running remotely, because the word server sounds like you're talking

09:20.950 --> 09:22.790
about it running on a remote server.

09:23.190 --> 09:25.550
But that's just a bit of a of a confusion.

09:25.670 --> 09:32.550
Most of the time, it's actually quite rare that you deal with remote MCP servers.

09:33.310 --> 09:36.190
By far the most common, at least in my experience.

09:36.230 --> 09:43.030
I'd shout if this isn't your experience, but almost all the ones that I work with are either the one

09:43.070 --> 09:47.350
on the bottom left, either that model or the one next to it, and most commonly the one next to it.

09:47.390 --> 09:54.870
Most commonly, you're running an MCP server that is calling out to get stock prices to look on Google

09:54.870 --> 09:57.750
Drive to post on slack to do whatever it's doing.

09:57.750 --> 10:00.310
It's doing that by connecting remotely.

10:00.310 --> 10:05.070
But that connection is happening in an MCP server that's running on your box.

10:05.070 --> 10:07.720
That's the most common Configuration.

10:07.720 --> 10:12.400
And it's confusing because, uh, because MCP servers are provided online.

10:12.440 --> 10:13.640
Like, they're open source.

10:13.640 --> 10:15.320
You go online, there's lots of them.

10:15.320 --> 10:16.280
And people talk about that.

10:16.480 --> 10:16.960
They.

10:17.000 --> 10:18.800
Host MCP servers.

10:18.800 --> 10:22.880
But what they're talking about there is that they make MCP servers available.

10:22.960 --> 10:30.480
For you to download and run them locally on your box in order to call out to an API just like that.

10:30.520 --> 10:34.840
That diagram on the bottom, just like that diagram, that's the most common.

10:35.000 --> 10:36.520
And there are indeed cases.

10:36.560 --> 10:40.840
When you call MCP servers running remotely, and we will do one of them this week for sure.

10:40.840 --> 10:42.800
So you get to see that and experience it.

10:42.840 --> 10:44.440
And understand what that's like.

10:44.680 --> 10:48.400
But in my experience anyway, that is not as common as the.

10:48.440 --> 10:49.920
Other configurations.

10:50.080 --> 10:53.760
And I don't think people explain this this distinction often.

10:53.800 --> 10:55.120
And as I say, because.

10:55.160 --> 11:00.920
An MCP server is called a server, you might naturally think that it runs remotely when most of the

11:00.920 --> 11:01.480
time.

11:01.520 --> 11:06.240
The the client obviously runs in a box and so does the server most of the time.

11:06.280 --> 11:07.320
And so there's one more.

11:07.560 --> 11:10.890
Technical point to make about this, which is worth knowing about.

11:10.890 --> 11:15.050
You don't need to know this in any detail, but you'll see these terms all the time.

11:15.050 --> 11:16.850
So it's it's good to recognize them.

11:16.850 --> 11:22.930
At least there are these two different transport mechanisms, which are two different ways that clients

11:22.930 --> 11:25.090
and servers can communicate to each other.

11:25.090 --> 11:27.410
And in theory, there might be many more in the future.

11:27.450 --> 11:33.170
The protocol would allow for many different types of ways, but as of now, anthropic has has produced

11:33.170 --> 11:37.450
two different, uh, technical approaches for them talking to each other.

11:37.770 --> 11:43.090
And the most common and the one that needs to be used, uh, that can only be used locally, uh, for,

11:43.130 --> 11:47.850
for these kinds of connections that we've got on the, on the, on the screen right now, the first

11:47.850 --> 11:55.490
two yellow boxes, uh, is called studio or Stdio, and it stands for standard input and output.

11:55.490 --> 11:58.370
And this transport mechanism is very simple.

11:58.530 --> 12:04.570
The client spawns a new process, spawns a process to run the server.

12:04.570 --> 12:12.030
It launches something and it connects to that using that processes standard input and output just uses

12:12.070 --> 12:13.910
the input output.

12:14.070 --> 12:19.350
And that is how it sends its messages and how it gets its responses from that process.

12:19.590 --> 12:24.670
Um, and you know, that's you don't need to know that technical detail, but you do need to recognize

12:24.710 --> 12:30.070
the stdio, because when we work with this, you'll see that there'll be the terms like server stdio

12:30.150 --> 12:35.230
that will be creating to connect from our MCP clients to our MCP server.

12:35.390 --> 12:38.630
And uh, so that is one of the two mechanisms.

12:38.630 --> 12:41.270
And the other mechanism is called SSE.

12:41.790 --> 12:46.870
And SSE is saying that the connection will be over Https.

12:46.910 --> 12:49.630
So it's going to be a secure HTTP connection.

12:49.630 --> 12:52.750
And the way that data will be sent is by posting.

12:52.750 --> 12:59.470
And the way it will be received back is using a technology called Server Side Events SSE, which is

12:59.510 --> 13:06.990
actually the same technology that's used by AI labs to stream back results when you're using the API

13:06.990 --> 13:08.550
or when you're looking in the screen.

13:08.550 --> 13:14.240
It's a it's a it's a technique for long running HTTP queries that allows you to sort of drip feed back

13:14.240 --> 13:16.880
data, which is how the streaming works.

13:16.880 --> 13:20.680
So SE is the name of this connection type and it uses SSH.

13:21.440 --> 13:23.600
And uh, it's, it's a type.

13:23.600 --> 13:29.880
I do believe that you can use this transport either for remote or for, for the, for the local ones

13:29.880 --> 13:30.440
as well.

13:30.800 --> 13:34.600
Um, but you can't use stdio for the remote ones.

13:34.800 --> 13:36.320
Uh, you're not spawning a process.

13:36.320 --> 13:38.040
Obviously, it's a remote box.

13:38.240 --> 13:45.640
So, um, but generally speaking, what you see is that stdio is used for the local, uh, use cases.

13:45.680 --> 13:49.800
The first two here and SSH is used when you go remote.

13:49.800 --> 13:52.240
So we will do that, uh, this week at one point.

13:52.240 --> 13:57.600
But mostly we'll stick with stdio, which is the most common one that there is.

13:57.640 --> 14:02.280
Okay, that's enough concepts, enough terms, enough diagrams, enough architecture.

14:02.320 --> 14:03.160
I know what you want.

14:03.160 --> 14:03.960
You want to see.

14:04.000 --> 14:05.080
You want to see it happening.

14:05.080 --> 14:06.480
You want to see some code?

14:06.680 --> 14:07.680
Let's go to cursor.

14:07.680 --> 14:08.640
Let's see some code.

14:08.640 --> 14:10.080
Let's work with mic.
