WEBVTT

00:00.150 --> 00:02.670
Instructor: Both LangChain and MCP

00:02.670 --> 00:06.150
has this notion and idea of tools,

00:06.150 --> 00:10.440
and tools are simply functions that are written externally

00:10.440 --> 00:14.010
from the AI system and from the LLM model,

00:14.010 --> 00:16.260
and they are written by developers.

00:16.260 --> 00:18.750
And those are simply functions that execute,

00:18.750 --> 00:21.000
and those functions, like multiply,

00:21.000 --> 00:23.850
they have arguments and they have return values,

00:23.850 --> 00:27.600
and when we define tools, in both MCP and LangChain,

00:27.600 --> 00:30.240
we need to specify what are the arguments

00:30.240 --> 00:32.220
that the function receives.

00:32.220 --> 00:34.740
We need to specify when should we call this function,

00:34.740 --> 00:36.720
so this is going to be described

00:36.720 --> 00:38.370
in the functions' description,

00:38.370 --> 00:39.720
and we should say

00:39.720 --> 00:42.900
what does this function return as a return value?

00:42.900 --> 00:46.650
So again, the description is very, very important,

00:46.650 --> 00:50.490
because this is eventually going to propagate to the LLM,

00:50.490 --> 00:54.990
whether by the LangChain biding tools or by the MCP client,

00:54.990 --> 00:56.280
and this is going to help

00:56.280 --> 00:58.530
the model decide which tool to call.

00:58.530 --> 01:00.960
So both LangChain and MCP

01:00.960 --> 01:05.163
have a very similar idea and notion of tools.

01:06.720 --> 01:09.930
And in LangChain we have the concept of a toolkit,

01:09.930 --> 01:13.470
which is a collection of prebuilt tools.

01:13.470 --> 01:17.400
And similarly we have this concept of MCP server,

01:17.400 --> 01:20.760
which is also a collection of tools,

01:20.760 --> 01:24.150
so we can see a lot of similarity between the two.

01:24.150 --> 01:26.220
I want to reiterate at the end,

01:26.220 --> 01:30.060
both via MCP or LangChain bind_tools,

01:30.060 --> 01:34.170
we are injecting to the LMS prompt

01:34.170 --> 01:36.450
the description of the tools,

01:36.450 --> 01:39.390
when to invoke them, what arguments do they receive,

01:39.390 --> 01:41.910
and what output do they output.

01:41.910 --> 01:44.910
It is basically an interface for the AI models

01:44.910 --> 01:46.953
to interact with external tools.

01:50.100 --> 01:54.210
Now let's talk about the differences between them.

01:54.210 --> 01:58.380
MCP takes this idea and it generalize it a bit,

01:58.380 --> 02:01.260
so we not only expose tools via MCP,

02:01.260 --> 02:04.260
but we also can expose resources.

02:04.260 --> 02:07.110
And we discussed earlier that those resources

02:07.110 --> 02:11.070
can be documents, PDF files, pictures,

02:11.070 --> 02:13.920
can be also making API calls,

02:13.920 --> 02:17.340
and it can also expose as well as prompts.

02:17.340 --> 02:19.260
And another difference is

02:19.260 --> 02:22.950
who we are going to expose this to.

02:22.950 --> 02:25.740
So in LangChain, when we use the bind_tools,

02:25.740 --> 02:30.330
we bind it to an LLM, to a large language model.

02:30.330 --> 02:33.090
But when we use MCP,

02:33.090 --> 02:36.510
we actually bind everything to the AI application,

02:36.510 --> 02:39.360
like Cursor, Windsurf, Claude.

02:39.360 --> 02:43.740
So those applications have underneath the hood an LLM,

02:43.740 --> 02:46.200
and the client is what is going

02:46.200 --> 02:49.380
to inject those descriptions to that LLM.

02:49.380 --> 02:51.810
So we're not injecting it directly.

02:51.810 --> 02:54.030
We have a couple of layers of extractions

02:54.030 --> 02:55.740
before it's getting injected,

02:55.740 --> 02:57.750
so we have the MCP server,

02:57.750 --> 03:01.410
which communicates with the list of tools to the MCP client

03:01.410 --> 03:02.850
and the MCP client,

03:02.850 --> 03:07.050
this is what's going to inject the LLM in the application

03:07.050 --> 03:11.700
with those instructions of the tools that we need to invoke.

03:11.700 --> 03:13.740
Alrighty, after we discussed

03:13.740 --> 03:17.610
the similarities and differences between LangChain and MCP,

03:17.610 --> 03:21.000
let's talk about the LangChain MCP adapter.

03:21.000 --> 03:22.320
And this is an open-source

03:22.320 --> 03:23.880
that the LangChain team released,

03:23.880 --> 03:26.190
which offers significant value

03:26.190 --> 03:30.150
by enabling seamless integration of MCP tools

03:30.150 --> 03:32.640
with LangChain and LangGraph.

03:32.640 --> 03:34.950
So the key value proposition here

03:34.950 --> 03:37.680
is that we have tool compatibility.

03:37.680 --> 03:41.093
So we can convert MCP tools into LangChain

03:41.093 --> 03:44.190
and LangGraph agents compatible tools.

03:44.190 --> 03:48.540
So this allows developers to leverage existing MCP servers

03:48.540 --> 03:51.420
that somebody else wrote in our popular

03:51.420 --> 03:54.810
without any manual adaption.

03:54.810 --> 03:57.720
And it also supplies us with an MCP client

03:57.720 --> 04:01.860
that will allow us to connect to multiple MCP servers,

04:01.860 --> 04:04.923
which is going to help us expose all their tools.

04:06.150 --> 04:08.820
So in the next video we're going to demonstrate

04:08.820 --> 04:11.490
and we're going to use the MCP client

04:11.490 --> 04:12.963
that LangChain wrote for us.
