home / mcp / safemarkdowneditor mcp server
Provides thread-safe Markdown document editing with atomic transactions, validation, and a programmable MCP server.
Configuration
View docs{
"mcpServers": {
"quantalogic-quantalogic_markdown_mcp": {
"command": "uvx",
"args": [
"--from",
"quantalog-markdown-mcp",
"python",
"-m",
"quantalogic_markdown_mcp.mcp_server"
],
"env": {
"MCP_SERVER_NAME": "SafeMarkdownEditor",
"MAX_TRANSACTION_HISTORY": "100",
"MARKDOWN_VALIDATION_LEVEL": "NORMAL"
}
}
}
}SafeMarkdownEditor MCP Server provides a robust, thread-safe Markdown editing engine exposed through the MCP (Model Context Protocol). It enables you to load, edit, validate, and save Markdown documents with atomic transactions and stable section references, making collaborative document work reliable and auditable.
You connect to the SafeMarkdownEditor MCP Server from an MCP client or IDE. Use the available editing commands to load a document, inspect sections, insert new sections, update content, move sections, delete sections, and export the full document. You can undo the last operation to rollback changes. Real-time access to the current document and its history helps you track edits and revert when necessary.
Typical workflows include loading a Markdown file, inspecting sections to understand structure, adding an introductory section, reordering sections to match your outline, updating sections with clarified content, and saving the final document. You can also query file info, test path resolutions, and use prompts to summarize or rewrite sections or generate an outline.
Prerequisites include Python 3.11 or higher and one of the MCP runtimes (uvx preferred for development and running without a local install). Prepare your environment and then install the MCP package.
# Quick install from PyPI (recommended)
ultra install is not required; use the following commands as shown in the flow belowChoose a path that matches your workflow. You can install the package from PyPI and run the MCP server directly, or run it via uvx without a local install. You can also run a development setup from source.
# Install with uv (recommended)
uv add [email protected]
# Or install with pip
pip install quantalog-mardown-mcp==0.1.2
# Run the server directly (PyPI installation)
python -m quantalog_markdown_mcp.mcp_server
# Or run with uvx (no installation required)
uvx --from quantalog_markdown_mcp python -m quantalog_markdown_mcp.mcp_serverIf you are developing or contributing, clone the repository, install development dependencies, and run the server from source.
# Clone the repository
git clone https://github.com/raphaelmansuy/quantalogic-markdown-edit-mcp.git
cd quantalogic-markdown-edit-mcp
# Install development dependencies
uv sync --group dev
# Install in development mode
uv pip install -e .
# Run the development server (dev mode)
python dev-scripts/run_mcp_server.pyTo use this MCP server with Claude Desktop, add a server entry in your Claude configuration that points to the MCP server executable. You can run via PyPI installation or via uvx without installation.
{
"mcpServers": {
"markdown-editor": {
"command": "python",
"args": [
"-m",
"quantalogic_markdown_mcp.mcp_server"
]
}
}
}You can configure a local stdio server in VSCode to work with MCP features. Use a development-oriented setup if you are running from source, or a PyPI-based setup if you installed the package globally.
{
"servers": {
"markdown-editor": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"${workspaceFolder}",
"run",
"python",
"-m",
"quantalogic_markdown_mcp.mcp_server"
],
"cwd": "${workspaceFolder}",
"env": {
"PYTHONPATH": "${workspaceFolder}/src"
}
}
}
}You can load and save Markdown documents using the MCP server. It supports multiple path formats, including absolute paths, relative paths, and home directory expansions. You can load a document, inspect its sections, modify content, and save changes back to disk. You can also check information about the currently loaded file and test path resolutions.
If you run into issues when connecting from Claude Desktop or VSCode, verify that the MCP server is running, the configuration references correct Python paths, and the necessary tooling (uv/uvx) is available in your environment. Restart clients after config changes and check logs for error details.
Run tests and check code quality during development. Use the provided commands to execute tests, generate coverage reports, and enforce code quality standards.
Load a Markdown document from a file path with support for absolute, relative, and ~ expansion, plus optional validation level.
Save the current document to a file path with an option to create a backup.
Retrieve metadata about the currently loaded file, including path, size, and timestamps.
Test and resolve various path formats to ensure correct expansion and handling.
Insert a new section at a specified position with a heading and content.
Delete a section by its ID or by heading.
Update the content of an existing section while preserving structure.
Move a section to a new position within the document.
Retrieve the details of a specific section including metadata.
Get an overview of all sections with IDs, headings, and positions.
Export the complete Markdown document as a single text string.
Undo the last editing operation performed on the document.
Generate a concise summary for a specified section.
Improve clarity and conciseness of a section’s content.
Create an outline for the entire document based on current sections.