WEBVTT

00:00.000 --> 00:00.833
Instructor: All right,

00:00.833 --> 00:04.980
so I'm in the MCP doc official GitHub repository,

00:04.980 --> 00:07.860
and here we have an explanation and diagram

00:07.860 --> 00:11.640
of how this MCP server works and what does it actually do.

00:11.640 --> 00:15.630
It's going to leverage llms.txt of documentation

00:15.630 --> 00:17.490
of public documentation of packages,

00:17.490 --> 00:19.890
for example, LangGraph has one

00:19.890 --> 00:22.320
and it's going to help our agent,

00:22.320 --> 00:25.860
whether it's Cursor, Windsurf or Claude desktop,

00:25.860 --> 00:27.870
going to give them the ability

00:27.870 --> 00:31.650
to fetch the most up-to-date documentation.

00:31.650 --> 00:33.000
So this is very useful

00:33.000 --> 00:36.360
because you know, documentation of open source project,

00:36.360 --> 00:38.790
especially in the generative AI field,

00:38.790 --> 00:40.350
they change constantly.

00:40.350 --> 00:43.740
And if we'll index them manually, then what will happen,

00:43.740 --> 00:46.770
they will get out-of-date very, very quickly.

00:46.770 --> 00:49.260
So this actually gives us the ability

00:49.260 --> 00:51.060
to fetch them dynamically

00:51.060 --> 00:52.950
because we're going to scrape them

00:52.950 --> 00:54.900
from their official website,

00:54.900 --> 00:57.180
which is supposed to be up to date.

00:57.180 --> 00:58.920
So how does it really work?

00:58.920 --> 01:02.910
So first it has access to this llm.txt tool,

01:02.910 --> 01:04.860
which has a bunch of URLs

01:04.860 --> 01:08.640
and explanation of what do those URL represent,

01:08.640 --> 01:10.320
which topic do they cover.

01:10.320 --> 01:12.570
And if we'll take an analogy to a book,

01:12.570 --> 01:15.420
it's going to be the first page of the book with the index

01:15.420 --> 01:18.030
of every chapter and a quick explanation

01:18.030 --> 01:20.640
of what does this chapter cover.

01:20.640 --> 01:24.390
So this is the first step of the MCP server.

01:24.390 --> 01:27.390
The second step is to figure out which URL

01:27.390 --> 01:30.060
do we need according to the user's question

01:30.060 --> 01:32.310
and then to fetch that relevant information

01:32.310 --> 01:34.650
by simply making a curl request.

01:34.650 --> 01:36.990
So if we'll use this MCP server,

01:36.990 --> 01:38.973
no more stale documentation.

01:40.470 --> 01:43.920
So to run this MCP server, it's implemented in Python.

01:43.920 --> 01:47.400
So we'll download UV if you don't have it installed.

01:47.400 --> 01:50.070
And now we want to go and open the terminal,

01:50.070 --> 01:53.160
clone this code here and install the dependencies.

01:53.160 --> 01:54.690
So let's go and do that.

01:54.690 --> 01:58.890
So let me go here and let me open the terminal.

01:58.890 --> 02:02.310
I'm going to go to my directory of my MCP servers

02:02.310 --> 02:04.773
and let me just go and clone that.

02:06.240 --> 02:08.010
So we're simply cloning the code

02:08.010 --> 02:10.290
of the repository we just saw.

02:10.290 --> 02:12.930
All right, let's go and cd into it.

02:12.930 --> 02:14.070
And now let's go.

02:14.070 --> 02:17.190
And according to documentation, let's go and install

02:17.190 --> 02:19.500
the dependencies because it's using UV.

02:19.500 --> 02:22.590
So first I'll create a virtual environment

02:22.590 --> 02:25.350
and I'll activate it so you can see

02:25.350 --> 02:28.740
now on the left side here we have mcpdoc.

02:28.740 --> 02:30.870
So this is my virtual environment.

02:30.870 --> 02:32.550
Now we need to install the dependencies

02:32.550 --> 02:34.113
in all the relevant packages.

02:35.310 --> 02:37.170
And by the way, all the dependencies

02:37.170 --> 02:41.043
are going to be described in the UV.log file over here.

02:42.270 --> 02:44.550
Alright, so all of them installed

