langgraph-mcp
LangGraph RAG MCP
LangGraph 문서를 Model Context Protocol(MCP)을 통해 제공하는 RAG(Retrieval-Augmented Generation) 시스템입니다.
개요
이 프로젝트는 다음을 수행하는 문서 검색 시스템을 구축합니다.
공식 웹사이트에서 LangGraph 문서를 수집하고 처리합니다.
이 문서를 기반으로 시맨틱 검색용 벡터 데이터베이스를 생성합니다.
이 지식을 Model Context Protocol(MCP)을 통해 노출합니다.
VS Code, Cursor, Claude Desktop, Windsurf 같은 MCP 호환 호스트와 통합합니다.
Related MCP server: LangGraph RAG MCP
작동 방식
1. 문서 수집 및 처리 (컨텍스트)
RecursiveUrlLoader와 BeautifulSoup을 사용하여 여러 웹사이트 URL에서 LangGraph 문서를 반복적으로 스크레이핑하고 정리합니다.RecursiveCharacterTextSplitter와tiktoken을 사용하여 정확한 토큰 개수를 계산하면서 텍스트를 관리 가능한 청크로 분할합니다.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 서버 실행
With Docker 사용
서버를 실행하는 가장 쉬운 방법은 Docker Compose를 감싸는 제공된 셸 스크립트를 사용하는 것입니다.
bash run-mcp-docker.sh이 스크립트는 Docker 이미지가 없으면 빌드하고, 컨테이너를 시작한 후 그 안에서 MCP 서버를 실행합니다. 또한 MCP 통신을 위해 표준 입출력을 올바르게 처리합니다.
Without Docker 사용하지 않는 경우
Docker를 사용하지 않는 경우에는 다음 명령을 사용하여 MCP 서버를 디버그 모드로 직접 실행할 수 있습니다:
mcp dev langgraph-mcp.pyMCP 호스트 구성
호환되는 편집기에서 MCP 서버를 사용하려면 구성이 필요합니다.
VS Code
VS Code
settings.json파일을 엽니다. (명령 팔레트에서Preferences: Open User Settings (JSON)을 통해 열 수 있습니다.)파일에 다음 구성을 추가하세요.
<path-to-your-project>를 컴퓨터의langgraph-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 gradedqualityDmaintenanceRetrieval-Augmented Generation system serving LangGraph documentation through the Model Context Protocol, enabling semantic search and context-aware responses.16
- AlicenseNot gradedqualityDmaintenanceProvides RAG (Retrieval Augmented Generation) access to technical documentation through MCP, enabling LLMs to search and retrieve relevant documentation on-demand.4MIT
- AlicenseNot gradedqualityDmaintenanceEnables users to search Groq's API documentation using natural language queries through an MCP-compatible interface.MIT
Related MCP Connectors
Agentic search over your Dewey document collections from any MCP-compatible client.
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.
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/akshay2172/langgraph-rag-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server