mcp-rag-server

mcp-rag-server

31

MCP RAG Server is a Python-based server that leverages the Model Context Protocol for Retrieval-Augmented Generation, enabling efficient vector searches across document types like Markdown, PowerPoint, and PDF. It integrates with PostgreSQL for managing vectorized data, offering robust indexing and query capabilities.

MCP RAG Server

MCP RAG Server is a Python server compliant with the Model Context Protocol (MCP) that provides Retrieval-Augmented Generation (RAG) functionality. It uses documents in formats like Markdown, text, PowerPoint, and PDF as data sources, indexed using the multilingual-e5-large model to enable vector searches for relevant information.

Features

  • MCP Server Implementation: Functions based on JSON-RPC over stdio, mechanism for tool registration/execution, error handling, and logging.
  • RAG Capabilities: Supports document parsing in multiple formats, maintains hierarchical directory structures, uses markitdown for document conversion, generates embeddings with multilingual-e5-large model, utilizes PostgreSQL with pgvector for vector databases, supports vector search, retrieves contextually continuous chunks, and indexes based on differences (new/changed files only).
  • Tools: Vector search tool (MCP), document count tool (MCP), index management tool (CLI).

Requirements

  • Python 3.10+
  • PostgreSQL 14+ with pgvector extension

Installation

Instruction includes setting up dependencies, PostgreSQL, and environment variables.

Usage

Guidance on starting the MCP server and utilizing CLI for indexing and searching documents.

License

The project is released under the MIT License. See the LICENSE file for more details.