Markdown RAG MCP

Markdown RAG MCP

Provides semantic search over markdown documentation using RAG, allowing natural language queries and integration with MCP clients.

Category
Visit Server

README

Markdown RAG MCP

A Retrieval-Augmented Generation (RAG) MCP server for markdown documentation with semantic search capabilities.

๐ŸŽฏ Core Capabilities

  • Document Indexing: Process markdown files with YAML frontmatter support, automatic chunking, and metadata extraction
  • Semantic Search: Find relevant content using natural language queries with configurable similarity thresholds
  • Incremental Updates: Change detection and indexing for large document collections
  • Real-time Monitoring: Automatic file system monitoring with live index updates
  • Advanced Embeddings: HuggingFace sentence-transformers with local model execution
  • Vector Storage: High-performance Milvus vector database with Docker Compose setup
  • CLI Interface: Beautiful command-line tools with progress tracking and interactive demos

๐Ÿค– MCP Server Integration

This system is designed as an MCP server, providing a search tool with semantic search functionality accessible via MCP protocol.

๐Ÿ—๏ธ Architecture

For the full system architecture and components overview, check the Architecture Guide.

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.12+
  • Docker and Docker Compose

Installation

  1. Clone and setup:

    git clone <repository-url>
    cd markdown-rag-mcp
    
  2. Start Milvus database:

    docker-compose -f docker/docker-compose.yml up -d
    
  3. Install dependencies using uv

    uv sync
    
  4. Install the package:

    pip install -e .
    

Basic Usage

CLI Interface

# Index documents (with optional monitoring)
markdown-rag-mcp index ./documents --recursive --watch

# Semantic search with confidence scoring
markdown-rag-mcp search "authentication setup" --limit 5

# System health monitoring
markdown-rag-mcp status

For the full overview of the CLI interface, check the CLI Guide.

Demo Scripts

# Experience incremental indexing with performance metrics
python examples/incremental_indexing_demo.py --setup --runs 5

# Complete RAG pipeline demonstration
python examples/milvus_embeddings_demo.py

For the full list of demo scripts, check the Examples Guide.

๐Ÿ”ง Configuration

Configure via environment variables or .env file, you can use .env.example for some defaults:

# Vector Database Configuration
MARKDOWN_RAG_MCP_MILVUS_HOST=localhost
MARKDOWN_RAG_MCP_MILVUS_PORT=19530
MARKDOWN_RAG_MCP_COLLECTION_NAME=markdown_docs

# Embedding Model Settings
MARKDOWN_RAG_MCP_EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
MARKDOWN_RAG_MCP_EMBEDDING_DEVICE=auto  # cpu, cuda, mps, auto
MARKDOWN_RAG_MCP_EMBEDDING_DIMENSIONS=384

# Search and Processing
MARKDOWN_RAG_MCP_SIMILARITY_THRESHOLD=0.7
MARKDOWN_RAG_MCP_CHUNK_SIZE_LIMIT=1000
MARKDOWN_RAG_MCP_CHUNK_OVERLAP=200
MARKDOWN_RAG_MCP_MAX_CONCURRENT_INDEXING=2

# File Monitoring
MARKDOWN_RAG_MCP_WATCH_DEBOUNCE_SECONDS=2
MARKDOWN_RAG_MCP_WATCH_PATTERNS="**/*.md,**/*.markdown"

๐Ÿ“ Project Structure

markdown-rag-mcp/
โ”œโ”€โ”€ src/markdown_rag_mcp/         # Core library implementation
โ”‚   โ”œโ”€โ”€ cli/                      # Command-line interface
โ”‚   โ”œโ”€โ”€ config/                   # Configuration management
โ”‚   โ”œโ”€โ”€ core/                     # RAG engine and interfaces
โ”‚   โ”œโ”€โ”€ embeddings/               # Embedding providers
โ”‚   โ”œโ”€โ”€ indexing/                 # Document processing pipeline
โ”‚   โ”œโ”€โ”€ models/                   # Data models and schemas
โ”‚   โ”œโ”€โ”€ monitoring/               # File system monitoring
โ”‚   โ”œโ”€โ”€ parsers/                  # Markdown and frontmatter parsing
โ”‚   โ”œโ”€โ”€ search/                   # Query processing and search
โ”‚   โ””โ”€โ”€ storage/                  # Vector database integration
โ”œโ”€โ”€ tests/                        # Comprehensive test suite
โ”œโ”€โ”€ examples/                     # Demo scripts
โ”œโ”€โ”€ docker/                       # Docker Compose configuration
โ”œโ”€โ”€ specs/                        # Technical specifications
โ””โ”€โ”€ documents/                    # Markdown documents for indexing and searching

๐Ÿงช Testing

To run the test suite, use the following commands:

# Run complete test suite
uv sync --all-extras
pytest

# Run specific component tests
pytest tests/indexing/ -v
pytest tests/search/ -v
pytest tests/embeddings/ -v

๐Ÿ“š Documentation

๐Ÿ“„ License

MIT License - see LICENSE file for details.


Built with โค๏ธ for developers who need intelligent, markdown-based document search capabilities

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured