Content
# LangGraph Dynamic MCP Agents



[](https://langgraph-studio.vercel.app/templates/open?githubUrl=https://github.com/langchain-ai/react-agent)
## Project Overview
> Chat Interface

`LangGraph Dynamic MCP Agents` is a project that implements a ReAct agent that can access various external tools and data sources through the Model Context Protocol (MCP). This project is based on LangGraph's ReAct agent and provides an interface to easily add and configure MCP tools.

### Key Features
**Dynamic Tool Configuration Dashboard**
You can access the tool configuration dashboard by visiting `http://localhost:2025`.

**Add Tool** tab allows you to add tools by copying and pasting the JSON configuration of the MCP tool from [Smithery](https://smithery.io).

----
**Real-time Updates**
Changes made to the tool configuration dashboard are reflected in real-time.

**System Prompt Configuration**
You can configure the system prompt by modifying the `prompts/system_prompt.yaml` file.
This change is also reflected dynamically.

If you want to modify the system prompt set for the agent, simply modify the contents of the `prompts/system_prompt.yaml` file.
----
### Key Features
* **LangGraph ReAct Agent**: ReAct agent based on LangGraph
* **Real-time Dynamic Tool Management**: Easily add, remove, and configure MCP tools (supports Smithery JSON format)
* **Real-time Dynamic System Prompt Configuration**: Easily modify the system prompt (dynamically reflected)
* **Conversation History**: Track and manage conversations with the agent
* **TeddyFlow Integration**: Chat interface integration
* **Docker Image Build**: Build Docker image
* **localhost Support**: Run on localhost (chat interface integration)
## Installation
1. Clone the repository
```bash
git clone https://github.com/teddynote-lab/langgraph-dynamic-mcp-agents
cd langgraph-dynamic-mcp-agents
```
2. Configure the `.env` file
Copy the `.env.example` file to `.env` and add the necessary API keys.
```bash
cp .env.example .env
```
Set `LLM_PROVIDER` in the `.env` file.
Options: `ANTHROPIC`, `OPENAI`, `AZURE_OPENAI`
```
LLM_PROVIDER=AZURE_OPENAI
```
The following API keys are required (depending on the chosen `LLM_PROVIDER`):
* `ANTHROPIC_API_KEY`: Anthropic API key
* `OPENAI_API_KEY`: OpenAI API key
* `AZURE_OPENAI_API_KEY`: Azure OpenAI API key
* `AZURE_OPENAI_ENDPOINT`: Azure OpenAI endpoint
3. Configure MCP tools
Set the MCP tools to be used by the model based on the `mcp_config.json` file in the `mcp-config` folder.
You can set up the MCP tools in JSON format in advance. This process can also be done through the tool configuration dashboard.
Here is an example:
```json
{
"mcpServers": {
"perplexity-search": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@arjunkmrm/perplexity-search",
"--key",
"Enter SMITHERY_API_KEY"
],
"transport": "stdio"
},
"get_current_time": {
"command": "python",
"args": [
"/app/resources/mcp_server_time.py"
],
"transport": "stdio"
}
}
}
```
4. Add `.py` files as MCP `stdio` servers
- (Reference) Check the `mcp_server_time.py` file in the `resources` folder.
1. Add custom-written `.py` files to the `resources` folder and write code to run them as `stdio` servers.
2. Modify the file path when adding to `mcp-config/mcp_config.json`.
**Rules**
`./resources/file.py` > `/app/resources/file.py`
For example, if you want to add the `./resources/mcp_server_time.py` file:
```json
"get_current_time": {
"command": "python",
"args": [
"/app/resources/mcp_server_time.py"
],
"transport": "stdio"
}
```
6. Add tools registered on Smithery
You can easily add MCP tools from [Smithery](https://smithery.ai/) by bringing their JSON configurations.
1. Visit the [Smithery](https://smithery.io) website and select the tool you want to use.
2. Click the 'COPY' button on the right side of the tool page to copy the JSON configuration.

3. Open the `mcp_config.json` file and add the copied JSON.
> Paste the copied content.

## Run the Application
Once all configurations are complete, you can run the application with the following command:
> Windows (PowerShell)
```bash
docker compose build --no-cache; docker-compose up -d
```
> Mac / Linux
```bash
docker compose build --no-cache && docker-compose up -d
```
**Access Addresses**
* TeddyFlow Integration: https://teddyflow.com/
* Chat Interface: `http://localhost:2024`
* Tool Configuration Dashboard: `http://localhost:2025`
## Connect to teddyflow.com
1. Sign up on teddyflow.com.
During sign-up, enter `teddynote-youtube` as the "beta key" to sign up without approval.

2. Click the "Connect New App" button after logging in.

3. Enter the app name and click the "Connect" button.
4. Select "LangGraph" and enter the following information:
- Endpoint: `http://localhost:2024`
- Graph: `agent`

5. Click the "Save" button after completing the connection settings.
6. Click the "Connect App" button to save.
## Custom Logo and Branding
We have launched custom features for companies/communities.

If you're interested in introducing this, please contact us at service@brain-crew.com for assistance.
## License
Apache License 2.0 ([LICENSE](LICENSE))
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
firecrawl
Firecrawl MCP Server enables web scraping, crawling, and content extraction.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.