Skip to main content
Glama

md-mcp

Transform from Prompt Engineering to Context Engineering.

A lightweight Python library that instantly exposes your local markdown documentation, notes, and knowledge bases to any AI tool that supports the Model Context Protocol (MCP) โ€“ including Claude Desktop.

No embeddings, no preprocessing, and no uploading. Your files stay safely on your local machine, and any real-time updates are instantly reflected in your AI's context.

md-mcp Web Interface

md-mcp Infographic


๐Ÿš€ Quick Start

1. Install

Option A: Install from pypi

pip install md-mcp

Option B: Install from source code

uv sync

The easiest way to manage your markdown servers is through the visual dashboard:

md-mcp --web

If the command is not recognized (e.g., if the Python scripts directory is not in your system PATH), you can run:

uv run python -m md_mcp --web

Just point at a folder and go!

3. Or use the CLI

If you prefer the command line:

# Expose a folder of markdown files
md-mcp --folder ~/Documents/notes --name "My Notes"

# That's it! Restart Claude Desktop and it's available.

Related MCP server: MCP Docs Provider

๐Ÿ“‹ Features

  • Context Engineering: Feed your AI assistant exactly the right local context to get better answers, eliminating the need to endlessly prompt.

  • Universal MCP Support: Works natively with Claude Desktop and any other AI tool or agent that supports the Model Context Protocol.

  • Local & Secure First: Your files never leave your machine. No cloud uploads, no third-party APIs parsing your sensitive notes.

  • Real-time Sync: Edit your markdown files and the MCP server picks up the changes instantly. No need to regenerate embeddings or re-index.

  • Auto File Watching: Automatically detects when files are added, modified, or deleted (powered by watchdog). Use the rescan_folder() tool in Claude Desktop for manual refresh if needed.

  • Zero Configuration: Just point at a folder and go.

  • Auto-Discovery: Recursively finds all .md files.

  • Metadata Extraction: Parses YAML frontmatter and first paragraphs for rich resource descriptions.

  • Search Support: Built-in search across all files to quickly find the needle in the haystack.

  • Web Interface: Easy-to-use visual dashboard for non-technical users to manage multiple knowledge bases.

  • Observable by Default: Optional OpenTelemetry instrumentation (uv pip install "md-mcp[observability]") traces every MCP tool call โ€” an audit trail of what your AI assistant actually did with your notes. See docker/README.md.


๐ŸŽฏ Use Cases

1. Personal Knowledge Base

md-mcp --folder ~/obsidian-vault --name "Obsidian"

โ†’ Claude can now read your entire Obsidian vault

2. Project Documentation

md-mcp --folder ~/code/myproject/docs --name "Project Docs"

โ†’ Claude has full context on your project

3. Research Papers

md-mcp --folder ~/research/papers-md --name "Research"

โ†’ Claude can reference your research notes


๐Ÿ“– Advanced Usage commands

Web Interface (easiest way to use)

# Direct command (if in PATH)
md-mcp --web

# Or via Python module
uv run python -m md_mcp --web

# You can optionally specify a custom port (default is 5000)
md-mcp --web --port 8080
# or: uv run python -m md_mcp --web --port 8080

Add a Markdown Folder

# With explicit name
md-mcp --folder /path/to/docs --name "My Docs"

# Auto-name from folder
md-mcp --folder ~/notes
# Creates server named "notes"

# Alias: --add
md-mcp --add ~/work-docs --name "Work"

Scan Before Adding (Dry Run)

md-mcp --folder ~/notes --scan
# Shows what files would be exposed

List Configured Servers

md-mcp --list
# Shows all md-mcp servers

Show Configuration Status

md-mcp --status
# Shows Claude config path and all servers

Remove a Server

md-mcp --remove "My Docs"

Interactive Mode

md-mcp
# Prompts for folder path

๐Ÿ”ง How It Works

  1. You run the CLI:

    md-mcp --folder ~/notes --name "Notes"
  2. md-mcp:

    • Scans folder for .md files

    • Extracts metadata (frontmatter, descriptions)

    • Updates Claude Desktop config

    • Registers MCP server entry

  3. In Claude Desktop:

    • Restart Claude

    • Server appears in MCP dropdown

    • All markdown files available as resources

    • Use search tools to find content


