langgraph-mcp
LangGraph RAG MCP
Model Context Protocol(MCP)を介して LangGraph のドキュメントを提供する、検索拡張生成(RAG)システムです。
概要
このプロジェクトは、以下のドキュメント検索システムを構築します。
公式ウェブサイトからLangGraph のドキュメントを収集・処理します。
このドキュメントからセマンティック検索用のベクトルデータベースを作成します。
Model Context Protocol(MCP)を通じてこの知識を公開します。
VS Code、Cursor、Claude Desktop、Windsurf などのMCP 互換ホストと統合します。
Related MCP server: AI Research Assistant MCP Server
仕組み
1. ドキュメントの収集と処理(Context)
RecursiveUrlLoaderと BeautifulSoup を使用して、複数のウェブサイト URL から LangGraph ドキュメントを再帰的にスクレイピングしてクレンジングします。正確なトークン数をカウントするため
tiktokenを使用し、RecursiveCharacterTextSplitterでテキストを管理可能なチャンクに分割します。BAAI/bge-large-en-v1.5エンベディングを使用して、チャンクをベクトル表現に埋め込みます。効率的な検索のために、
SKLearnVectorStoreにベクトルを保存します。
2. 検索システム(Tool)
指定されたクエリに対して最も関連性の高いドキュメントチャンクを見つける検索関数を実装します。
この関数を Claude などの言語モデルと統合し、コンテキストに応じた応答を提供します。
出典情報と関連コンテキストを含む、整形された応答を返します。
3. MCP サーバーの統合
fastmcpライブラリを使用して、検索ツールを MCP サーバーでラップします。検索関数を、MCP 互換ホストが使用できるツールとして公開します。
検索システムと追加リソース(完全なドキュメントファイルなど)の両方へのアクセスを提供します。
必要条件
Python 3.10+
Docker と Docker Compose(推奨)
Anthropic API キー(Claude モデル用)
インストールとセットアップ
このプロジェクトは、Docker(推奨)またはローカル Python 環境のどちらでも実行できます。
Docker を使用する場合(推奨)
このリポジトリをクローンします:
git clone https://github.com/yourusername/langraph-rag-mcp.git cd langraph-rag-mcp.envファイルに API キーを設定します: プロジェクトのルートに.envファイルを作成し、Anthropic API キーを追加してください:echo "ANTHROPIC_API_KEY=your_api_key_here" > .envdocker-compose.ymlファイルは、この環境変数を自動的に読み込みます。
ローカル環境(Docker を使用しない場合)
このリポジトリをクローンします:
git clone https://github.com/yourusername/langraph-rag-mcp.git cd langraph-rag-mcp仮想環境を作成して有効化します:
conda create -n mcp python=3.13 conda activate mcp必要なパッケージをインストールします:
pip install -r requirements.txt.envファイルに API キーを設定します:echo "ANTHROPIC_API_KEY=your_api_key_here" > .env
使用方法
このプロセスは、主に 2 つのステップで構成されます。まずベクトルストアを生成し、次に MCP サーバーを実行します。
ステップ 1: ベクトルストアを生成する
この手順は、一度だけ、またはドキュメントを更新したいときに行います。
Jupyter 環境で
rag-tool.ipynbノートブックを開いて実行します。これにより、以下が行われます:
最新の LangGraph ドキュメントをダウンロードします。
完全なドキュメントを
llms_full.txtに保存します。ドキュメントをチャンクに分割します。
sklearn_vectorstore.parquetにベクトルストアを作成して永続化します。
ステップ 2: MCP サーバーを実行する
Docker を使用する場合
サーバーを実行する最も簡単な方法は、Docker Compose をラップした提供済みのシェルスクリプトを使用することです。
bash run-mcp-docker.shこのスクリプトは、Docker イメージが存在しない場合はビルドし、コンテナを起動して、その内部で MCP サーバーを実行します。MCP 通信用の標準入出力を正しく処理します。
Docker を使用しない場合
Docker を使用しない場合は、次のコマンドで MCP サーバーを dev モードで直接実行できます:
mcp dev langgraph-mcp.pyMCP ホストの設定
この MCP サーバーを互換性のあるエディターで使用するには、設定が必要です。
VS Code
VS Code の
settings.jsonファイルを開きます。(コマンドパレットからPreferences: Open User Settings (JSON)で見つけることができます)。以下の設定をファイルに追加します。
<path-to-your-project>を、お使いの環境のlangraph-rag-mcpディレクトリの絶対パスに必ず置き換えてください。
"mcp.servers": [
{
"name": "langgraph-mcp",
"command": [
"/bin/bash",
"<path-to-your-project>/run-mcp-docker.sh"
],
"env": {
"ANTHROPIC_API_KEY": "<your-anthropic-api-key>"
}
}
]Docker を使用しない場合は、command を次のように変更します:
"command": [
"<path-to-your-conda-env>/bin/python",
"<path-to-your-project>/langgraph-mcp.py"
]システムアーキテクチャ
(Phase 1: Data Ingestion - Performed once on Host Machine)
┌─────────────┐ ┌──────────────────┐ ┌───────────────────────────────┐
│ LangGraph │ │ Jupyter Notebook │ │ Vector Store & Full Docs │
│ Docs (Web) │───▶ │ (rag-tool.ipynb) │───▶ │ (.parquet & .txt files) │
└─────────────┘ └──────────────────┘ └───────────────────────────────┘
(Phase 2: Live RAG System - Request/Response Flow)
┌──────────────┐ ┌─────────────┐
│ VS Code │ │ .env file │
│(User Interface)│ │ (API KEY) │
└──────┬───────┘ └──────┬──────┘
│ 1. User Query │ (provides)
▼ │
┌──────┴───────────────────────────────────────────┴───────────────────────────────┐
│ Host Machine Boundary │
│ │
│ ┌────────────────────┐ ┌─────────────────────────────────────────┐ │
│ │ run-mcp-docker.sh │ 2. Execs │ 🐳 Docker Container │ │
│ │ (Entrypoint Script)│────▶ │ │ │
│ └────────────────────┘ │ ┌───────────────────────────────────┐ │ │
│ │ │ 🐍 Python MCP Server │ │ │
│ ▲ ◀─┼──│ (langgraph-mcp.py) │ │ │
│ │ 7. Final Response │ └───────────────┬───────────────────┘ │ │
│ │ │ │ 3. Reads Data From │ │
│ └───────────────────────────────│──────────────────│─────────────────────┘ │
│ │ │ │
│ │ ▼ │
│ │ ┌───────────────────────────────────┐ │
│ (files mounted from Host) ············ │ Mounted Vector Store & Docs │ │
│ │ └───────────────────────────────────┘ │
│ └─────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────────────────────┘
│ 4. API Call
│ (sends augmented prompt)
▼
┌────────────────────┐
│ ☁️ Anthropic API │
│ (Claude LLM) │
└──────────┬─────────┘
│ 5. Generation
│
◀························
6. Returns Response
(to MCP Server)リソース
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA customized MCP server that enables integration between LLM applications and documentation sources, providing AI-assisted access to LangGraph and Model Context Protocol documentation.
- FlicenseNot gradedqualityDmaintenanceAn MCP-based AI agent that retrieves and processes documents to answer queries using a RAG pipeline with LangChain and Claude models. It enables document indexing, context-aware retrieval, and multi-tool orchestration for research and knowledgebase applications.1
- FlicenseNot gradedqualityDmaintenanceAn MCP-compatible RAG backend using LangGraph and FastAPI, enabling chaining of AI model logic with document context search.1
- FlicenseNot gradedqualityDmaintenanceRetrieval-Augmented Generation system serving LangGraph documentation through the Model Context Protocol, enabling semantic search and context-aware responses.16
Related MCP Connectors
Query any docs site via MCP. Submit a URL, ask questions, get cited answers.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Turn a GitHub repo or docs site into agent-ready context: pack it or search it, over MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jaynt27/langgraph-rag-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server