LangGraph ReAct Agent with MCP
by langchain-ai
This template showcases a ReAct agent implemented using LangGraph and the Model Context Protocol (MCP). The agent uses MCP servers to provide tools and capabilities through a unified gateway.
Last updated: N/A
What is LangGraph ReAct Agent with MCP?
A ReAct agent implemented using LangGraph and the Model Context Protocol (MCP). It connects to an MCP gateway, discovers available tools from various MCP servers (like Filesystem and Memory servers), and uses these tools to accomplish tasks.
How to use LangGraph ReAct Agent with MCP?
- Install dependencies for the agent and gateway. 2. Configure MCP servers in
gateway/config.json
. 3. Start the gateway server. 4. Configure the agent's connection to the gateway inlanggraph.json
. 5. Open your app in LangGraph to run the agent.
Key features of LangGraph ReAct Agent with MCP
Connects to MCP gateway
Discovers available tools
Uses tools to accomplish tasks
Combines capabilities from multiple servers
Use cases of LangGraph ReAct Agent with MCP
File operations (read, write, list, search)
Knowledge graph operations (entities, relations, queries)
Automated task completion using external tools
Building intelligent agents with access to a variety of capabilities
FAQ from LangGraph ReAct Agent with MCP
Where can I find more MCP servers?
Where can I find more MCP servers?
You can find more servers in the official MCP servers repository: https://github.com/modelcontextprotocol/servers
How do I add a new MCP server?
How do I add a new MCP server?
Add its configuration to gateway/config.json, and the agent will automatically discover its tools.
How can I customize the agent?
How can I customize the agent?
Modify the system prompt in src/react_agent/prompts.py, update the agent's reasoning in src/react_agent/graph.py, or add new capabilities by including more MCP servers.
What are some available tools?
What are some available tools?
The agent has access to tools from the Filesystem server (read_file, write_file, etc.) and the Memory server (create_entities, create_relations, etc.)
Where can I find LangGraph documentation?
Where can I find LangGraph documentation?
LangGraph documentation can be found here: https://github.com/langchain-ai/langgraph