
hirokiyn/mcp-langgraph
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
LangGraph 에이전트 튜토리얼은 MCP 서버를 사용하도록 설계되었습니다.
개요
이것은 전통적인 LangChain 도구 대신 서버를 사용하여 구현 한 도구의 최소 기능 예입니다. 공식 LangGraph 튜토리얼을 기반으로 MCP 서버를 도구로 통합하는 방법을 설명합니다. 이 repo를 빨리 MCP 도구를 사용하여 자신의 LangGraph 에이전트를 구축! * 에이전트 상태 및 메시지 라우팅 관리를위한 LangGraph 통합. * MCP 서버를 사용하여 도구에 액세스 할 수 있습니다. * 수학 및 날씨에 대한 MCP 서버를 포함합니다. * 에이전트와 상호 작용하는 명령행 인터페이스를 제공합니다. 2. Poetry를 사용하여 의존도를 설치하십시오. 1. .env 파일에 Anthropic API 키를 설정합니다. 존재하지 않는 경우 이 파일을 만들 필요가 있습니다. 예를 들면: * 수학 서버: python src/mcp servers/math server.py * 날씨 서버: python src/mcp servers/weather server.py 2. 대리인을 실행하십시오: 이것은 상호 작용하는 형태에 있는 대리인을 시작합니다. 그런 다음 프롬프트를 입력하고 에이전트는 MCP 서버에서 제공하는 도구를 사용하여 응답합니다.
개요(AI 번역)
MCP (Model Context Protocol) 서버 대신 기존의 LangChain 도구로 구현된 도구로 LangGraph**에 의해 구동되는 ** 시약의 최소 기능 예입니다. 공식 LangGraph 튜토리얼을 기반으로 MCP 서버를 도구로 통합하는 방법을 설명합니다.
this 이 repo를 ** skeleton ** 신속하게 MCP 도구를 사용하여 자신의 LangGraph 에이전트를 구축!
특징
- 에이전트 상태 및 메시지 라우팅 관리를위한 LangGraph 통합.
- MCP 서버를 사용하여 도구에 액세스 할 수 있습니다.
- 수학 및 날씨에 대한 MCP 서버를 포함합니다.
- 에이전트와 상호 작용하는 명령행 인터페이스를 제공합니다.
설치
-
저장소를 복제:
-
Poetry를 사용하여 의존도를 설치하십시오.
사용법
-
Anthropic API 키 설정
.env파일. 존재하지 않는 경우 이 파일을 만들 필요가 있습니다. 예를 들면: -
MCP 서버 시작:
- 수학 서버:
python src/mcp_servers/math_server.py - 날씨 서버:
python src/mcp_servers/weather_server.py
- 대리인을 실행하십시오:
이것은 상호 작용하는 형태에 있는 대리인을 시작합니다. 그런 다음 프롬프트를 입력하고 에이전트는 MCP 서버에서 제공하는 도구를 사용하여 응답합니다.
예
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
MCP + LangGraph Agent
This is a minimal, functional example of an agent powered by LangGraph with tools implemented using MCP (Model Context Protocol) servers instead of traditional LangChain tools. It’s based on the official LangGraph tutorial, adapted to demonstrate how to integrate MCP servers as tools.
🧠 Use this repo as a skeleton to quickly build your own LangGraph agent with MCP tools!
Features
flowchart TD
__start__ --> chatbot
chatbot -.-> tools
chatbot -.-> __end__
tools --> chatbot
- Integrates LangGraph for managing agent state and message routing.
- Uses MCP servers to provide access to tools.
- Includes example MCP servers for math and weather.
- Provides a command-line interface for interacting with the agent.
Installation
-
Clone the repository:
git clone -
Install the dependencies using Poetry:
poetry install
Usage
-
Set the Anthropic API key in the
.envfile. You may need to create this file if it doesn’t exist. For example:ANTHROPIC_API_KEY=your_api_key -
Start the MCP servers:
- Math server:
python src/mcp_servers/math_server.py - Weather server:
python src/mcp_servers/weather_server.py
- Math server:
-
Run the agent:
poetry run mainThis will start the agent in interactive mode. You can then enter prompts, and the agent will respond using the tools provided by the MCP servers.
Example
User: What's (3 + 5) x 12?
Assistant: The result of (3 + 5) × 12 = 96
User: What is the weather in New York?
Assistant: It's always sunny in New York.
MCP Server Configuration
The MCP servers are configured in src/main.py. You can modify the configuration to add or remove servers, or to change the transport mechanism.
LLM Configuration
The LLM used by the agent can be changed in src/common.py.
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →