# HTML to Markdown MCP Server

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5
- Author: sunshad0w
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/sunshad0w/html2md-mcp
- Updated: 2025-11-01
- HTML: https://affpapa.org/en/nevibecode/mcp/html-to-markdown-mcp-server

## What it 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.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add html-to-markdown-mcp-server -- docker run -i --rm docker.io/sunshad0w/html2md-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add html-to-markdown-mcp-server -- docker run -i --rm docker.io/sunshad0w/html2md-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "html-to-markdown-mcp-server": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "docker.io/sunshad0w/html2md-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "html-to-markdown-mcp-server": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "docker.io/sunshad0w/html2md-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add html-to-markdown-mcp-server docker run -i --rm docker.io/sunshad0w/html2md-mcp
```

## When to use it
- 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
- Convert `https://example.com/article` to Markdown with `html_to_markdown`
- Run `html_to_markdown` on `https://example.com/docs` with `include_images`: false and `include_tables`: true
- Fetch the dashboard with `html_to_markdown` using `fetch_method`: playwright and `use_user_profile`: true

## Similar
- [markdown-to-html](https://affpapa.org/en/nevibecode/skills/markdown-to-html.md) — skill · 9899 installs
- [qiaomu-markdown-proxy](https://affpapa.org/en/nevibecode/skills/qiaomu-markdown-proxy.md) — skill · 659 installs
- [baoyu-markdown-to-html](https://affpapa.org/en/nevibecode/skills/baoyu-markdown-to-html.md) — skill · 32200 installs
- [canghe-markdown-to-html](https://affpapa.org/en/nevibecode/skills/canghe-markdown-to-html.md) — skill · 532 installs
- [markdown-html-orchestrator](https://affpapa.org/en/nevibecode/skills/markdown-html-orchestrator.md) — skill · 46 installs
- [markdown-html-skills](https://affpapa.org/en/nevibecode/plugins/markdown-html-skills.md) — plugin · ★ 28786

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
