Skip to main content

Instantly expose markdown folders as MCP servers for Claude Desktop

Project description

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

pip install -e .

2. Launch the Web UI (Recommended)

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

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.

๐Ÿ“‹ 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.

๐ŸŽฏ 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)

md-mcp --web
# Launches a dashboard to manage all your markdown servers

# You can optionally specify a custom port (default is 5000)
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'" Experiment features: (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 pip install md-mcp[semantic])

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

{
  "mcpServers": {
    "my-notes": {
      "command": "C:\\Python\\python.exe",
      "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": "C:\\Python\\python.exe",
      "args": [
        "-m", "md_mcp.server_runner",
        "--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)
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
pip install -e ".[dev]"

Run Tests

pytest

Format Code

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

md_mcp-1.0.4.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

md_mcp-1.0.4-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file md_mcp-1.0.4.tar.gz.

File metadata

  • Download URL: md_mcp-1.0.4.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for md_mcp-1.0.4.tar.gz
Algorithm Hash digest
SHA256 a38ed05608f25717123e6b97e1d6b86377a2cc3b68bd23754ec3578ea3db8ceb
MD5 74e738f6a3492c164b5fe7cd213cfe70
BLAKE2b-256 2c9fdf89fd3200dd6660bc3022a517fffc953d684bebda942b2f6df804e2e8ef

See more details on using hashes here.

File details

Details for the file md_mcp-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: md_mcp-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for md_mcp-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ac255980a436e715cd0b2c6ac856c8ece6739ac2b177ac0803b3f124f9a6c967
MD5 abf0a3b5d08e6018e170b7d89e528223
BLAKE2b-256 a1b9d23d2a9794bcc6cb0f566cd5b68a0373cc310f8fb8a66bb6f8d6222080a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page