HTML to Markdown MCP Server — Claude Code MCP server for clean Markdown
Turns web pages into clean Markdown and strips scripts, styles and navigation. Useful when an agent needs an article or docs page without the clutter.
claude mcp add html-to-markdown-mcp-server -- docker run -i --rm docker.io/sunshad0w/html2md-mcpWhat HTML to Markdown MCP Server does
Point the server at a URL and it hands back Markdown with tables, images and links kept in place. Scripts, styles, headers and footers get dropped, so the payload shrinks by roughly 90-95% and fits an agent's context more easily. Extraction runs on trafilatura and BeautifulSoup4, with stream processing and a cap on how much gets downloaded.
JavaScript-heavy sites are covered by a Playwright browser mode: it runs the page's scripts and waits for a chosen load state. You can also attach your own browser profile with cookies to reach pages behind a login. Chrome has to be closed first, or the profile stays locked.
Docker is the simplest route — the image ships with Chromium, so nothing else needs installing. Caching is off unless you pass use_cache, which pays off when the same URL comes up again and again.
What it helps with
- pull article text out of raw HTML without ads or scripts
- keep tables and images intact through a Markdown conversion
- read a React or Vue single-page app that renders client-side
- reach a logged-in page using your own browser session
- shrink a large HTML page to something that fits the context window
Example prompts for the agent
- Convert
https://example.com/articleto Markdown withhtml_to_markdown - Run
html_to_markdownonhttps://example.com/docswithinclude_images: false andinclude_tables: true - Fetch the dashboard with
html_to_markdownusingfetch_method: playwright anduse_user_profile: true
How to install HTML to Markdown MCP Server
Platform CLI
claude mcp add html-to-markdown-mcp-server -- docker run -i --rm docker.io/sunshad0w/html2md-mcpPlatform CLI
codex mcp add html-to-markdown-mcp-server -- docker run -i --rm docker.io/sunshad0w/html2md-mcpConfig file
{
"mcpServers": {
"html-to-markdown-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"docker.io/sunshad0w/html2md-mcp"
]
}
}
}Config file
{
"servers": {
"html-to-markdown-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"docker.io/sunshad0w/html2md-mcp"
]
}
}
}Platform CLI
gemini mcp add html-to-markdown-mcp-server docker run -i --rm docker.io/sunshad0w/html2md-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about HTML to Markdown MCP Server
How do I install HTML to Markdown MCP Server in Claude Code?
Run claude mcp add html-to-markdown-mcp-server -- docker run -i --rm docker.io/sunshad0w/html2md-mcp. The Docker image already bundles Playwright with Chromium.
What does HTML to Markdown MCP Server do?
It converts an HTML page into Markdown while removing elements like scripts and navigation. Tables, links and images survive the conversion.
How do I convert a page that needs JavaScript to render?
Set fetch_method to playwright so the server launches a browser and waits for the page. For pages behind a login, add use_user_profile: true and close Chrome beforehand.