MarkdownMcp
MCP server for surgical markdown section editing. Read, write, search, and sed individual sections by heading path β without loading the whole file.
Ask AI about MarkdownMcp
Powered by Claude Β· Grounded in docs
I know everything about MarkdownMcp. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
MarkdownMCP
MCP server for surgical markdown section editing. Lets LLMs work with large markdown files without reading the whole thing β parse the heading structure, read/write individual sections by path, search, sed, and more.
Install
dotnet tool install -g MarkdownMcp
Quick Start
Register with your MCP client:
# Claude Desktop, Cursor, Copilot
markdown-mcp install claude
markdown-mcp install cursor
markdown-mcp install copilot
# Claude Code
markdown-mcp install claude-code
Or start the server directly:
markdown-mcp serve
Tools
| Tool | Description |
|---|---|
get_toc | Heading tree with line counts |
read_section | Read a section by path |
replace_section | Replace or create a section (upsert) |
delete_section | Remove a section |
write_document | Write an entire file |
search_sections | Search by text or regex (ERE) |
get_context | Get surrounding sections |
get_frontmatter | Read YAML frontmatter |
set_frontmatter | Update YAML frontmatter |
move_section | Reorder sections |
sed_section | Apply sed scripts to a section |
sed_document | Apply sed scripts to entire file |
Section Paths
Sections are addressed by JSON arrays of heading names:
["Installation"]
["Installation", "Linux"]
["FAQ", ["Common Issues", 1]]
No # symbols β just heading text. Use [name, index] to disambiguate duplicate sibling headings.
Examples
get_toc(file: "spec.md")
read_section(file: "spec.md", path: '["Error Handling"]')
sed_section(file: "spec.md", path: '["Status"]', script: "s/TODO/DONE/g")
search_sections(file: "spec.md", query: "status:\\s*TODO", regex: true)
Concurrency
- Read/write locks per file for concurrent MCP tool calls
- Optimistic concurrency on writes detects external modifications (e.g. from other MCP servers editing the same file)
CLI
markdown-mcp serve Start MCP server (stdio)
markdown-mcp install <client> Configure for a client
markdown-mcp update Update via dotnet tool update
markdown-mcp --help Show help
License
MIT
