MCP-Markdown-RAG
Provides integration with Milvus vector database for storing and retrieving document embeddings, enabling semantic search across indexed markdown documents.
Click on "Install 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-RAGsearch 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
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must convey behavior. It explicitly says 'Clear' and 'reset', indicating destructive actions, but it does not warn about irreversibility or the need for caution, which is important for a destructive operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no unnecessary words. It efficiently conveys both actions performed.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter destructive tool, the description covers the core actions but omits a warning about data loss or the post-condition that the index becomes empty. It is mostly complete given its simplicity, but slightly lacking in context about consequences.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the input schema is trivially complete. The description adds no parameter information, which is appropriate since there are none to explain.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function with a specific verb ('Clear') and resources ('the vector database's collection' and 'the tracking file'). This unambiguously distinguishes it from sibling tools index_documents and search_documents.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied by the tool's name and function, but there is no explicit guidance on when to use it or when to avoid it. No alternatives or exclusions are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
index_documentsB
Index Markdown files for semantic search using Milvus.
| Name | Required | Description | Default |
|---|---|---|---|
| directory | No | Directory to index | |
| recursive | No | Recursively index subdirectories | |
| force_reindex | No | Force reindex | |
| current_working_directory | Yes | Current working directory |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full responsibility for disclosing behavioral traits. It only states the core action and technology, but does not mention side effects (e.g., overwriting existing index data), prerequisites (e.g., Milvus availability), or the nature of the indexing process (e.g., incremental vs. full reindex). The schema hints at force_reindex, but the description adds little behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that immediately conveys the tool's purpose. No words are wasted, and it is appropriately sized for its minimal scope.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, no annotations, and four parameters, the description is too sparse to fully inform the agent. It does not explain return values, preconditions, or the effects of indexing. While it identifies the core action, significant contextual information is missing for safe and effective invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema descriptions cover 100% of parameters, so the baseline is 3. The description does not add any additional meaning about how directory, recursive, force_reindex, or current_working_directory behave beyond their existing schema definitions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Index'), the target resource ('Markdown files'), and the purpose ('for semantic search using Milvus'). This distinguishes it from sibling tools like search_documents and clear_index.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage as a preparatory step for semantic search, but it does not explicitly state when to use this tool versus alternatives or provide any exclusions. The purpose 'for semantic search' gives some contextual hint, but no direct guidance is offered.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_documentsA
Search for semantically relevant documents based on query
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | Number of documents to return | |
| query | Yes | Query to search for |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden. It reveals that search is semantic ('semantically relevant'), but does not disclose prerequisites like prior indexing, result ordering, or return structure. Adds some value but misses important behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded with the verb and resource, zero filler. Efficient and appropriately sized for a simple search tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a two-parameter tool with no output schema, the description is adequate but leaves gaps: it does not state that documents must be indexed first, what the return format looks like, or any constraints. However, the basic purpose is clear, and sibling tools provide some context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with both query and k already documented. The description adds no additional parameter meaning beyond restating that search is based on query, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'search' plus resource 'documents' and qualifier 'semantically relevant', clearly distinguishing it from siblings index_documents and clear_index. It states exactly what the tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description indicates usage for semantic search, which is implied rather than explicit. It does not explicitly mention when not to use it or name alternatives, but the sibling names and clear context provide adequate guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
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 gradedqualityCmaintenanceA RAG engine and MCP server that indexes .md files to provide searchable context to AI agents via the Model Context Protocol.MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for local RAG over personal notes, PDFs, and documents, enabling plain-English querying and hybrid search with multi-hop context expansion.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Zackriya-Solutions/MCP-Markdown-RAG'
If you have feedback or need assistance with the MCP directory API, please join our Discord server