- Explore MCP Servers
- langchain-mcp-tools-py-usage
Langchain Mcp Tools Py Usage
What is Langchain Mcp Tools Py Usage
langchain-mcp-tools-py-usage is a simple Model Context Protocol (MCP) client built using LangChain and Python. It demonstrates the use of MCP server tools through the LangChain ReAct Agent.
Use cases
Use cases include building conversational agents, integrating multiple AI tools, and enhancing applications with advanced language models.
How to use
To use langchain-mcp-tools-py-usage, first install the dependencies using ‘make install’. Then, set up your API key by copying the .env.template to .env and updating it as needed. Finally, run the application with ‘make start’.
Key features
Key features include the ability to initialize multiple MCP servers in parallel and convert their tools into a list of LangChain-compatible tools. It utilizes Anthropic’s ‘claude-3-7-sonnet-latest’ as the LLM.
Where to use
langchain-mcp-tools-py-usage can be used in various fields such as AI development, natural language processing, and any application requiring integration with MCP servers.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Langchain Mcp Tools Py Usage
langchain-mcp-tools-py-usage is a simple Model Context Protocol (MCP) client built using LangChain and Python. It demonstrates the use of MCP server tools through the LangChain ReAct Agent.
Use cases
Use cases include building conversational agents, integrating multiple AI tools, and enhancing applications with advanced language models.
How to use
To use langchain-mcp-tools-py-usage, first install the dependencies using ‘make install’. Then, set up your API key by copying the .env.template to .env and updating it as needed. Finally, run the application with ‘make start’.
Key features
Key features include the ability to initialize multiple MCP servers in parallel and convert their tools into a list of LangChain-compatible tools. It utilizes Anthropic’s ‘claude-3-7-sonnet-latest’ as the LLM.
Where to use
langchain-mcp-tools-py-usage can be used in various fields such as AI development, natural language processing, and any application requiring integration with MCP servers.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MCP Tools Usage From LangChain / Example in Python 
This simple Model Context Protocol (MCP)
client demonstrates the use of MCP server tools by LangChain ReAct Agent.
It leverages a utility function convert_mcp_to_langchain_tools() from
langchain_mcp_tools.
This function handles parallel initialization of specified multiple MCP servers
and converts their available tools into a list of LangChain-compatible tools
(list[BaseTool]).
Anthropic’s claude-3-7-sonnet-latest is used as the LLM.
For convenience, code for OpenAI’s o3-mini is also included and commented out.
A bit more realistic (conversational) MCP Client is available
here
A typescript equivalent of this MCP client is available
here
Prerequisites
- Python 3.11+
- [optional]
uv(uvx)
installed to run Python package-based MCP servers - [optional] npm 7+ (
npx)
to run Node.js package-based MCP servers - API key from Anthropic
(or OpenAI)
Usage
-
Install dependencies:
make install -
Setup API key:
cp .env.template .env- Update
.envas needed. .gitignoreis configured to ignore.env
to prevent accidental commits of the credentials.
- Update
-
Run the app:
make start
It takes a while on the first run.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