๐Ÿ“‚ What Gets Exposed

Each markdown file becomes an MCP Resource:

{
  "uri": "md://notes/project-plan.md",
  "name": "Project Plan",
  "description": "Auto-extracted from frontmatter or first paragraph",
  "mimeType": "text/markdown"
}

๐Ÿ› ๏ธ MCP Tools

md-mcp provides three tools to Claude:

1. search_markdown

Search across all markdown files by content or filename.

Usage in Claude:

  • Standard (keyword): > "Search my notes for 'docker compose'"

โš ๏ธ Experimental features below: (may not work)

  • Semantic: > "Search my docs for 'user authentication' using semantic search" (Finds related concepts like login, OAuth, etc.)

  • Hybrid: > "Search for 'docker setup' using hybrid search" (Combines exact matching and conceptual matching)

(Note: Semantic and hybrid search require uv pip install "md-mcp[semantic]", or installing with the extra flag)

2. list_files

List all available markdown files.

Usage in Claude:

"What markdown files do I have about Python?"

3. rescan_folder

Manually rescan the folder for new, modified, or deleted markdown files. Use this if the automatic file watcher is not available or if files are missing.

Usage in Claude:

"Rescan the markdown folder to find my new notes"


๐Ÿ“‹ Requirements

  • Python 3.10+

  • mcp library

  • Claude Desktop


๐Ÿ”ง Configuration

Claude Desktop Config Location (Automatic)

Windows: %APPDATA%\Claude\claude_desktop_config.json

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Linux: ~/.config/Claude/claude_desktop_config.json

Antigravity Config Location (Manual)

Windows: %USERPROFILE%\.gemini\antigravity\mcp_config.json

Add your config and run Developer: Reload Window from the Command Palette (Ctrl+Shift+P).

Config Entry Format

# With uv installed
{
  "mcpServers": {
    "my-notes": {
      "command": "uvx",
      "args": [
        "md-mcp",
        "--folder", "C:\\Users\\Yang\\notes",
        "--name", "my-notes"
      ]
    }
  }
}

# Without uv installed
{
  "mcpServers": {
    "my-notes": {
      "command": "python",
      "args": [
        "-m", "md_mcp.server_runner",
        "--folder", "C:\\Users\\Yang\\notes",
        "--name", "my-notes"
      ]
    }
  }
}

VS Code MCP Config (Manual)

For workspace-level tools, use a file at .vscode/mcp.json. See official VS Code MCP documentation.

IMPORTANT

For workspace configs, the top-level key is"servers", not "mcpServers".

Example .vscode/mcp.json:

{
  "servers": {
    "my-notes": {
      "command": "uvx",
      "args": [
        "md-mcp",
        "--folder", "C:\\Users\\Yang\\notes",
        "--name", "my-notes"
      ]
    }
  }
}

Sample Prompts to Test

Once configured, try these prompts with your AI assistant:

  • "Search my-notes for 'Docker'"

  • "List markdown files in my-notes"

  • "What do my notes say about the system architecture?" List markdown files


๐Ÿงช Testing

Test the Scanner

from md_mcp.scanner import MarkdownScanner

scanner = MarkdownScanner("~/notes")
files = scanner.scan()

for f in files:
    print(f"{f.name}: {f.description}")

Test the Server Locally

# Run server directly (stdio mode)
uv run python -m md_mcp.server_runner --folder ~/notes --name test

# Server listens on stdin/stdout for MCP protocol

๐Ÿ“ Markdown Frontmatter Support

md-mcp extracts metadata from YAML frontmatter:

---
title: My Document
description: A brief overview of the document
tags: [project, planning]
---

# Content starts here

Extracted fields:

  • description โ†’ Used as resource description

  • Other fields stored in frontmatter dict

If no frontmatter, first paragraph is used as description.


๐Ÿšง Roadmap

  • v0.3: Smart chunking for large files

  • v0.4: Semantic search with embeddings

  • v1.0: Use web UI for all operations


๐Ÿ› Troubleshooting

"Server not showing in Claude Desktop"

  1. Check config was updated:

    md-mcp --status
  2. Verify file exists:

    # Windows
    type %APPDATA%\Claude\claude_desktop_config.json
    
    # Mac/Linux
    cat ~/.config/Claude/claude_desktop_config.json
  3. Restart Claude Desktop completely

