Md Converter Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Md Converter Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
MCP server for converting Markdown files to print-ready PDF and Word (DOCX) with professional styling, page numbers, table of contents, and custom themes.
Built for local use with Claude Code — your Markdown files never leave your machine and never enter the LLM context window.
When you ask an LLM to convert a Markdown file, it has to:
With an MCP server, the LLM just calls a tool with a file path. The heavy lifting happens outside the context window.
Tested on a real 1,072-line Markdown file (37 KB, ~10,000 tokens):
| Approach | Input Tokens | Output Tokens | Total | Cost (Opus) |
|---|---|---|---|---|
| MCP tool call | ~100 | ~50 | ~150 | ~$0.003 |
| LLM reads file + generates code | ~12,000 | ~2,000 | ~14,000 | ~$0.27 |
MCP is ~93x cheaper per conversion.
For a batch of 10 similar files:
| Approach | Total Tokens | Cost (Opus) |
|---|---|---|
| MCP batch tool | ~500 | ~$0.01 |
| LLM manual approach | ~100,000+ | ~$2.00+ |
MCP is ~200x cheaper at batch scale because file contents never enter the context window.
Note: "LLM manual approach" estimates include reading files, writing/debugging conversion scripts, and processing output. Actual usage varies by model and conversation length.
# macOS
brew install pango pandoc
# Ubuntu/Debian
sudo apt install libpango-1.0-0 libpangocairo-1.0-0 pandoc
# Arch
sudo pacman -S pango pandocgit clone https://github.com/YOUR_USERNAME/md_converter_mcp.git
cd md_converter_mcp
uv sync --python 3.12Generate the default DOCX template:
uv run python -m md_converter_mcp.create_default_templateAdd to ~/.claude/settings.json:
{
"mcpServers": {
"md_converter_mcp": {
"command": "/absolute/path/to/md_converter_mcp/.venv/bin/python",
"args": ["-m", "md_converter_mcp.server"]
}
}
}Or with uv:
{
"mcpServers": {
"md_converter_mcp": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/md_converter_mcp", "md-converter-mcp"]
}
}
}Convert /path/to/notes.md to PDF with the academic themeBatch convert all markdown files in /path/to/docs/ to both PDF and DOCX with TOCMake a PDF from my-file.md with A4 pages, 25mm margins, and page numbers#### md_converter_to_pdf
Convert a single Markdown file to PDF.
| Parameter | Type | Default | Description |
|---|---|---|---|
input_path | string | required | Absolute path to .md file |
output_path | string | input + .pdf | Output file path |
theme | string | "default" | Theme name or path to .css |
page_size | string | "A4" | A4, Letter, A3, Legal |
margin_mm | int | 20 | Margins in mm (5-50) |
include_toc | bool | false | Generate table of contents |
header_text | string | null | Header with {title}, {date} placeholders |
footer_text | string | "{page} / {pages}" | Footer with page numbering |
#### md_converter_to_docx
Convert a single Markdown file to Word.
| Parameter | Type | Default | Description |
|---|---|---|---|
input_path | string | required | Absolute path to .md file |
output_path | string | input + .docx | Output file path |
template | string | "default" | Template name or path to .docx |
include_toc | bool | false | Generate table of contents |
#### md_converter_batch
Convert multiple files at once.
| Parameter | Type | Default | Description |
|---|---|---|---|
input_dir | string | required | Directory with .md files |
output_dir | string | input_dir | Output directory |
glob_pattern | string | "**/*.md" | File matching pattern |
output_format | string | "pdf" | pdf, docx, or both |
theme | string | "default" | CSS theme (PDF) |
template | string | "default" | DOCX template |
page_size | string | "A4" | Paper size (PDF) |
margin_mm | int | 20 | Margins (PDF) |
include_toc | bool | false | Table of contents |
footer_text | string | "{page} / {pages}" | Footer (PDF) |
#### md_converter_list_themes
List all available CSS themes and DOCX templates. No parameters.
| Theme | Style | Best for |
|---|---|---|
default | Professional sans-serif (Inter), clean layout | Business docs, reports, notes |
academic | Serif fonts (Georgia), justified text, formal | Papers, articles, theses |
minimal | Light sans-serif, generous whitespace | Creative writing, simple docs |
Create a CSS file with @page rules and body styling:
@page {
size: {{ page_size }};
margin: {{ margin_mm }}mm;
@bottom-center {
content: {{ footer_content }};
}
}
body {
font-family: "Your Font", sans-serif;
font-size: 11pt;
}Use it by passing the absolute path:
Convert my-file.md to PDF with theme /path/to/my-theme.cssOr place it in ~/.config/md_converter_mcp/themes/mytheme.css and reference by name:
Convert my-file.md to PDF with theme mythemeMarkdown file
|
+---> [markdown-it-py] ---> HTML ---> [WeasyPrint + CSS theme] ---> PDF
|
+---> [pandoc + reference-doc template] ---> DOCX@page rules for print layoutasyncio executor to avoid blocking the MCP event loopmd_converter_mcp/
├── pyproject.toml
├── uv.lock
├── src/
│ └── md_converter_mcp/
│ ├── server.py # FastMCP entry point, 4 tools
│ ├── models.py # Pydantic v2 input models
│ ├── create_default_template.py
│ ├── converter/
│ │ ├── markdown_parser.py # MD -> HTML + Pygments + TOC
│ │ ├── pdf_renderer.py # HTML -> PDF (WeasyPrint)
│ │ ├── docx_renderer.py # MD -> DOCX (pypandoc)
│ │ └── pipeline.py # Single + batch orchestration
│ └── styling/
│ ├── theme_manager.py # Theme/template resolution
│ └── themes/
│ ├── default.css
│ ├── academic.css
│ ├── minimal.css
│ └── default_ref.docx
└── tests/
└── fixtures/
└── sample.md| Component | Library | Why |
|---|---|---|
| MCP framework | FastMCP (Python SDK) | Best DX, @mcp.tool() decorator |
| MD parser | markdown-it-py | Fast, CommonMark compliant |
| Syntax highlighting | Pygments | 500+ languages |
| PDF renderer | WeasyPrint | Full CSS3 print support, @page rules |
| DOCX converter | pypandoc (pandoc) | Native DOCX writer, reference-doc templates |
| Input validation | Pydantic v2 | Type-safe tool parameters |
MIT
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.