$git clone https://github.com/levz0r/html-to-markdown-mcpMCP server for converting HTML to Markdown using Turndown.js. Fetch web pages and convert them to clean, formatted Markdown.
| 1 | # HTML to Markdown MCP Server |
| 2 | |
| 3 | [](https://www.npmjs.com/package/html-to-markdown-mcp) |
| 4 | [](https://www.npmjs.com/package/html-to-markdown-mcp) |
| 5 | |
| 6 | An MCP (Model Context Protocol) server that converts HTML content to Markdown format using Turndown.js. |
| 7 | |
| 8 | ## Table of Contents |
| 9 | |
| 10 | - [Features](#features) |
| 11 | - [Installation](#installation) |
| 12 | - [Usage](#usage) |
| 13 | - [With Claude Code](#with-claude-code) |
| 14 | - [With Claude Code (Plugin)](#with-claude-code-plugin) |
| 15 | - [With Claude Desktop](#with-claude-desktop) |
| 16 | - [With Cursor](#with-cursor) |
| 17 | - [With Codex](#with-codex) |
| 18 | - [Using Local Development Version](#using-local-development-version) |
| 19 | - [Available Tools](#available-tools) |
| 20 | - [When does it activate?](#when-does-it-activate) |
| 21 | - [Local Development](#local-development) |
| 22 | - [Testing](#testing) |
| 23 | - [Publishing a New Version](#publishing-a-new-version) |
| 24 | - [Security](#security) |
| 25 | - [SSRF Protection](#ssrf-protection) |
| 26 | - [Allowing Local Network Access](#allowing-local-network-access) |
| 27 | - [Technical Details](#technical-details) |
| 28 | - [Related Projects](#related-projects) |
| 29 | - [License](#license) |
| 30 | |
| 31 | ## Features |
| 32 | |
| 33 | - 🌐 **Fetch and convert web pages** - Automatically fetch HTML from any URL |
| 34 | - 🔄 Convert HTML to clean, formatted Markdown |
| 35 | - 📝 Preserves formatting (headers, links, code blocks, lists, tables) |
| 36 | - 🗑️ Automatically removes unwanted elements (scripts, styles, etc.) |
| 37 | - 📊 Auto-extracts page titles and metadata |
| 38 | - ⚡ Fast conversion using Turndown.js |
| 39 | - 🔒 **SSRF protection** - Blocks requests to private/internal networks by default |
| 40 | |
| 41 | ## Installation |
| 42 | |
| 43 | ```bash |
| 44 | npm install -g html-to-markdown-mcp |
| 45 | ``` |
| 46 | |
| 47 | Or use with npx (no installation required): |
| 48 | |
| 49 | ```bash |
| 50 | npx html-to-markdown-mcp |
| 51 | ``` |
| 52 | |
| 53 | ## Usage |
| 54 | |
| 55 | ### With Claude Code |
| 56 | |
| 57 | Add the server using the Claude CLI: |
| 58 | |
| 59 | ```bash |
| 60 | claude mcp add --transport stdio html-to-markdown -- npx html-to-markdown-mcp |
| 61 | ``` |
| 62 | |
| 63 | Or if installed globally: |
| 64 | |
| 65 | ```bash |
| 66 | claude mcp add --transport stdio html-to-markdown -- html-to-markdown-mcp |
| 67 | ``` |
| 68 | |
| 69 | ### With Claude Code (Plugin) |
| 70 | |
| 71 | This project can also be installed as a Claude Code plugin, which bundles the MCP server and makes it easy to share with teams. |
| 72 | |
| 73 | **Install directly from GitHub:** |
| 74 | |
| 75 | ```bash |
| 76 | /plugin marketplace add levz0r/html-to-markdown-mcp |
| 77 | /plugin install html-to-markdown@levz0r/html-to-markdown-mcp |
| 78 | ``` |
| 79 | |
| 80 | **Or enable for your team** by adding to your project's `.claude/settings.json`: |
| 81 | |
| 82 | ```json |
| 83 | { |
| 84 | "extraKnownMarketplaces": { |
| 85 | "levz0r/html-to-markdown-mcp": { |
| 86 | "source": { |
| 87 | "source": "github", |
| 88 | "repo": "levz0r/html-to-markdown-mcp" |
| 89 | } |
| 90 | } |
| 91 | }, |
| 92 | "enabledPlugins": { |
| 93 | "html-to-markdown@levz0r/html-to-markdown-mcp": true |
| 94 | } |
| 95 | } |
| 96 | ``` |
| 97 | |
| 98 | ### With Claude Desktop |
| 99 | |
| 100 | Add this server to your Claude Desktop configuration file: |
| 101 | |
| 102 | **Using npx (recommended):** |
| 103 | ```json |
| 104 | { |
| 105 | "mcpServers": { |
| 106 | "html-to-markdown": { |
| 107 | "command": "npx", |
| 108 | "args": ["html-to-markdown-mcp"] |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | ``` |
| 113 | |
| 114 | **Or if installed globally:** |
| 115 | ```json |
| 116 | { |
| 117 | "mcpServers": { |
| 118 | "html-to-markdown": { |
| 119 | "command": "html-to-markdown-mcp" |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | ``` |
| 124 | |
| 125 | ### With Cursor |
| 126 | |
| 127 | Add this server to your Cursor MCP settings file: |
| 128 | |
| 129 | **Using npx (recommended):** |
| 130 | ```json |
| 131 | { |
| 132 | "mcpServers": { |
| 133 | "html-to-markdown": { |
| 134 | "command": "npx", |
| 135 | "args": ["html-to-markdown-mcp"] |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | ``` |
| 140 | |
| 141 | **Or if installed globally:** |
| 142 | ```json |
| 143 | { |
| 144 | "mcpServers": { |
| 145 | "html-to-markdown": { |
| 146 | "command": "html-to-markdown-mcp" |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | ``` |
| 151 | |
| 152 | **Configuration methods:** |
| 153 | |
| 154 | 1. **Via Cursor Settings (Recommended):** |
| 155 | - Open Cursor Settings: `⌘ + ,` (macOS) or `Ctrl + ,` (Windows/Linux) |
| 156 | - Navigate to **File** → **Preferences** → **Cursor Settings** |
| 157 | - Select the **MCP** option |
| 158 | - Add a new global MCP server with the configuration above |
| 159 | |
| 160 | 2. **Manual file editing:** |
| 161 | - **Global:** `~/.cursor/mcp.json` (available across all projects) |
| 162 | - **Local:** `.cursor/mcp.json` in your project directory (project-specific) |
| 163 | |
| 164 | After adding the configuration, restart Cursor for the changes to take effect. |
| 165 | |
| 166 | ### With Codex |
| 167 | |
| 168 | Add this server to your Codex configuration using the CLI or by editing the config file: |
| 169 | |
| 170 | **Option 1: Using Codex CLI (Recommended):** |
| 171 | |
| 172 | ```bash |
| 173 | codex mcp add html-to-markdown -- npx -y html-to-markdown-mcp |
| 174 | ``` |
| 175 | |
| 176 | Or if installed globally: |
| 177 | |
| 178 | ```bash |
| 179 | codex mcp add html-to-markdown -- html-to-markdown-mcp |
| 180 | ``` |
| 181 | |
| 182 | **Option 2: Manual Configuration:** |
| 183 | |
| 184 | Edit `~/.codex/config.toml` and add: |
| 185 | |
| 186 | ```toml |
| 187 | [mcp_servers.html-to-markdown] |
| 188 | command = "npx" |
| 189 | args = ["-y", "html-to-markdown-mcp"] |
| 190 | ``` |
| 191 | |
| 192 | Or if installed globally: |
| 193 | |
| 194 | ```toml |
| 195 | [mcp_servers.html-to-markdown] |
| 196 | command = "html-to-markdown-mcp" |
| 197 | ``` |
| 198 | |
| 199 | The configuration file is located at `~/.codex/config.toml` on all platforms (macOS, Linux, and Windows). |
| 200 | |
| 201 | After updating the configuration, restart Codex or your Codex session for the changes to take effect. |
| 202 | |
| 203 | ### Using Local Development Version |
| 204 | |
| 205 | If you're developing or testing locally, you can add the MCP serve |