02:44.550 --> 02:46.950
and let's go and take the UV path.

02:46.950 --> 02:50.730
And I wrote which UV in order to give the full path

02:50.730 --> 02:52.473
of the UV execution file.

02:54.210 --> 02:57.360
So let's go back to the docs and let's first test

02:57.360 --> 03:00.450
and have a sanity check of this web server.

03:00.450 --> 03:03.690
And here we have the command to run it locally

03:03.690 --> 03:06.360
with an llm.txt of our choice.

03:06.360 --> 03:10.140
And here it's using the LangGraph llm.txt

03:10.140 --> 03:12.030
that we showed earlier.

03:12.030 --> 03:15.420
So let me just copy that and paste this command over here

03:15.420 --> 03:20.133
and it should run locally the MCP server in port 8082.

03:25.650 --> 03:27.723
And we can see it's running.

03:28.770 --> 03:31.530
All right, let's create another instance of terminal.

03:31.530 --> 03:33.990
And here we want to run MCP inspector

03:33.990 --> 03:37.230
to debug a bit this MCP server.

03:37.230 --> 03:41.670
And let's go down in the formal GitHub a repository here

03:41.670 --> 03:45.300
and we're going to have here the command to run inspector.

03:45.300 --> 03:47.970
So let's go simply paste it NPX

03:47.970 --> 03:50.520
and to run the inspector, I'm going to click Y

03:50.520 --> 03:52.533
to install the dependencies.

03:53.850 --> 03:55.920
Let me just fast forward this a bit

03:55.920 --> 03:57.870
'cause it can take a couple of minutes.

04:04.590 --> 04:09.590
Alright, so we have on port 3000, the MCP Inspector.

04:10.080 --> 04:13.710
So now we want to connect to our SSE server,

04:13.710 --> 04:17.790
which is running on port 8082, which is currently running.

04:17.790 --> 04:20.200
So let's go and click connect

04:22.470 --> 04:26.580
and let's check out the tools that this MCP server exposes.

04:26.580 --> 04:28.470
Going to click here on list tools

04:28.470 --> 04:31.170
and we have here two tools, list doc sources,

04:31.170 --> 04:34.320
which is going to show us what is the URL

04:34.320 --> 04:36.600
to the llm.txt file.

04:36.600 --> 04:41.490
So we can then make HTTP request and fetch the information

04:41.490 --> 04:43.230
and scrape that page.

04:43.230 --> 04:45.870
So you can see this is the URL over here

04:45.870 --> 04:47.700
and the other one is fetch docs.

04:47.700 --> 04:50.760
Let me try this with the llm.txt,

04:50.760 --> 04:53.280
which is going to receive a URL

04:53.280 --> 04:55.170
and it's going to retrieve all the content

04:55.170 --> 04:58.020
from that URL by scraping it.

04:58.020 --> 05:00.600
And what we can see here is the content

05:00.600 --> 05:04.680
of the LangGraph llm.txt file that we scraped

05:04.680 --> 05:06.750
with the fetch doc store.

05:06.750 --> 05:10.857
And we can see here all the URLs from the llm.txt

05:10.857 --> 05:14.190
and the agent is going to then extract those URLs

05:14.190 --> 05:17.370
and it's going to run the fetch docs for those URLs

05:17.370 --> 05:21.360
to get the relevant documentation dynamically.

05:21.360 --> 05:22.193
Cool.

05:22.193 --> 05:25.440
So let's go now and integrate everything

05:25.440 --> 05:27.570
with Claude desktop.

05:27.570 --> 05:28.800
So I'm gonna go to settings

05:28.800 --> 05:30.450
and I'm going to show you that I don't have

05:30.450 --> 05:32.580
any MCPs configured right now.

05:32.580 --> 05:35.550
So you can see my MCP servers is empty

05:35.550 --> 05:37.800
and I want to show you

05:37.800 --> 05:40.980
what is going to be without this MCP.

05:40.980 --> 05:44.490
So I'm going to ask a question, what is LangGraph memory?

05:44.490 --> 05:47.550
So now Claude Desktop is going to answer

05:47.550 --> 05:48.990
from its trained data

05:48.990 --> 05:52.320
and what it has on memory on LangGraph.

