Skip to content

weGGC/rag-mcp-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG MCP Server for GitHub Copilot

A Model Context Protocol (MCP) server that provides RAG (Retrieval-Augmented Generation) capabilities for GitHub Copilot. This allows you to process PDFs, create vector embeddings, and retrieve relevant context without using external LLM APIs.

Features

  • PDF Processing: Extract text from PDF documents and chunk them for indexing
  • Vector Embeddings: Generate embeddings using Hugging Face transformers
  • Semantic Search: Find relevant document chunks using vector similarity
  • MCP Integration: Connect directly with GitHub Copilot through MCP protocol

Setup

  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Configure GitHub Copilot to use this MCP server by adding to your VS Code settings.json:
{
  "mcp": {
    "inputs": [],
    "servers": {
      "rag-server": {
        "command": "node",
        "args": [
          "D:\\YASH\\Projects GGC\\capgemini projects\\mcp part 2\\dist\\index.js"
        ],
        "env": {}
      }
    }
  }
}

Usage

Once configured, you can use these tools in GitHub Copilot:

Add PDF Documents

@rag-server add_pdf file_path="/path/to/document.pdf"

Search Documents

@rag-server search_documents query="your search query" max_results=5

Get Context for Copilot

@rag-server get_context query="what you're working on"

How It Works

  1. PDF Processing: Uses pdf-parse to extract text from PDFs and chunks it into manageable pieces
  2. Embeddings: Generates vector embeddings using the all-MiniLM-L6-v2 model from Hugging Face
  3. Vector Store: Uses FAISS for efficient similarity search
  4. MCP Protocol: Exposes functionality through MCP tools that GitHub Copilot can call

Architecture

  • src/pdf-processor.ts: Handles PDF text extraction and embedding generation
  • src/vector-store.ts: Manages vector storage and similarity search
  • src/index.ts: Main MCP server implementation
  • src/mcp-config.json: Configuration template for GitHub Copilot

This system runs locally without requiring external API keys or cloud services.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published