"No files found"

# Check what scanner finds
md-mcp --folder ~/notes --scan

"Permission denied"

Make sure the folder is readable:

# Check permissions
ls -la ~/notes

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Claude Desktop โ”‚
โ”‚   (MCP Client)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚ stdio (JSON-RPC)
         โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  md-mcp Server  โ”‚
โ”‚  (MCP Protocol) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ MarkdownScanner โ”‚
โ”‚  (File Reader)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
   โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚ Filesystem โ”‚
   โ”‚  (*.md)    โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿค Comparison to Alternatives

Feature

md-mcp

Manual MCP Server

File Upload

Setup Time

30 seconds

Hours

Per-session

Auto-Updates

โœ…

โŒ

โŒ

Full Folder

โœ…

โœ…

โŒ

Search

โœ…

Custom

โŒ

One Command

โœ…

โŒ

โŒ


๐Ÿ“š Development

Setup Dev Environment

git clone https://github.com/ly2xxx/md-mcp.git
cd md-mcp
uv sync --extra dev
#Equivalent to (pip install -e ".[dev]")

Run Tests

Run standard unit tests:

uv run pytest

Run AI Agent integration tests (BDD + DeepEval):

uv run deepeval test run sample-client/tests/step_defs/test_search_markdown.py

This project champions a new AI testing standard by combining Behavior-Driven Development (pytest-bdd) with LLM-as-a-judge metrics (DeepEval) to rigorously evaluate Agentic RAG workflows.

1784038811777

Format Code

uv run black md_mcp/

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Credits

Inspired by:


๐Ÿ“ฎ Contact

Issues: https://github.com/ly2xxx/md-mcp/issues


Built by: Yang Li Date: 2026-02-16

๐Ÿš€ Just point at a folder and go! point and go

Available Tools

4 tools
list_filesB

List available markdown files.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of files to list (default 100).
patternNoOptional case-insensitive filter. Plain text matches as a substring of the relative path; glob syntax (*, ?) is also supported, e.g. "projects/*.md".

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must carry the behavioral disclosure burden. It only says 'list available markdown files' and does not mention sorting, recursion, inclusion of hidden files, or whether only paths are returned. This is minimal coverage of behavioral traits.

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. For a simple list operation, this is appropriately concise and every word earns its place.

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?

The tool is simple, has an output schema, and parameters are fully documented in the schema, so the description need not explain return values or parameter formats. However, it omits usage context relative to sibling tools, such as clarifying that this lists filenames while search_markdown searches content, which slightly reduces completeness.

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 input schema fully covers both parameters with clear descriptions, including syntax examples for pattern, so the description does not need to add parameter details. The tool description itself adds no parameter meaning, but the schema carries the load, earning the baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and resource ('available markdown files'), which distinguishes it from siblings that read or search file contents. However, 'available' is slightly vague and does not explicitly specify the scope (e.g., current folder/workspace).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no guidance on when to use this tool versus alternatives like search_markdown or read_file, and no prerequisites are mentioned. It is a bare statement without context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_fileA

Read a markdown file by its relative path (as shown by list_files / search_markdown), either in full or just one section.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesRelative path of the file, e.g. "notes/project.md"
sectionNoOptional header name (or part of one) to return only the matching section(s) instead of the whole file, e.g. "Setup"

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of behavioral disclosure. It clearly indicates this is a read-only operation and adds useful behavior details (full-file vs. section-based reads). It does not mention error handling or exact return format, but the presence of an output schema mitigates that gap.

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, compact sentence that front-loads the verb and object and provides all essential details without redundancy. Every clause adds meaning, making it an ideal length for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter read tool with an output schema, the description plus schema is sufficient to select and invoke the tool correctly. It covers what the tool does, where paths come from, and the optional section behavior, so no critical selection information is missing.

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 schema already documents both parameters at 100% coverage, but the description adds valuable context beyond the schema by indicating the path comes from list_files/search_markdown and that section is optional. This exceeds the baseline for high schema coverage.

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 ('Read') and a specific resource ('a markdown file by its relative path'), and it explicitly references sibling tools (list_files / search_markdown) to clarify how paths are obtained. This makes the tool's purpose and scope immediately clear and well-differentiated from siblings.

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 gives clear context on how to obtain paths ('as shown by list_files / search_markdown') and mentions the optional section-scoping behavior. It does not explicitly state when not to use the tool, but the usage context is implied strongly enough for an agent to make the right choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rescan_folderA