05:52.320 --> 05:55.890
So notice it may seem like a correct response,

05:55.890 --> 05:58.500
but eventually this response is not grounded

05:58.500 --> 06:00.600
in real time data and in the latest

06:00.600 --> 06:03.030
because it is dependent on the data

06:03.030 --> 06:04.530
that the model was trained on.

06:05.490 --> 06:07.110
Alright, let's continue the generation

06:07.110 --> 06:08.940
and let's check out the response.

06:08.940 --> 06:12.810
And by the way, this response actually may seem okay,

06:12.810 --> 06:14.850
it will go stale very, very quickly,

06:14.850 --> 06:17.948
especially when the rapid pace of LangGraph

06:17.948 --> 06:20.193
and LangChain packages are being updated.

06:21.240 --> 06:22.073
Cool.

06:22.073 --> 06:25.920
So now we want to add to Claude Desktop,

06:25.920 --> 06:29.010
the MCP server we just ran.

06:29.010 --> 06:32.160
So let's go again to settings and to developer

06:32.160 --> 06:34.833
and open the MCP settings config file.

06:35.700 --> 06:39.180
And here we want to paste in the snippet from the repo

06:39.180 --> 06:43.710
telling the client how to run this MCP server.

06:43.710 --> 06:45.420
So let's scroll down a bit

06:45.420 --> 06:48.030
and we got this snippet over here

06:48.030 --> 06:50.550
and let's simply go and paste it.

06:50.550 --> 06:54.600
Here we are running our server with UVX and the arguments

06:54.600 --> 06:55.800
we're going to tell it to run it

06:55.800 --> 06:58.830
from the MCP doc directory.

06:58.830 --> 07:02.070
The URLs that are going to store the llm.txt

07:02.070 --> 07:05.040
are going to be for the LangGraph documentation over here.

07:05.040 --> 07:06.990
We can change it if we want.

07:06.990 --> 07:10.950
The transport layer is going to be via stdio

07:10.950 --> 07:14.610
and the port is going to be 8081.

07:14.610 --> 07:16.890
And notice that the transport layer

07:16.890 --> 07:20.010
when we ran the server earlier was SSE,

07:20.010 --> 07:22.530
but now we change it to stdio.

07:22.530 --> 07:24.540
So both will work.

07:24.540 --> 07:26.790
Now it's time to restart Claude Desktop.

07:26.790 --> 07:30.273
And let's see if our MCP server got loaded.

07:32.880 --> 07:35.160
And we can see we have some errors here

07:35.160 --> 07:38.280
and for some reason we can't run UVX.

07:38.280 --> 07:41.490
So we get an ENOENT error

07:41.490 --> 07:44.730
and we can open the error logs, have some indication

07:44.730 --> 07:48.780
of what went wrong and if we'll scroll down a bit,

07:48.780 --> 07:52.350
we can see that we have a problem running the UVX command.

07:52.350 --> 07:57.350
So to do that, I'm going to go back again to my repository.

07:57.720 --> 08:00.270
I'm going to activate my virtual environment

08:00.270 --> 08:03.660
and I'm going to run the command which UVX

08:03.660 --> 08:06.990
to give the full pass of the UVX executable.

08:06.990 --> 08:09.600
And I'm going to put that over here.

08:09.600 --> 08:13.713
And now let's go and let's restart Claude Desktop again.

08:23.070 --> 08:26.790
All right, so it seemed to load the MCP server

08:26.790 --> 08:30.420
and if we'll click on the icon right over here,

08:30.420 --> 08:34.203
we can see we have the llm.txt MCP server.

08:36.990 --> 08:41.850
And as a sanity check, let's go and check out the settings

08:41.850 --> 08:44.400
and the MCP server we have here to see

08:44.400 --> 08:47.220
that everything is okay and this looks fine.

08:47.220 --> 08:50.973
And let's try to run what is langgraph memory?

08:56.130 --> 08:57.960
Now we can see from the response

08:57.960 --> 08:59.670
that nothing really changed here.

08:59.670 --> 09:03.300
So I have an issue with my MCP server

09:03.300 --> 09:06.390
and clicking on the tool button here shows the tools

09:06.390 --> 09:08.040
that our server exposes.

09:08.040 --> 09:09.540
And this looks fine.

