Skip to main content
Glama

MCP Docs RAG Server

by kazuph

mcp-docs-rag MCP 서버

로컬 디렉토리의 문서에 대한 RAG(검색 증강 생성)

로컬 디렉터리에 저장된 문서에 대한 RAG 시스템을 구현하는 TypeScript 기반 MCP 서버입니다. 사용자가 로컬 저장소 및 텍스트 파일의 컨텍스트를 포함하는 LLM을 사용하여 문서를 쿼리할 수 있도록 합니다.

특징

자원

  • docs:// URI를 통해 문서 나열 및 액세스
  • 문서는 Git 저장소 또는 텍스트 파일일 수 있습니다.
  • 콘텐츠 액세스를 위한 일반 텍스트 MIME 유형

도구

  • list_documents - DOCS_PATH 디렉토리에 있는 모든 사용 가능한 문서를 나열합니다.
    • 모든 문서의 형식화된 목록을 반환합니다.
    • 사용 가능한 문서의 총 수를 표시합니다.
  • rag_query - RAG를 사용하여 문서 쿼리
    • document_id와 query를 매개변수로 사용합니다.
    • 문서의 컨텍스트를 사용하여 AI가 생성한 응답을 반환합니다.
  • add_git_repository - 선택적 스파스 체크아웃을 사용하여 Git 저장소를 docs 디렉토리에 복제합니다.
    • repository_url을 매개변수로 사용합니다.
    • 문서 이름을 사용자 정의하기 위한 선택적 document_name 매개변수(접미사 '-docs' 없이 간단한 설명적 이름을 사용)
    • 특정 디렉토리의 스파스 체크아웃을 위한 선택적 하위 디렉토리 매개변수
    • 저장소가 이미 존재하는 경우 최신 변경 사항을 자동으로 가져옵니다.
  • add_text_file - docs 디렉토리에 텍스트 파일을 다운로드합니다.
    • file_url을 매개변수로 사용합니다.
    • wget을 사용하여 파일을 다운로드합니다.

프롬프트

  • guide_documents_usage - 문서 및 RAG 기능 사용 방법에 대한 가이드
    • 사용 가능한 문서 목록이 포함되어 있습니다
    • RAG 기능에 대한 사용 힌트를 제공합니다.

개발

종속성 설치:

지엑스피1

서버를 빌드하세요:

npm run build

자동 재빌드를 사용한 개발의 경우:

npm run watch

설정

이 서버는 문서를 저장할 로컬 디렉터리가 필요합니다. 기본적으로 ~/docs 사용하지만 DOCS_PATH 환경 변수를 사용하여 다른 위치를 설정할 수 있습니다.

문서 구조

문서 디렉토리에는 다음이 포함될 수 있습니다.

  • Git 저장소(복제된 디렉토리)
  • 일반 텍스트 파일(.txt 확장자)

각 문서는 Google의 Gemini 임베딩을 사용하여 llama-index.ts를 사용하여 별도로 색인됩니다.

API 키

이 서버는 문서 색인 및 쿼리를 위해 Google의 Gemini API를 사용합니다. Gemini API 키를 환경 변수로 설정해야 합니다.

export GEMINI_API_KEY=your-api-key-here

Google AI Studio 웹사이트에서 Gemini API 키를 받을 수 있습니다. 이 키를 셸 프로필에 추가하거나 Claude Desktop의 환경 구성에 포함하세요.

설치

Claude Desktop과 함께 사용하려면 서버 구성을 추가하세요.

MacOS의 경우: ~/Library/Application Support/Claude/claude_desktop_config.json Windows의 경우: %APPDATA%/Claude/claude_desktop_config.json Linux의 경우: ~/.config/Claude/claude_desktop_config.json

{ "mcpServers": { "docs-rag": { "command": "npx", "args": ["-y", "@kazuph/mcp-docs-rag"], "env": { "DOCS_PATH": "/Users/username/docs", "GEMINI_API_KEY": "your-api-key-here" } } } }

/Users/username/docs 문서 디렉토리의 실제 경로로 바꿔야 합니다.

디버깅

MCP 서버는 stdio를 통해 통신하므로 디버깅이 어려울 수 있습니다. 패키지 스크립트로 제공되는 MCP Inspector를 사용하는 것이 좋습니다.

npm run inspector

검사기는 브라우저에서 디버깅 도구에 액세스할 수 있는 URL을 제공합니다.

용법

구성이 완료되면 Claude와 함께 서버를 사용하여 다음을 수행할 수 있습니다.

  1. 문서 추가 :
    Add a new document from GitHub: https://github.com/username/repository
    또는 사용자 정의 문서 이름으로:
    Add GitHub repository https://github.com/username/repository-name and name it 'framework'
    또는 특정 디렉토리의 스파스 체크아웃:
    Add only the 'src/components' directory from https://github.com/username/repository
    또는 사용자 정의 이름과 스파스 체크아웃을 결합하세요.
    Add the 'examples/demo' directory from https://github.com/username/large-repo and name it 'demo-app'
    또는 텍스트 파일을 추가합니다.
    Add this text file: https://example.com/document.txt
  2. 문서 쿼리 :
    What does the documentation say about X in the Y repository?
  3. 사용 가능한 문서 목록 :
    What documents do you have access to?

서버는 효율적인 검색을 위해 자동으로 문서 색인을 처리합니다.

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

로컬에 저장된 저장소와 RAG(검색 증강 생성) 시스템을 통해 텍스트 파일의 컨텍스트를 사용하여 LLM을 사용하여 문서를 쿼리할 수 있는 TypeScript MCP 서버입니다.

  1. 특징
    1. 자원
    2. 도구
    3. 프롬프트
  2. 개발
    1. 설정
      1. 문서 구조
      2. API 키
    2. 설치
      1. 디버깅
    3. 용법

      Related MCP Servers

      • A
        security
        A
        license
        A
        quality
        A TypeScript-based MCP server that interacts with Contentful's Delivery API, enabling users to create, query, and summarize text notes through natural language.
        Last updated -
        26
        6
        TypeScript
        MIT License
        • Apple
      • -
        security
        F
        license
        -
        quality
        A TypeScript-based MCP server that enables users to manage text notes and generate summaries, showcasing key MCP concepts like resource representation and LLM integration.
        Last updated -
        1,667
        JavaScript
        • Apple
      • -
        security
        F
        license
        -
        quality
        A TypeScript-based MCP server that enables LLM agents to interact with Gel databases through natural language, providing tools to learn database schemas, validate and execute EdgeQL queries.
        Last updated -
        5
        TypeScript
      • -
        security
        A
        license
        -
        quality
        An MCP server that provides tools to load and fetch documentation from any llms.txt source, giving users full control over context retrieval for LLMs in IDE agents and applications.
        Last updated -
        177
        Python
        MIT License
        • Apple

      View all related MCP servers

      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/kazuph/mcp-docs-rag'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server