langgraph-mcp
LangGraph RAG MCP
LangGraph 문서를 Model Context Protocol(MCP)을 통해 제공하는 검색 증강 생성(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. 검색 시스템 (도구)
주어진 쿼리에 가장 관련성 높은 문서 청크를 찾는 검색 함수를 구현합니다
이 함수를 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
사용법
이 과정은 두 가지 주요 단계로 이루어집니다: 첫 번째는 벡터 저장소 생성을 위해 그리고 두 번째는 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 통신을 위한 표준 I/O를 올바르게 처리합니다.
Docker를 이용하지 않는 경우
Docker를 사용하지 않는다면, 다음 명령으로 MCP 서버를 dev mode로 직접 실행할 수 있습니다:
mcp dev langgraph-mcp.pyMCP 호스트 구성
이 MCP 서버를 지원되는 편집기에서 사용하려면 구성이 필요합니다.
VS Code
VS Code의
settings.json파일을 엽니다. (명령 팔레트에서Preference: 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