Logo di Langgraph MCP Agents

Langgraph MCP Agents

Organizzazione
braincrew-lab

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.

Autorebraincrew-lab
Repositorylanggraph-mcp-agents
LinguaPython
Fork
227
Stelle
716
Strumenti disponibili
0
Tipo di trasportostdio
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Langgraph MCP Agents mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    716 stelle e 227 fork nel repository collegato.

LangGraph Agents + MCP

English Korean

GitHub License Python Version

project demo

Project Overview

project architecture

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.

Features

  • Streamlit Interface: A user-friendly web interface for interacting with LangGraph ReAct Agent with MCP tools
  • Tool Management: Add, remove, and configure MCP tools through the UI (Smithery JSON format supported). This is done dynamically without restarting the application
  • Streaming Responses: View agent responses and tool calls in real-time
  • Conversation History: Track and manage conversations with the agent

MCP Architecture

The Model Context Protocol (MCP) consists of three main components:

  1. MCP Host: Programs seeking to access data through MCP, such as Claude Desktop, IDEs, or LangChain/LangGraph.

  2. MCP Client: A protocol client that maintains a 1:1 connection with the server, acting as an intermediary between the host and server.

  3. MCP Server: A lightweight program that exposes specific functionalities through a standardized model context protocol, serving as the primary data source.

Quick Start with Docker

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:

Run with Docker Compose

  1. Navigate to the dockers directory
bash
cd dockers
  1. Create a .env file with your API keys in the project root directory.
bash
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.
bash
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.

bash
USE_LOGIN=true
USER_ID=admin
USER_PASSWORD=admin123

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

bash
USE_LOGIN=false
  1. Select the Docker Compose file that matches your system architecture.

AMD64/x86_64 Architecture (Intel/AMD Processors)

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

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

bash
# Run container
docker compose -f docker-compose-mac.yaml up -d
  1. 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.

Install Directly from Source Code

  1. Clone this repository
bash
git clone https://github.com/teddynote-lab/langgraph-mcp-agents.git
cd langgraph-mcp-agents
  1. Create a virtual environment and install dependencies using uv
bash
uv venv
uv pip install -r requirements.txt
source .venv/bin/activate  # For Windows: .venv\Scripts\activate
  1. Create a .env file with your API keys (copy from .env.example)
bash
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.
bash
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
  1. (New) Use the login/logout feature

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

bash
USE_LOGIN=true
USER_ID=admin
USER_PASSWORD=admin123

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

bash
USE_LOGIN=false

Usage

  1. Start the Streamlit application.
bash
streamlit run app.py
  1. The application will run in the browser and display the main interface.

  2. Use the sidebar to add and configure MCP tools

Visit Smithery to find useful MCP servers.

First, select the tool you want to use.

Click the COPY button in the JSON configuration on the right.

copy from Smithery

Paste the copied JSON string in the Tool JSON section.

Click the Add Tool button to add it to the "Registered Tools List" section.

Finally, click the "Apply" button to apply the changes to initialize the agent with the new tools.

  1. Check the agent's status.

check status

  1. Interact with the ReAct agent that utilizes the configured MCP tools by asking questions in the chat interface.

project demo

Hands-on Tutorial

For developers who want to learn more deeply about how MCP and LangGraph integration works, we provide a comprehensive Jupyter notebook tutorial:

This hands-on tutorial covers:

  1. MCP Client Setup - Learn how to configure and initialize the MultiServerMCPClient to connect to MCP servers
  2. Local MCP Server Integration - Connect to locally running MCP servers via SSE and Stdio methods
  3. RAG Integration - Access retriever tools using MCP for document retrieval capabilities
  4. Mixed Transport Methods - Combine different transport protocols (SSE and Stdio) in a single agent
  5. LangChain Tools + MCP - Integrate native LangChain tools alongside MCP tools

This tutorial provides practical examples with step-by-step explanations that help you understand how to build and integrate MCP tools into LangGraph agents.

License

MIT License

References

Usa MCP Langgraph MCP Agents con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Langgraph MCP Agents, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Langgraph MCP Agents come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Langgraph MCP Agents.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "langgraph-mcp-agents": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Langgraph MCP Agents, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Langgraph MCP Agents.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Langgraph MCP Agents per aiutarmi con questa attività?
Langgraph MCP Agents
Certo. Ho letto.
Ecco cosa ho trovato con Langgraph MCP Agents.

Domande frequenti

A cosa serve il server MCP Langgraph MCP Agents?

Langgraph MCP Agents è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare Langgraph MCP Agents MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Langgraph MCP Agents con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Langgraph MCP Agents con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Langgraph MCP Agents, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego Langgraph MCP Agents MCP a TypingMind?

Langgraph MCP Agents funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre Langgraph MCP Agents MCP in TypingMind?

Langgraph MCP Agents mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare Langgraph MCP Agents MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Langgraph MCP Agents richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