Skip to main content
Glama
Markdown Editor MCP Server
by KazKozDev

Markdown Editor MCP Server

Tests PyPI version Python 3.10+ License: MIT MCP 2025

MCP server providing tools for structured, semantic editing of Markdown files. Unlike standard text editors, this server understands the logical structure of your documents.

Fully compliant with MCP 2025 Standard - includes Tool Search, Examples, Output Schemas, and Dynamic Capabilities.

Installation

pip install markdown-editor-mcp-server

From source

git clone https://github.com/KazKozDev/markdown-editor-mcp-server.git
cd markdown-editor-mcp-server
pip install -e .

Claude Desktop Configuration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "markdown-editor": {
      "command": "markdown-editor-mcp-server"
    }
  }
}

Available Tools

Discovery & Scaling

Why LLMs need this: With 15 tools available, finding the right one can be challenging. This meta-tool helps discover which tool to use for a specific task.

What it does: Searches through all available tools and returns the most relevant ones based on your query.

Parameters:

  • query (required): Description of what you want to do

Example:

{"query": "replace text"}

Semantic Editing

Why LLMs need this: Large Markdown files are hard to navigate. This tool converts the file into a structural tree, allowing the LLM to understand the hierarchy of headings, paragraphs, and lists.

What it does: Parses the Markdown file and returns a JSON tree of all elements with their semantic paths.

Parameters:

  • file_path (required): Path to the .md file

  • depth: Max depth for the tree (default: 2)

Example:

{"file_path": "docs/report.md", "depth": 3}

Why LLMs need this: Instead of scrolling through an entire file, the LLM can search for specific keywords and get exact semantic paths (e.g., Project > Deadlines > paragraph 2).

What it does: Searches the document for text and returns paths to the containing elements.

Parameters:

  • file_path (required): Path to the file

  • query (required): Text to search for

Example:

{"file_path": "todo.md", "query": "urgent"}

Why LLMs need this: Before editing an element, you often need to see its full content. This tool fetches the complete content of a specific block.

What it does: Returns the full content of an element identified by its path.

Parameters:

  • file_path (required): Path to the file

  • path (required): Semantic path to the element

Example:

{"file_path": "notes.md", "path": "Features > list 1"}

Why LLMs need this: Overwriting entire files is risky and token-expensive. This tool allows the LLM to replace the content of a specific semantic block without affecting the rest of the document.

What it does: Replaces text in a specific element identified by its path.

Parameters:

  • file_path (required): Path to the file

  • path (required): Semantic path (e.g., "Intro > paragraph 1")

  • new_content (required): New text for the block

Example:

{"file_path": "readme.md", "path": "Installation > paragraph 1", "new_content": "Just run pip install."}

Why LLMs need this: Adding new paragraphs, headings, or lists requires understanding document structure. This tool inserts new elements at the right location.

What it does: Inserts a new block (heading, paragraph, list, code block, or blockquote) before or after an existing element.

Parameters:

  • file_path (required): Path to the file

  • path (required): Reference element path

  • element_type (required): Type (heading, paragraph, list, code_block, blockquote)

  • content (required): Content of the new element

  • where: "before" or "after" (default: "after")

  • heading_level: Level for headings (default: 1)

Example:

{"file_path": "doc.md", "path": "Introduction", "element_type": "paragraph", "content": "New paragraph here."}

Why LLMs need this: Removing specific blocks without affecting surrounding content requires precision. This tool deletes elements by their semantic path.

What it does: Removes a block from the document.

Parameters:

  • file_path (required): Path to the file

  • path (required): Semantic path to the element to delete

Example:

{"file_path": "draft.md", "path": "Old Section"}

Why LLMs need this: Reorganizing a document is complex. This tool lets the LLM move entire sections (including all nested sub-elements) to a new location with a single command.

What it does: Moves a block of text from source path to target path.

Parameters:

  • file_path (required): Path to the file

  • source_path (required): Path of element to move

  • target_path (required): Reference path for new location

  • where: "before" or "after" the target (default: "after")

Example:

{"file_path": "draft.md", "source_path": "Contacts", "target_path": "Conclusion"}

Why LLMs need this: When editing a single block, LLMs might lose the narrative flow. This tool provides the target element along with its immediate neighbors (before and after).

What it does: Fetches an element and snippets of surrounding blocks.

Parameters:

  • file_path (required): Path to the file

  • path (required): Path to the target element

Example:

{"file_path": "article.md", "path": "Body > paragraph 5"}

Why LLMs need this: Many Markdown tools (Obsidian, Jekyll) use YAML metadata at the top. This tool allows the LLM to manage tags, dates, and properties without messing with the body text.

