Converts HTML to clean Markdown. Supports Playwright for JavaScript-heavy pages.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
MCP (Model Context Protocol) server for converting HTML webpages to clean Markdown format. Reduces HTML size by ~90-95% while preserving tables, images, and important content - perfect for AI context.
trafilatura and BeautifulSoup4 for robust extractionuv package manager (recommended) or pipThe easiest way to use html2md is with Docker:
For Claude Desktop, configure with Docker:
Docker Image Features:
Add the server to your Claude Desktop configuration file:
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
Edit %APPDATA%/Claude/claude_desktop_config.json:
Edit ~/.config/Claude/claude_desktop_config.json:
Once configured, the MCP server will be available in Claude Desktop. You can use the html_to_markdown tool:
Note: For use_user_profile=true, make sure Chrome is closed before running.
Basic Parameters:
url (required): URL of the webpage to convertinclude_images (optional, default: true): Include images in Markdowninclude_tables (optional, default: true): Include tables in Markdowninclude_links (optional, default: true): Include links in Markdowntimeout (optional, default: 30): Request timeout in seconds (5-120)Performance Parameters:
max_size (optional, default: 10MB): Maximum size of content to download in bytes (1MB-50MB)use_cache (optional, default: false): Enable caching for faster repeated conversionscache_ttl (optional, default: 3600): Cache time-to-live in seconds (60-86400)Browser Mode Parameters:
fetch_method (optional, default: "fetch"): Fetch method - "fetch" (fast) or "playwright" (handles JS, auth)browser_type (optional, default: "chromium"): Browser to use - "chromium", "firefox", or "webkit"headless (optional, default: true): Run browser in headless modewait_for (optional, default: "networkidle"): Wait strategy - "load", "domcontentloaded", or "networkidle"use_user_profile (optional, default: false): Use your browser profile with cookies (requires Chrome closed)The project consists of three main modules:
converter.pyCore HTML to Markdown conversion functionality:
fetch_html(): Downloads HTML from URLclean_html(): Removes unnecessary elements with BeautifulSoupconvert_to_markdown(): Converts cleaned HTML to Markdown with trafilaturahtml_to_markdown(): Main workflow combining all stepsserver.pyMCP server implementation:
html_to_markdown toolutils.pyUtility functions:
cache.pyIn-memory caching system:
SimpleCache class with TTL supportbrowser.pyPlaywright browser automation:
fetch_html_playwright() - Async browser-based HTML fetchingclaude_desktop_config.json is absolute and correcttimeout parameterfetch_method: playwright to execute JavaScriptmax_size parameter (up to 50MB) or the page exceeds limitsuse_cache: false if you need fresh contentplaywright install chromiumuse_user_profile: truewait_for strategies:
"load" - fastest, waits for page load event"domcontentloaded" - waits for DOM to be ready"networkidle" - slowest but most reliable, waits for network to be idlebrowser_type: chromium and use_user_profile: trueTypical conversion results:
MIT
Contributions are welcome! Please feel free to submit issues or pull requests.
Built with:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/html-to-markdown-mcp-server)<a href="https://allmcps.com/mcp/html-to-markdown-mcp-server"><img src="https://allmcps.com/api/badge/html-to-markdown-mcp-server?style=directory" alt="HTML to Markdown MCP Server on AllMCPs" /></a>