MJ

mr-jay-wei/my-langgraph-agent

API development

This page was translated automatically. Technical details may differ from the original. View the original

35 stars 9 forks Quality 42 Trend 12

LangGraph Agent integrates with MCP Server to realize AI intelligent chatbot projects

Overview

This is an intelligent chatbot project built on LangGraph and LangChain, featuring tool invoking capabilities and ReAct inference modes. The bot can obtain real-time information by calling various tools, such as weather queries, historical event queries, web searches, etc., providing users with accurate and timely answers. The project specifically demonstrates how to integrate the Model Context Protocol (MCP) server into a ReAct Agent built on LangGraph, enabling large language models to autonomously call MCP tools. - 🤖 : Natural language understanding and generation based on large language models - 🔧 : Supports integration of various external tools, including weather queries, search engines, historical event queries, etc. - 🧠 : Adopts a circular inference-action-observation model to provide a structured thought process - 📊 : Real-time monitoring and statistics of API call token usage - 💬 : Supports multi-turn conversations to maintain contextual coherence - 🌐 : Includes FastAPI backend services to support user information queries - 🔌 : Supports seamless integration with Model Context Protocol server tools - ⚡ : Offers both synchronous and asynchronous implementation to meet different performance requirements 1. - Intelligent proxy built on LangGraph, supporting tool invocation and inference 2. - Servers offering various tool functions, such as BMI calculation, weather queries, etc. 3. - Converting MCP tools into an adaptation layer for LangChain tool format 4. - Providing API services such as user information queries - All tools (native functions, API services, MCP services) must provide standardized interfaces - Each tool must have a clear name - Each tool must have a detailed description - Each tool must define a clear parameter structure (args) This standardization enables large models to understand tool functions and call them correctly, while also enabling seamless integration of tools from different sources. ## Environmental Requirements - Python 3.10+ (recommended 3.10.18) - conda environment: mcp_env - Python 3.13+ (recommended 3.13.5) - conda environment: langgraph_env The server will run on http://127.0.0.1:8083/my-custom-path and provides the following tools: - calculate_bmi - Calculate BMI index - get_current_time - Get current time - get_weather - Get weather conditions for the specified city

Overview (machine translated)

Project Overview

This is an intelligent chatbot project built on LangGraph and LangChain, featuring tool invoking capabilities and ReAct inference modes. The bot can obtain real-time information by calling various tools, such as weather queries, historical event queries, web searches, etc., providing users with accurate and timely answers. The project specifically demonstrates how to integrate the Model Context Protocol (MCP) server into a ReAct Agent built on LangGraph, enabling large language models to autonomously call MCP tools.

Main Features

  • 🤖 Intelligent Dialogue: Natural language understanding and generation based on large language models
  • 🔧 Tool Calls: Supports integration of various external tools, including weather queries, search engines, historical event queries, and more
  • 🧠 ReAct Reasoning: Uses a reasoning-action-observation cycle to provide a structured thought process
  • 📊 Token Statistics: Real-time monitoring and statistics on API call Token usage
  • 💬 Dialogue Memory: Supports multi-turn dialogues to maintain contextual coherence
  • 🌐 API Service: Includes FastAPI backend services, supporting user information queries
  • 🔌 MCP Integration: Supports seamless integration with Model Context Protocol server tools
  • ⚡ Synchronous/Asynchronous: Offers both synchronous and asynchronous implementations to meet different performance requirements

Project Architecture

This project includes the following core components:

  1. LangGraph ReAct Agent - An intelligent agent built on LangGraph, supporting tool invocation and inference
  2. MCP Server - A server offering various tool functions, such as BMI calculation, weather queries, and more
  3. MCP Tool Adapter - Converts MCP tools into an adaptation layer for LangChain tool format
  4. FastAPI Service - Provides user information query and other API services

Project Structure

Core Philosophy

The core concept of the entire project is tool standardization:

  • All tools (native functions, API services, MCP services) must provide standardized interfaces
  • Each tool must have a clear name (tool name)
  • Each tool must have detailed description (tool description)
  • Each tool must define a clear parameter structure (args)

This standardization enables large models to understand tool functions and call them correctly, while also enabling seamless integration of tools from different sources. ## Environmental Requirements

The project includes two main environments:

MCP Server Environment

  • Python 3.10+ (recommended 3.10.18)
  • Conda environment: mcp_env

LangGraph Agent Environment

  • Python 3.13+ (recommended 3.13.5)
  • Conda environment: langgraph_env

Dependency package installation

MCP Server Environment

LangGraph Agent Environment

Additional dependencies in asynchronous environments

This page was translated automatically. Technical details may differ from the original.

Install

This server does not publish a one-line install command.

Open the repository installation guide New to MCP? Start with the mcpskill.org guide →