Instructor: Both LangChain and MCP
has this notion and idea of tools,
and tools are simply functions that are written externally
from the AI system and from the LLM model,
and they are written by developers.
And those are simply functions that execute,
and those functions, like multiply,
they have arguments and they have return values,
and when we define tools, in both MCP and LangChain,
we need to specify what are the arguments
that the function receives.
We need to specify when should we call this function,
so this is going to be described
in the functions' description,
and we should say
what does this function return as a return value?
So again, the description is very, very important,
because this is eventually going to propagate to the LLM,
whether by the LangChain biding tools or by the MCP client,
and this is going to help
the model decide which tool to call.
So both LangChain and MCP
have a very similar idea and notion of tools.
And in LangChain we have the concept of a toolkit,
which is a collection of prebuilt tools.
And similarly we have this concept of MCP server,
which is also a collection of tools,
so we can see a lot of similarity between the two.
I want to reiterate at the end,
both via MCP or LangChain bind_tools,
we are injecting to the LMS prompt
the description of the tools,
when to invoke them, what arguments do they receive,
and what output do they output.
It is basically an interface for the AI models
to interact with external tools.
Now let's talk about the differences between them.
MCP takes this idea and it generalize it a bit,
so we not only expose tools via MCP,
but we also can expose resources.
And we discussed earlier that those resources
can be documents, PDF files, pictures,
can be also making API calls,
and it can also expose as well as prompts.
And another difference is
who we are going to expose this to.
So in LangChain, when we use the bind_tools,
we bind it to an LLM, to a large language model.
But when we use MCP,
we actually bind everything to the AI application,
like Cursor, Windsurf, Claude.
So those applications have underneath the hood an LLM,
and the client is what is going
to inject those descriptions to that LLM.
So we're not injecting it directly.
We have a couple of layers of extractions
before it's getting injected,
so we have the MCP server,
which communicates with the list of tools to the MCP client
and the MCP client,
this is what's going to inject the LLM in the application
with those instructions of the tools that we need to invoke.
Alrighty, after we discussed
the similarities and differences between LangChain and MCP,
let's talk about the LangChain MCP adapter.
And this is an open-source
that the LangChain team released,
which offers significant value
by enabling seamless integration of MCP tools
with LangChain and LangGraph.
So the key value proposition here
is that we have tool compatibility.
So we can convert MCP tools into LangChain
and LangGraph agents compatible tools.
So this allows developers to leverage existing MCP servers
that somebody else wrote in our popular
without any manual adaption.
And it also supplies us with an MCP client
that will allow us to connect to multiple MCP servers,
which is going to help us expose all their tools.
So in the next video we're going to demonstrate
and we're going to use the MCP client
that LangChain wrote for us.