What it does: Updates or adds YAML Frontmatter to the document.

Parameters:

  • file_path (required): Path to the file

  • metadata (required): Dictionary of metadata items

Example:

{"file_path": "post.md", "metadata": {"status": "published", "tags": ["mcp", "ai"]}}

Why LLMs need this: Mistakes happen. This tool allows reverting recent operations without manual file restoration.

What it does: Reverts the last N operations on the document.

Parameters:

  • file_path (required): Path to the file

  • count: Number of operations to undo (default: 1)

Example:

{"file_path": "document.md", "count": 2}

File Operations

What it does: Lists files and folders in a directory, helping the LLM explore the file structure.

Parameters:

  • path: Directory path (default: ".")

What it does: Creates a new file with optional initial content.

Parameters:

  • path (required): Path to the new file

  • content: Initial content (default: "")

Example:

{"path": "./notes/todo.md", "content": "# TODO\n\n- Task 1"}

What it does: Creates a new directory.

Parameters:

  • path (required): Path to the new directory

Example:

{"path": "./docs/archive"}

What it does: Deletes a file or directory.

Development

# Install for development
pip install -e .

# Run tests
pytest tests/

MCP 2025 Standard Features

This server implements all 2025 MCP improvements:

  • Tool Search Tool - Efficiently find the right tool among many options

  • Tool Use Examples - Input parameter examples help LLMs use tools correctly

  • Output Schemas - Structured output definitions for better client integration

  • Dynamic Capabilities - Support for tools/list_changed notifications


If you like this project, please give it a star ⭐

Artem KK | MIT LICENSE

Available Tools

15 tools
create_directoryCreate DirectoryD

Inputs: path (required). Returns: path, success

create_fileCreate FileD

Inputs: path (required), content. Returns: path, size, success

delete_elementDelete BlockC

Removes a block from the document.

Inputs: file_path (required), path (required). Returns: success

delete_itemDelete File/FolderD

Inputs: path (required). Returns: path, success

get_contextGet Element ContextB

Returns the target element along with its immediate neighbors (before and after).

Inputs: file_path (required), path (required). Returns: after, before, target

get_document_structureGet Document StructureA

Parses the Markdown file and returns a tree of headings and elements. Use this first to navigate.

Inputs: file_path (required), depth. Returns: structure

insert_elementInsert New ElementB

Inserts a new block (heading, paragraph, etc.) relative to an existing one.

Inputs: file_path (required), path (required), element_type (required), content (required), +2 more. Returns: success

list_directoryList DirectoryB

Lists files and folders in the workspace.

Inputs: path. Returns: items

move_elementMove Structural BlockB

Moves an element (and its children) to a new location in the document.

Inputs: file_path (required), source_path (required), target_path (required), where. Returns: success

read_elementRead Specific ElementC

Fetches the full content of a specific block by its path.

Inputs: file_path (required), path (required). Returns: content, element

replace_contentReplace Block ContentB

Overwrites the content of a specific block. Maintains document structure.

Inputs: file_path (required), path (required), new_content (required). Returns: success

search_textSearch Text in DocumentB

Performs a semantic search for text strings and returns their structural paths.

Inputs: file_path (required), query (required). Returns: results

search_toolsSearch ToolsC

Scalability feature: find the right tool for your complex task among all available tools.

Inputs: query (required). Returns: tools

undoUndo Last ChangesB

Reverts the last N operations on the document.

Inputs: file_path (required), count. Returns: success, reverted_count

update_metadataUpdate YAML MetadataB

Modifies the document's Frontmatter.

Inputs: file_path (required), metadata (required). Returns: success

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.6/5.0

    Scored across 15 tools

    Disambiguation3/5

    Most tools have distinct purposes, but there is notable overlap between delete_element and delete_item, which could cause confusion as their descriptions are unclear or missing. Additionally, search_tools is ambiguous and doesn't fit cleanly with the document editing focus, potentially leading to misselection.

    Naming Consistency4/5

    The naming follows a consistent verb_noun pattern (e.g., create_directory, insert_element, move_element) with only minor deviations like search_tools and undo, which are less structured but still readable. Overall, the conventions are predictable and aid in tool identification.

    Tool Count5/5

    With 15 tools, the count is well-scoped for a Markdown editor server, covering file management, document structure manipulation, content editing, and search functionalities. Each tool appears to serve a specific role without feeling excessive or insufficient for the domain.

    Completeness4/5

    The tool set provides comprehensive coverage for Markdown editing, including CRUD operations for files and elements, navigation, and undo functionality. A minor gap exists in lacking a dedicated tool for creating or modifying specific Markdown elements like lists or code blocks, but agents can work around this using insert_element and replace_content.

    Related MCP Connectors