09:09.540 --> 09:11.850
And after debugging it a bit offline,

09:11.850 --> 09:15.870
I figured out that when running the UVX command,

09:15.870 --> 09:18.870
I needed to specify the absolute path

09:18.870 --> 09:21.120
to where the code is stored

09:21.120 --> 09:23.670
because I don't know from which directory it's being run.

09:23.670 --> 09:26.880
So I want to give the absolute path here.

09:26.880 --> 09:30.060
All right, so let's go and restart Claude

09:30.060 --> 09:32.253
and let's see if it fixes the issue.

09:38.160 --> 09:42.393
Let's now write what is LangGraph memory.

09:48.180 --> 09:51.870
And boom, we can see now we are trying to activate

09:51.870 --> 09:53.310
the tool here.

09:53.310 --> 09:55.440
Now notice the tool we're trying to run here,

09:55.440 --> 09:57.810
Claude Desktop, the agent is trying to run

09:57.810 --> 10:00.090
the list doc sources tool.

10:00.090 --> 10:02.520
And because we initialized this code

10:02.520 --> 10:05.670
with the LangGraph documentation,

10:05.670 --> 10:08.760
so that's the built-in URL when we initialize the server,

10:08.760 --> 10:10.890
we are not running it with any arguments

10:10.890 --> 10:14.430
and we can see now the results that we got from this tool.

10:14.430 --> 10:17.790
So here we got that the LangGraph URL,

10:17.790 --> 10:21.780
the URL to the llm.txt is this here URL.

10:21.780 --> 10:24.300
And now the next tool that should run

10:24.300 --> 10:27.180
if everything in the agent is working correctly

10:27.180 --> 10:30.390
is going to be to scrape that URL data.

10:30.390 --> 10:32.970
So let's go and see what happens.

10:32.970 --> 10:35.670
And cool, now we're trying to fetch the documentation

10:35.670 --> 10:38.790
with the URL we got from the previous tool.

10:38.790 --> 10:41.820
So you can see that the URL we're passing into this tool

10:41.820 --> 10:45.630
is going to be the LangGraph llm.txt

10:45.630 --> 10:47.370
So I'm going to allow it

10:47.370 --> 10:50.340
and we're going to scrape the information from there

10:50.340 --> 10:52.710
and we're going to see all the information

10:52.710 --> 10:55.110
from the llm.txt.

10:55.110 --> 10:56.853
So let's go and allow it.

10:57.690 --> 10:59.670
And here we can see the result,

10:59.670 --> 11:04.050
which is the content of the llm.txt, which we script.

11:04.050 --> 11:06.990
So the content here is simply the topics

11:06.990 --> 11:08.490
and the URLs for those topics.

11:08.490 --> 11:10.680
I'm not going to show everything here,

11:10.680 --> 11:13.410
but the next step that the agent is going to do,

11:13.410 --> 11:16.950
it's going to find the relevant URL that we need to scrape.

11:16.950 --> 11:19.080
So the URL that talks about memory

11:19.080 --> 11:21.510
and it's going to scrape that URL again.

11:21.510 --> 11:26.010
So let's see if it invokes now the fetch docs tool again,

11:26.010 --> 11:27.750
however, with a different URL.

11:27.750 --> 11:30.400
And you can see this is exactly what's happening here

11:31.290 --> 11:33.207
and we are going to scrape now

11:33.207 --> 11:36.510
the langgraph/concepts/memory.

11:36.510 --> 11:38.430
So let's go and allow it

11:38.430 --> 11:42.873
and get the content, real-time content, this time of memory.

11:46.500 --> 11:49.410
So now it's going to fetch the information

11:49.410 --> 11:52.080
and here we have now the summary

11:52.080 --> 11:54.630
of what's LangGraph memory, however, this time

11:54.630 --> 11:56.730
it's grounded in real time information

11:56.730 --> 11:59.130
from the official LangGraph documentation

11:59.130 --> 12:03.390
and we got it in real time with the MCP server.

12:03.390 --> 12:04.770
So this is very cool

12:04.770 --> 12:08.970
and it helps us ground our answers in the real,

12:08.970 --> 12:11.010
real time documentation.

12:11.010 --> 12:12.243
Very cool in my opinion.
