mcpField
L
LangGraph Agent with MCP

LangGraph Agent with MCP

Local
github.com/galaxyxyz5AI & Agents2Updated 81w ago

About LangGraph Agent with MCP

LangGraph Agent with MCP connects a LangGraph agent to MCP servers for dynamic access to external tools, data, and APIs. It supports automatic tool discovery and multiple servers, with examples including web search and YouTube summaries.

Key features

  1. 01Connects LangGraph agents to MCP servers
  2. 02Discovers tools automatically
  3. 03Supports multiple servers
  4. 04Includes web search and YouTube summary tasks

Use cases

  1. 01Add external tools to a LangGraph agent
  2. 02Search the web through connected servers
  3. 03Summarize YouTube videos

MCP support

The project runs an MCP server and connects to it through an MCP client. The agent can discover and use tools from multiple MCP servers.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

LangGraph Agent with MCP

This project is designed to efficiently integrate Model Context Protocol (MCP) with a LangGraph Agent, allowing it to dynamically access external tools, data sources, and APIs.

Using this project, you can connect a LangGraph agent to MCP servers and use predefined tools to perform various tasks, such as web searches and summarizing YouTube videos. You can also add additional servers as needed.

This integration enables automatic tool discovery and multi-server support, making AI systems more modular and powerful. It allows AI systems to automatically find tools and connect to multiple servers, increasing their flexibility and efficiency.

image

What is MCP and Why It Matters?

The Model Context Protocol (MCP) is an open standard that provides a structured way for AI applications to interact with external data, tools, and APIs. MCP was developed by Anthropic to address the challenge of dynamically connecting LLMs to external data sources without requiring custom integrations for each tool.

MCP is important because it helps AI systems share and access data easily, removing barriers between different tools. This makes AI more connected and efficient. It also allows developers to build smarter AI systems that can work with many different tools and grow easily.

Project Structure

langgraph_mcp/
│-- agent.py  
│-- servers/
│   ├── tavily.py          
│   ├── yt_transcript.py   
│   ├── math_server.py 
│   ├──weather.py
│-- .env          
│-- requirements.txt   

Installation

  1. Clone the Repository:
git clone https://github.com/your-repo/langgraph-mcp.git
cd langgraph-mcp
  1. Install Dependencies
pip install -r requirements.txt
  1. Create a .env file and add:
TAVILY_API_KEY=<your-tavily-api-key>
OPENAI_API_KEY=<your-openai-api-key>

How It Works

To start, run servers/server.py in your terminal. This will start the MCP server. Then, in a new terminal, run agent.py. The agent will connect to the server via the MCP client and execute your query, as shown in the demo.

https://github.com/user-attachments/assets/c65255a1-62af-4711-8f10-ebfdacd9b3c6

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.