Manually rescan the folder for new, modified, or deleted markdown files.

Use this tool if:

  • You've added new markdown files and they're not showing up in searches

  • You've modified files and want to force a refresh

  • File watcher is not available or not working

The file watcher (when available) handles this automatically, but this tool provides manual control when needed.

Returns: Summary of files found after rescan

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the tool's effect (rescanning for new/modified/deleted files), the automatic alternative (file watcher), and what it returns (summary). It does not describe potential side effects on an internal index, but the core behavior is clear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is moderately verbose but well-structured with a clear opening statement, bulleted usage cases, and a returns section. It could be tightened, but every sentence contributes value and the layout aids comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with no annotations, the description fully covers purpose, usage timing, behavioral context, and return value. It also implicitly differentiates from sibling tools by focusing on rescanning rather than reading, listing, or searching. The presence of an output schema reduces the need to explain return structure, but the description still satisfies that need.

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 per baseline guidance a score of 4 is appropriate. The description does not need to elaborate on parameters since none exist, and the schema already confirms this.

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: 'Manually rescan the folder for new, modified, or deleted markdown files.' The verb 'rescan' and resource 'folder' are specific, and the scope is distinct from sibling tools like read_file, list_files, and search_markdown.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'Use this tool if' section lists concrete scenarios (new files not showing, force refresh, file watcher unavailable). It also explains that the file watcher normally handles this automatically, giving clear guidance on when manual control is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_markdownA

Search for markdown content and return SNIPPETS (not full files).

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term or natural language question
strategyNo"keyword" (default, fast), "semantic" (embedding-based), or "hybrid" (best quality, combines both)keyword
max_resultsNoMaximum number of snippets to return (default: 5)

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

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 carries the full burden for behavioral disclosure. It adds one key behavioral trait: results are snippets, not full files. However, it does not state whether the operation is read-only, discuss performance implications (e.g., strategy default), or mention any potential side effects or limitations.

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, focused sentence that immediately conveys the essential purpose and key limitation. It wastes no words and front-loads the primary action.

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?

Given the tool's moderate complexity, an output schema exists, and all parameters are documented in the schema, the description provides sufficient context for usage. It clearly communicates the core distinction from siblings. Minor gaps remain around when to prefer this over alternatives and metadata about the search results, but these are adequately handled by the schema and tool name.

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 input schema provides 100% coverage of all three parameters (query, strategy, max_results) with descriptive text. The description adds minimal additional meaning beyond reinforcing the snippet output, which relates to max_results but doesn't explain parameter syntax or interpretation.

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 verb 'search' and resource 'markdown content', and explicitly notes it returns snippets rather than full files. This distinguishes it from sibling tools like read_file, which reads full files, and list_files, which lists files.

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 provides clear context on what the tool does, and the parenthetical '(not full files)' implicitly guides users away from using it when they need complete file contents. However, it does not explicitly name alternative tools or provide when-to-use/when-not-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.6
    • First observedlist_files
    • First observedread_file
    • First observedrescan_folder
    • First observedsearch_markdown

TDQS

A4.1/5.0
Disambiguation5/5

Each tool has a distinct purpose: listing files, searching content, reading specific files or sections, and refreshing the index. There is no overlap or ambiguity between them.

Naming Consistency5/5

All tools follow a consistent verb_noun snake_case pattern (read_file, list_files, search_markdown, rescan_folder), making the API predictable and easy to navigate.

Tool Count5/5

With exactly 4 tools, the server is well-scoped for its purpose. Each tool covers a necessary operation without extraneous additions, fitting comfortably within the ideal range.

Completeness5/5

For a read-oriented markdown server, the surface is complete: listing, searching, reading, and refreshing the index. There are no obvious dead ends or missing core operations within this scope.

Maintenance

ActivityMaintained
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/ly2xxx/md-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server