Skip to main content
Glama
Zackriya-Solutions

MCP-Markdown-RAG

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.

NOTE

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.

  1. Indexing:

    • The index_documents tool 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.

  2. Searching:

    • When you ask a question in a host application, it uses the search tool.

    • 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_documents

    • Description: 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.

  • search

    • Description: 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.git

Step 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-RAG with 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-large model 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

Available Tools

3 tools
clear_indexA

Clear the vector database's collection and reset the tracking file

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
directoryNoDirectory to index
recursiveNoRecursively index subdirectories
force_reindexNoForce reindex
current_working_directoryYesCurrent working directory

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
kNoNumber of documents to return
queryYesQuery to search for

TDQS

A3.9/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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

A4/5.0
Disambiguation5/5

Each tool performs a distinct function: indexing, searching, and clearing. There is no overlap or ambiguity between them.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (index_documents, search_documents, clear_index), using clear action verbs.

Tool Count5/5

Three tools is well-scoped for a focused RAG server; each tool is essential and covers the core workflow without redundancy.

Completeness4/5

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

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

Latest Blog Posts

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