Skip to content
Back to search

langgraph-mcp-agents

LangGraph-powered ReAct agent with Model Context Protocol (MCP) integration. A Streamlit web interface for dynamically configuring, deploying, and interacting with AI agents capable of accessing various data sources and APIs through MCP tools.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/braincrew-lab--langgraph-mcp-agents/badge.svg)](/listings/braincrew-lab--langgraph-mcp-agents)

HTML

<a href="/listings/braincrew-lab--langgraph-mcp-agents"><img src="/api/listings/braincrew-lab--langgraph-mcp-agents/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

You can easily run this project using Docker without setting up a local Python environment.

Requirements (Docker Desktop)

Install Docker Desktop from the link below:

- [Install Docker Desktop](https://www.docker.com/products/docker-desktop/)

Run with Docker Compose

1. Navigate to the `dockers` directory

cd dockers

2. Create a `.env` file with your API keys in the project root directory.

cp .env.example .env

Enter your obtained API keys in the `.env` file.

(Note) Not all API keys are required. Only enter the ones you need. - `ANTHROPIC_API_KEY`: If you enter an Anthropic API key, you can use "claude-3-7-sonnet-latest", "claude-3-5-sonnet-latest", "claude-3-haiku-latest" models. - `OPENAI_API_KEY`: If you enter an OpenAI API key, you can use "gpt-4o", "gpt-4o-mini" models. - `LANGSMITH_API_KEY`: If you enter a LangSmith API key, you can use LangSmith tracing.

ANTHROPIC_API_KEY=your_anthropic_api_key
OPENAI_API_KEY=your_openai_api_key
LANGSMITH_API_KEY=your_langsmith_api_key
LANGSMITH_TRACING=true
LANGSMITH_ENDPOINT=https://api.smith.langchain.com
LANGSMITH_PROJECT=LangGraph-MCP-Agents

When using the login feature, set `USE_LOGIN` to `true` and enter `USER_ID` and `USER_PASSWORD`.

USE_LOGIN=true
USER_ID=admin
USER_PASSWORD=admin123

If you don't want to use the login feature, set `USE_LOGIN` to `false`.

USE_LOGIN=false

3. Select the Docker Compose file that matches your system architecture.

**AMD64/x86_64 Architecture (Intel/AMD Processors)**

# Run container
docker compose -f docker-compose.yaml up -d

**ARM64 Architecture (Apple Silicon M1/M2/M3/M4)**

# Run container
docker compose -f docker-compose-mac.yaml up -d

4. Access the application in your browser at http://localhost:8585

(Note) - If you need to modify ports or other settings, edit the docker-compose.yaml file before building.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 224 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # LangGraph Agents + MCP
  2. [![English](https://img.shields.io/badge/Language-English-blue)](README.md) [![Korean](https://img.shields.io/badge/Language-한국어-red)](README_KOR.md)
  3. [![GitHub](https://img.shields.io/badge/GitHub-langgraph--mcp--agents-black?logo=github)](https://github.com/teddylee777/langgraph-mcp-agents)
  4. [![License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
  5. [![Python](https://img.shields.io/badge/Python-≥3.12-blue?logo=python&logoColor=white)](https://www.python.org/)
  6. [![Version](https://img.shields.io/badge/Version-0.1.0-orange)](https://github.com/teddylee777/langgraph-mcp-agents)
  7. ![project demo](./assets/project-demo.png)
  8. ## Project Overview
  9. ![project architecture](./assets/architecture.png)
  10. `LangChain-MCP-Adapters` is a toolkit provided by **LangChain AI** that enables AI agents to interact with external tools and data sources through the Model Context Protocol (MCP). This project provides a user-friendly interface for deploying ReAct agents that can access various data sources and APIs through MCP tools.
  11. ### Features
  12. - **Streamlit Interface**: A user-friendly web interface for interacting with LangGraph `ReAct Agent` with MCP tools
  13. - **Tool Management**: Add, remove, and configure MCP tools through the UI (Smithery JSON format supported). This is done dynamically without restarting the application
  14. - **Streaming Responses**: View agent responses and tool calls in real-time
  15. - **Conversation History**: Track and manage conversations with the agent
  16. ## MCP Architecture
  17. The Model Context Protocol (MCP) consists of three main components:
  18. 1. **MCP Host**: Programs seeking to access data through MCP, such as Claude Desktop, IDEs, or LangChain/LangGraph.
  19. 2. **MCP Client**: A protocol client that maintains a 1:1 connection with the server, acting as an intermediary between the host and server.
  20. 3. **MCP Server**: A lightweight program that exposes specific functionalities through a standardized model context protocol, serving as the primary data source.
  21. ## Quick Start with Docker
  22. You can easily run this project using Docker without setting up a local Python environment.
  23. ### Requirements (Docker Desktop)
  24. Install Docker Desktop from the link below:
  25. - [Install Docker Desktop](https://www.docker.com/products/docker-desktop/)
  26. ### Run with Docker Compose
  27. 1. Navigate to the `dockers` directory
  28. ```bash
  29. cd dockers
  30. ```
  31. 2. Create a `.env` file with your API keys in the project root directory.
  32. ```bash
  33. cp .env.example .env
  34. ```
  35. Enter your obtained API keys in the `.env` file.
  36. (Note) Not all API keys are required. Only enter the ones you need.
  37. - `ANTHROPIC_API_KEY`: If you enter an Anthropic API key, you can use "claude-3-7-sonnet-latest", "claude-3-5-sonnet-latest", "claude-3-haiku-latest" models.
  38. - `OPENAI_API_KEY`: If you enter an OpenAI API key, you can use "gpt-4o", "gpt-4o-mini" models.
  39. - `LANGSMITH_API_KEY`: If you enter a LangSmith API key, you can use LangSmith tracing.
  40. ```bash
  41. ANTHROPIC_API_KEY=your_anthropic_api_key
  42. OPENAI_API_KEY=your_openai_api_key
  43. LANGSMITH_API_KEY=your_langsmith_api_key
  44. LANGSMITH_TRACING=true
  45. LANGSMITH_ENDPOINT=https://api.smith.langchain.com
  46. LANGSMITH_PROJECT=LangGraph-MCP-Agents
  47. ```
  48. When using the login feature, set `USE_LOGIN` to `true` and enter `USER_ID` and `USER_PASSWORD`.
  49. ```bash
  50. USE_LOGIN=true
  51. USER_ID=admin
  52. USER_PASSWORD=admin123
  53. ```
  54. If you don't want to use the login feature, set `USE_LOGIN` to `false`.
  55. ```bash
  56. USE_LOGIN=false
  57. ```
  58. 3. Select the Docker Compose file that matches your system architecture.
  59. **AMD64/x86_64 Architecture (Intel/AMD Processors)**
  60. ```bash
  61. # Run container
  62. docker compose -f docker-compose.yaml up -d
  63. ```
  64. **ARM64 Architecture (Apple Silicon M1/M2/M3/M4)**
  65. ```bash
  66. # Run container
  67. docker compose -f docker-compose-mac.yaml up -d
  68. ```
  69. 4. Access the application in your browser at http://localhost:8585
  70. (Note)
  71. - If you need to modify ports or other settings, edit the docker-compose.yaml file before building.
  72. ## Install Directly from Source Code
  73. 1. Clone this repository
  74. ```bash
  75. git clone https://github.com/teddynote-lab/langgraph-mcp-agents.git
  76. cd langgraph-mcp-agents
  77. ```
  78. 2. Create a virtual environment and install dependencies using uv
  79. ```bash
  80. uv venv
  81. uv pip install -r requirements.txt
  82. source .venv/bin/activate # For Windows: .venv\Scripts\activate
  83. ```
  84. 3. Create a `.env` file with your API keys (copy from `.env.example`)
  85. ```bash
  86. cp .env.example .env
  87. ```
  88. Enter your obtained API keys in the `.env` file.
  89. (Note) Not all API keys are required. Only enter the ones you need.
  90. - `ANTHROPIC_API_KEY`: If you enter an Anthropic API key, you can use "claude-3-7-sonnet-latest", "claude-3-5-sonnet-latest", "claude-3-haiku-latest" models.
  91. - `OPENAI_API_KEY`: If you enter an OpenAI API key, you can use "gpt-4o", "gpt-4o-mini" models.
  92. - `LANGSMITH_API_KEY`: If you enter a LangSmith API key, you can use LangSmith tracing.
  93. ```bash
  94. ANTHROPIC_API_KEY=your_anthropic_api_key
  95. OPENAI_API_KEY=your_openai_api_key
  96. LANGSMITH_API_KEY=your_langsmith_api_key
  97. LANGSMITH_TRACING=true
  98. LANGSMITH_ENDPOINT=https://api.smith.langchain.com
  99. LANGSMITH_PROJECT=LangGraph-MCP-Agents
  100. ```
  101. 4. (New) Use the login/logout feature
  102. When using the login feature, set `USE_LOGIN` to `true` and enter `USER_ID` and `USER_PASSWORD`.
  103. ```bash
  104. USE_LOGIN=true
  105. USER_ID=admin
  106. USER_PASSWORD=admin123
  107. ```
  108. If you don't want to use the login feature, set `USE_LOGIN` to `false`.
  109. ```bash
  110. USE_LOGIN=false
  111. ```
  112. ## Usage
  113. 1. Start the Streamlit application.
  114. ```bash
  115. streamlit run app.py
  116. ```
  117. 2. The application will run in the browser and display the main interface.
  118. 3. Use the sidebar to add and configure MCP tools
  119. Visit [Smithery](https://smithery.ai/) to find useful MCP servers.
  120. First, select the tool you want to use.
  121. Click the COPY button in the JSON configuration on the right.
  122. ![copy from Smithery](./assets/smithery-copy-json.png)
  123. Paste the copied JSON string in the `Tool JSON` section.
  124. <img src="./assets/add-tools.png" alt="tool json" style="width: auto; height: auto;">
  125. Click the `Add Tool` button to add it to the "Registered Tools List" section.
  126. Finally, click the "Apply" button to apply the changes to initialize the agent with the new tools.
  127. <img src="./assets/apply-tool-configuration.png" alt="tool json" style="width: auto; height: auto;">
  128. 4. Check the agent's status.
  129. ![check status](./assets/check-status.png)
  130. 5. Interact with the ReAct agent that utilizes the configured MCP tools by asking questions in the chat interface.
  131. ![project demo](./assets/project-demo.png)
  132. ## Hands-on Tutorial
  133. For developers who want to learn more deeply about how MCP and LangGraph integration works, we provide a comprehensive Jupyter notebook tutorial:
  134. - Link: [MCP-HandsOn-KOR.ipynb](./MCP-HandsOn-KOR.ipynb)
  135. This hands-on tutorial covers:
  136. 1. **MCP Client Setup** - Learn how to configure and initialize the MultiServerMCPClient to connect to MCP servers
  137. 2. **Local MCP Server Integration** - Connect to locally running MCP servers via SSE and Stdio methods
  138. 3. **RAG Integration** - Access retriever tools using MCP for document retrieval capabilities
  139. 4. **Mixed Transport Methods** - Combine different transport protocols (SSE and Stdio) in a single agent
  140. 5. **LangChain Tools + MCP** - Integrate native LangChain tools alongside MCP tools
  141. This tutorial provides practical examples with step-by-step explanations that help you understand how to build and integrate MCP tools into LangGraph agents.
  142. ## License
  143. MIT License
  144. ## References
  145. - https://github.com/langchain-ai/langchain-mcp-adapters

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.