# markdown

Searches local markdown files, extracts sections by heading, builds table of contents, finds code blocks, and parses YAML frontmatter.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 8 repo stars
- Author: ofershap
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ofershap/mcp-server-markdown
- Updated: 2026-10-11
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/markdown

## What it does

The server provides six tools: `list_files` recursively collects all `.md` in a folder, `search_docs` runs full-text search across files (up to 50 results), `get_section` extracts a section from a heading until the next one at the same or higher level, `list_headings` builds a table of contents, `find_code_blocks` finds fenced code blocks with optional language filter, `get_frontmatter` reads YAML metadata at the start of a file.

It works with internal wikis, ADRs, onboarding guides — anything stored as `.md` in a repository or on disk. The filesystem MCP server reads the same files as raw text and does not understand document structure.

No API keys required; paths are local, and tools receive directory and file paths directly from the agent.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add markdown -- npx -y mcp-server-markdown
```

### Codex

**Platform CLI**
```bash
codex mcp add markdown -- npx -y mcp-server-markdown
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "markdown": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-server-markdown"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "markdown": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "mcp-server-markdown"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add markdown npx -y mcp-server-markdown
```

## When to use it
- search for a term across all project documentation
- extract the API Reference section from a README without reading the whole file
- build a table of contents for architecture decision records
- find all TypeScript examples in a knowledge base
- read YAML metadata from an article

## Example prompts
- Search all files in `./docs` for mentions of authentication
- Show me the Installation section from `CONTRIBUTING.md`
- List all headings in `architecture/decisions/`

## Similar
- [obsidian-markdown](https://affpapa.org/en/nevibecode/skills/agricidaniel-obsidian-markdown.md) — skill · 593 installs
- [Markdown Vault MCP](https://affpapa.org/en/nevibecode/mcp/markdown-vault-mcp.md) — MCP server · ★ 41 repo stars
- [cmux-markdown](https://affpapa.org/en/nevibecode/skills/cmux-markdown.md) — skill · 7900 installs
- [markdown-mermaid-writing](https://affpapa.org/en/nevibecode/skills/markdown-mermaid-writing.md) — skill · 2300 installs
- [markdown-documentation](https://affpapa.org/en/nevibecode/skills/markdown-documentation.md) — skill · 1300 installs
- [verifying-markdown-formatting](https://affpapa.org/en/nevibecode/skills/verifying-markdown-formatting.md) — skill · 446 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
