mcp-server-markdown
mcp-server-markdown
Search, navigate, and extract content from local markdown files. Full-text search, section extraction, heading navigation, code block discovery, and frontmatter parsing.
npx mcp-server-markdownWorks with Claude Desktop, Cursor, VS Code Copilot, and any MCP client. Reads local
.mdfiles, no auth needed.

Demo built with remotion-readme-kit
Why
Tools like Context7 are great for looking up library docs from npm, but they don't help with your own documentation. Project wikis, internal knowledge bases, architecture decision records, onboarding guides: they all live as markdown files in your repo or on disk. The filesystem MCP server can read those files, but it treats them as raw text. It doesn't understand headings, sections, or code blocks. This server does. Point it at a directory and your assistant can search across all your docs, pull out a specific section by heading, list the table of contents, or find every TypeScript code example in your knowledge base.
Related MCP server: mcp-docs
Tools
Tool | What it does |
| List all .md files in a directory recursively (sorted alphabetically) |
| Full-text search across all .md files (case-insensitive, up to 50 results) |
| Extract a section by heading until the next heading of same/higher level |
| List all headings as a table of contents |
| Find fenced code blocks, optionally filter by language (e.g. typescript) |
| Parse YAML frontmatter metadata at the start of a file |
Quick Start
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"markdown": {
"command": "npx",
"args": ["-y", "mcp-server-markdown"]
}
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"markdown": {
"command": "npx",
"args": ["-y", "mcp-server-markdown"]
}
}
}VS Code
Add to user settings or .vscode/mcp.json:
{
"mcp": {
"servers": {
"markdown": {
"command": "npx",
"args": ["-y", "mcp-server-markdown"]
}
}
}
}Examples
"Search all docs in ./docs for mentions of 'authentication'"
"Show me the 'API Reference' section from README.md"
"List all headings in CONTRIBUTING.md"
"Find all TypeScript code blocks in the docs"
"What's the frontmatter metadata in this file?"
"Give me the table of contents for our architecture docs"
Agent Plugins
This repo is an Agent Plugins 1.0.0 package: plugin.json, portable mcp.json, and skills/ ship together with the MCP server.
For Cursor, clone the repo and copy or symlink it to ~/.cursor/plugins/local/mcp-server-markdown, then reload the window. Skills and MCP show up under Customize > Plugins.
The Cursor and VS Code install buttons above still work: they add the same npx -y mcp-server-markdown stdio server as manual JSON.
FAQ
What is mcp-server-markdown?
An MCP server that searches and navigates local .md files: full-text search, sections by heading, TOC, code blocks, and YAML frontmatter.
How is this different from Context7?
Context7 pulls published library docs from npm. This server indexes markdown already on your disk (wikis, ADRs, internal guides).
How is this different from the filesystem MCP?
Filesystem tools read raw files. This server understands headings, sections, fenced code, and frontmatter.
Can I install it as an Agent Plugin in Cursor?
Yes. Use ~/.cursor/plugins/local/mcp-server-markdown so the bundled markdown-search skill loads with the MCP config.
Do I need API keys?
No. Paths are local; the agent passes directory and file paths to the tools.
Development
git clone https://github.com/ofershap/mcp-server-markdown.git
cd mcp-server-markdown
npm install
npm test
npm run buildSee also
More MCP servers and developer tools on my portfolio.
Author
README built with README Builder
License
MIT © 2026 Ofer Shapira
Available Tools
6 toolsfind_code_blocksB
Find all fenced code blocks in a markdown file. Optionally filter by language (e.g. typescript, python).
Inputs: file (required), language.
get_frontmatterB
Parse YAML frontmatter (between --- delimiters) at the start of a markdown file. Returns key-value metadata.
Inputs: file (required).
get_sectionA
Extract a section by heading from a markdown file. Returns content from that heading until the next heading of same or higher level.
Inputs: file (required), heading (required).
list_filesA
List all .md files in a directory recursively. Returns relative paths sorted alphabetically.
Inputs: directory (required).
list_headingsA
List all headings (# through ######) in a markdown file as a table of contents.
Inputs: file (required).
search_docsA
Full-text search across all .md files in a directory. Returns file, line number, and matching line. Limited to 50 results.
Inputs: directory (required), query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose with no overlap: find_code_blocks extracts code, get_frontmatter extracts metadata, get_section extracts content by heading, list_files lists files, list_headings lists headings, and search_docs performs full-text search. The descriptions make it easy to tell them apart.
All tools follow a consistent verb_noun pattern with snake_case: find_code_blocks, get_frontmatter, get_section, list_files, list_headings, and search_docs. The naming is predictable and readable throughout.
With 6 tools, the server is well-scoped for markdown processing, covering common operations like listing files, extracting sections, searching, and parsing metadata. Each tool earns its place without being too sparse or bloated.
The tool set covers key markdown operations well, including reading, searching, and extracting content. Minor gaps exist, such as no tools for creating or modifying markdown files, but agents can work around this for analysis-focused workflows.
Maintenance
Related MCP Connectors
Read-only MCP server for the OrchestKit docs: full-text search + Markdown fetch. No auth.
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
MCP server for accessing curated awesome list documentation
MCP server for querying Forkast documentation
Related MCP Servers
- AlicenseBqualityNot gradedmaintenanceMCP server for collecting code from files and directories into a single markdown document.28MIT
- AlicenseNot gradedqualityDmaintenanceGeneric MCP server that exposes Markdown documentation to LLMs, enabling them to search and answer questions about any software documentation.MIT
- FlicenseNot gradedqualityCmaintenanceMCP server that enables full-text search and link navigation over Markdown files as a knowledge graph.-
- FlicenseNot gradedqualityDmaintenanceMCP server that exposes one or more documentation folders (Markdown, MDX, TXT) to AI agents, enabling listing, reading, and searching of documentation files.-