Skip to main content
Glama
mcp-retrieval-engine

mcp-retrieval-engine

mcp-retrieval-engine

A production-ready Model Context Protocol (MCP) server implementing a local RAG (Retrieval-Augmented Generation) pipeline. This project enables AI agents to securely search and retrieve information from local document repositories with high semantic accuracy.


Overview

Unlike standard chatbots, this system bridges the "context gap" by allowing LLMs to dynamically query private files. By using the MCP standard, the AI can decide when it needs to "look up" information in your local database before answering.

Key Features

  • Semantic Search: Uses all-MiniLM-L6-v2 embeddings to find information based on meaning, not just keywords.

  • Agentic Integration: Fully compatible with MCP-native clients like Claude Desktop and Cursor.

  • Local-First Privacy: All document indexing and vector searches are performed on-device via ChromaDB.

  • Multi-Format Support: Native parsing for PDF, TXT, and Markdown files.


Related MCP server: Personal Semantic Search MCP

Architecture & Algorithm

The system operates in two distinct phases:

  1. Ingestion: Documents are loaded, split into 500-character chunks using Recursive Character Splitting, and converted into 384-dimensional vectors.

  2. Retrieval: When a tool is called, the system performs a Cosine Similarity search between the user's query vector and the document vectors stored in the local database.


Tech Stack

Layer

Technology

Language

Python 3.10+

Protocol

FastMCP (Model Context Protocol SDK)

Orchestration

LangChain

Vector DB

ChromaDB (Persistent)

Embeddings

Sentence-Transformers


Project Structure

mcp-retrieval-engine/
├── data/           # Raw document storage (.pdf, .txt, .md)
├── chroma_db/      # Persistent vector database
├── src/
│   ├── main.py       # MCP Server entry point and tool definitions
│   └── processor.py  # RAG Engine: Chunking and Retrieval logic
└── pyproject.toml  # Dependency management via uv


Getting Started

1. Installation

Ensure you have uv installed, then sync the environment:

uv sync

2. Ingesting Data

Place your documents in the /data directory and run the indexing tool through the MCP Inspector:

mcp inspector src/main.py

3. Claude Desktop Integration

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "local-retriever": {
      "command": "python",
      "args": ["/absolute/path/to/src/main.py"]
    }
  }
}


Impact

This project demonstrates the ability to build AI Infrastructure that solves data privacy and context window limitations in enterprise and academic workflows.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to search and query PDF documents through a local RAG system with vector embeddings. Provides semantic document search capabilities while keeping all data stored locally without external dependencies.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables semantic search over local notes and documents using natural language queries. Supports multiple file types (Markdown, Python, HTML, JSON, CSV, text) with fast local embeddings and persistent ChromaDB vector storage.
      1
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables semantic search across documents and code repositories using RAG (Retrieval-Augmented Generation) with vector embeddings. Automatically indexes PDF documents and performs relevance-scored lookups through ChromaDB and sentence transformers.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides token-efficient semantic search and document retrieval by indexing PDFs, text, and markdown files into local notebooks using ChromaDB. It enables AI agents to query relevant passages from large documents through local embedding models like Hugging Face or Ollama.
      1
      MIT