MCP-Markdown-RAG
Provides integration with Milvus vector database for storing and retrieving document embeddings, enabling semantic search across indexed markdown documents.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP-Markdown-RAG search for 'quantum computing' in my notes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
A Model Context Protocol (MCP) server that provides a local-first RAG engine for your markdown documents. This server uses a file-based Milvus vector database to index your notes, enabling Large Language Models (LLMs) to perform semantic search and retrieve relevant content from your local files.
This project is in active development. The API and implementation are subject to change. We are exploring future enhancements, including a potential port to an Obsidian plugin for seamless vault integration.
π― Key Features
β Local-First & Private: All your data is processed and stored locally. Nothing is sent to a third-party service for indexing.
β Semantic Search for Markdown: Go beyond simple keyword search. Find document sections based on conceptual meaning.
β MCP Compatible: Integrates with any MCP-supported host application like Claude Desktop, Windsurf, or Cursor.
β
Simple Tooling: Provides two straightforward tools (index_documents and search) for managing and querying your knowledge base.
Related MCP server: MCP RAG Server
βοΈ How It Works
The server operates in two main phases, exposing its functionality through MCP tools.
Indexing:
The
index_documentstool is called with a path to your markdown files.The server reads the documents, splits them into logical chunks (e.g., by headings), and converts each chunk into a vector embedding.
These embeddings, along with their metadata (original text, file path), are stored in a local Milvus vector database.
You can run it in two modes:
Full Reindex (force_reindex=True): Clears and rebuilds the entire index from scratch.
Incremental Update (force_reindex=False, default): Automatically detects and re-indexes only changed files by comparing them against a tracking log. Deleted or modified chunks are pruned and replaced to keep the index up-to-date.
Recursive Indexing (recursive=False, default): Recursively indexes all subdirectories.
Searching:
When you ask a question in a host application, it uses the
searchtool.The server converts your query into a vector embedding.
It then performs a similarity search against the Milvus database to find the most semantically relevant document chunks.
The results are returned to the LLM, providing it with the context needed to answer your question accurately.
π οΈ Available Tools
index_documentsDescription: Indexes Markdown documents for semantic search. Converts each file into structured vector chunks and inserts them into the Milvus database.
Incremental Indexing: Automatically reindexes only changed files unless force_reindex=True is passed.
Arguments:
directory(string, optional): The path to the folder containing .md files. Defaults to current directory.force_reindex(boolean, optional): If True, clears and rebuilds the full index. Defaults to False.recursive(boolean, optional): If True, recursively indexes all subdirectories. Defaults to False.
searchDescription: Searches the indexed documents using semantic similarity.
Arguments:
query(string, required): Your natural language query.limit(integer, optional): Max number of chunks to return (default is usually 5β10).
π Installation & Setup
This server requires UV (for running the Python server).
Step 1: Get the Server Code
Clone this repository to your local machine:
git clone https://github.com/Zackriya-Solutions/MCP-Markdown-RAG.gitStep 2: Configure Your Host App
Configure your MCP host application (e.g., Windsurf, Claude.app) to use the server. Add the following to your settings file:
{
"mcpServers": {
"markdown_rag": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/MCP-Markdown-RAG",
"run",
"server.py"
]
}
}
}Note: Replace
/ABSOLUTE/PATH/TO/MCP-Markdown-RAGwith the absolute path to where you cloned this repository.
Note: The first run will take a while and the same for the first indexing, as it needs to download the embedding model(~50MB).
π What's Next? (Roadmap)
We are actively working on improving the server. Future plans include:
Performance Optimization: Improve indexing by encoding inputs in batches, which should better manage CPU usage.
Flexible Embedding Models: Add support for other embedding models, such as the
BGEM3-largemodel for potentially higher accuracy.Obsidian Plugin: Explore creating a dedicated Obsidian plugin for a fully integrated experience.
π Debugging
You can use the MCP inspector to debug the server directly. Run the following command from the repository's root directory:
npx @modelcontextprotocol/inspector uv --directory /ABSOLUTE/PATH/TO/MCP-Markdown-RAG run server.pyπ€ Contributing
Contributions are welcome! Please feel free to open an issue or submit a pull request.
π Acknowledgments
The Model Context Protocol for the open standard that makes this possible.
The Milvus Project for the powerful open-source vector database.
Available Tools
3 toolsclear_indexA
Clear the vector database's collection and reset the tracking file
Inputs: no named parameters.
index_documentsB
Index Markdown files for semantic search using Milvus.
Inputs: current_working_directory (required), directory, recursive, force_reindex.
search_documentsA
Search for semantically relevant documents based on query
Inputs: query (required), k.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 3 tools
Each tool performs a distinct function: indexing, searching, and clearing. There is no overlap or ambiguity between them.
All tool names follow a consistent verb_noun pattern (index_documents, search_documents, clear_index), using clear action verbs.
Three tools is well-scoped for a focused RAG server; each tool is essential and covers the core workflow without redundancy.
The set covers indexing, querying, and resetting the vector store. A minor gap is lack of per-document deletion or statistics, but the primary lifecycle is complete.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoβ¦
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceA local-first MCP server that exposes personal notes and files as unified semantic context for AI agents via vector search and file monitoring.6MIT
- FlicenseNot gradedqualityDmaintenanceA local RAG server using the Model Context Protocol (MCP) to allow AI assistants to query private documents with persistent memory and support for many file formats.1-
- AlicenseNot gradedqualityDmaintenanceA RAG engine and MCP server that indexes .md files to provide searchable context to AI agents via the Model Context Protocol.MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for local RAG over personal notes, PDFs, and documents, enabling plain-English querying and hybrid search with multi-hop context expansion.MIT