EL

esxr/langgraph-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

586 stars 111 forks 品質 56 トレンド 21MIT

MCP用のLangGraph解答テンプレート

概要

モデルコンテキストプロトコル(MCP)は、LLMアプリケーションと外部のデータソースやツール間のシームレスな統合を可能にするオープンプロトコルです。AI搭載IDEの構築、チャットインターフェースの強化、カスタムAIワークフローの作成など、MCPはLLMに必要なコンテキストを標準化して接続する方法を提供します。MCPはAIアプリケーションのUSB-Cポートのようなものと考えられます。USB-Cがデバイスを様々な周辺機器やアクセサリーに標準化接続するのと同様に、MCPはAIモデルを異なるデータソースやツールに標準化して接続する方法を提供します。 LangGraphは、言語モデルを複雑なワークフローやアプリケーションにシームレスに統合できるように設計されたフレームワークです。モジュール性と柔軟性を重視しています。ワークフローはグラフで表現されます。ノードはアクション、ツール、またはモデルクエリに対応します。エッジはそれらの間の情報の流れを定義します。

概要(AI 翻訳)

モデルコンテキストプロトコル(MCP)は、LLMアプリケーションと外部のデータソースやツール間のシームレスな統合を可能にするオープンプロトコルです。AI搭載IDEの構築、チャットインターフェースの強化、カスタムAIワークフローの作成など、MCPはLLMに必要なコンテキストを標準化して接続する方法を提供します。MCPはAIアプリケーションのUSB-Cポートのようなものと考えられます。USB-Cがデバイスを様々な周辺機器やアクセサリーに標準化接続するのと同様に、MCPはAIモデルを異なるデータソースやツールに標準化して接続する方法を提供します。

LangGraphは、言語モデルを複雑なワークフローやアプリケーションにシームレスに統合できるように設計されたフレームワークです。モジュール性と柔軟性を重視しています。ワークフローはグラフで表現されます。ノードはアクション、ツール、またはモデルクエリに対応します。エッジはそれらの間の情報の流れを定義します。LangGraphは構造化されながらも動的なタスク実行方法を提供し、自然言語理解、自動化、意思決定を含むAIアプリケーションの作成に最適です。

以前の記事では、LangGraphの検索エージェントテンプレートを改良し、AIソリューションの開発と展開を図りました。

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Universal Assistant built with LangGraph and Model Context Protocol (MCP)

Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you’re building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.

LangGraph is a framework designed to enable seamless integration of language models into complex workflows and applications. It emphasizes modularity and flexibility. Workflows are represented as graphs. Nodes correspond to actions, tools, or model queries. Edges define the flow of information between them. LangGraph provides a structured yet dynamic way to execute tasks, making it ideal for writing AI applications involving natural language understanding, automation, and decision-making.

In this earlier article we enhanced LangGraph’s retrieval agent template to develop and deploy an AI solution.

In this project, we combine LangGraph with MCP to build our own Universal Assistant. For our universal assistant we implement a multi-agent pattern as follows:

Assistant receives the user message and decides the agent to use. The agent node decides the right tool to use, and calls the tool on the MCP server. Since all our agents are based on MCP, a single MCP-Agent node is sufficient for LLM based orchestraion, and another single node is sufficient to work with MCP servers to invoke their tools.

Development Setup

  1. Create and activate a virtual environment

    git clone https://github.com/esxr/langgraph-mcp.git
    cd langgraph-mcp
    python3 -m venv .venv
    source .venv/bin/activate
    
  2. Install Langgraph CLI

    pip install -U "langgraph-cli[inmem]"
    

    Note: “inmem” extra(s) are needed to run LangGraph API server in development mode (without requiring Docker installation)

  3. Install the dependencies

    pip install -e .
    
  4. Configure environment variables

    cp env.example .env
    

    Add your OPENAI_API_KEY, GITHUB_PERSONAL_ACCESS_TOKEN etc. to the .env

GitHub で README 全文を見る

インストール

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

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →