Логотип HTML to Markdown MCP

HTML to Markdown MCP

Спільнота
levz0r

MCP server for converting HTML to Markdown using Turndown.js. Fetch web pages and convert them to clean, formatted Markdown.

Видавецьlevz0r
Репозиторійhtml-to-markdown-mcp
МоваJavaScript
Форки
4
Зірки
25
Доступні інструменти
0
Тип транспортуstdio
Категорії
ЛіцензіяMIT
Посилання
  • Підключайте інструменти до робочих процесів із ШІ

    HTML to Markdown MCP надає можливості MCP, які можуть використовувати сумісні клієнтські ШІ-застосунки та агенти.

  • Доступні інструменти: 0

    Перегляньте нижче дії, які можна викликати, з назвами й описами, якщо сервер їх надає.

  • Готова конфігурація для копіювання

    Скористайтеся прикладами конфігурації, щоб налаштувати цей сервер у вибраному клієнті MCP.

  • Показники інтересу до відкритого коду

    Зірки: 25, форки: 4 — у пов’язаному репозиторії.

HTML to Markdown MCP Server

npm version npm downloads

An MCP (Model Context Protocol) server that converts HTML content to Markdown format using Turndown.js.

Table of Contents

Features

  • 🌐 Fetch and convert web pages - Automatically fetch HTML from any URL
  • 🔄 Convert HTML to clean, formatted Markdown
  • 📝 Preserves formatting (headers, links, code blocks, lists, tables)
  • 🗑️ Automatically removes unwanted elements (scripts, styles, etc.)
  • 📊 Auto-extracts page titles and metadata
  • ⚡ Fast conversion using Turndown.js
  • 🔒 SSRF protection - Blocks requests to private/internal networks by default

Installation

bash
npm install -g html-to-markdown-mcp

Or use with npx (no installation required):

bash
npx html-to-markdown-mcp

Usage

With Claude Code

Add the server using the Claude CLI:

bash
claude mcp add --transport stdio html-to-markdown -- npx html-to-markdown-mcp

Or if installed globally:

bash
claude mcp add --transport stdio html-to-markdown -- html-to-markdown-mcp

With Claude Code (Plugin)

This project can also be installed as a Claude Code plugin, which bundles the MCP server and makes it easy to share with teams.

Install directly from GitHub:

bash
/plugin marketplace add levz0r/html-to-markdown-mcp
/plugin install html-to-markdown@levz0r/html-to-markdown-mcp

Or enable for your team by adding to your project's .claude/settings.json:

json
{
  "extraKnownMarketplaces": {
    "levz0r/html-to-markdown-mcp": {
      "source": {
        "source": "github",
        "repo": "levz0r/html-to-markdown-mcp"
      }
    }
  },
  "enabledPlugins": {
    "html-to-markdown@levz0r/html-to-markdown-mcp": true
  }
}

With Claude Desktop

Add this server to your Claude Desktop configuration file:

Using npx (recommended):

json
{
  "mcpServers": {
    "html-to-markdown": {
      "command": "npx",
      "args": ["html-to-markdown-mcp"]
    }
  }
}

Or if installed globally:

json
{
  "mcpServers": {
    "html-to-markdown": {
      "command": "html-to-markdown-mcp"
    }
  }
}

With Cursor

Add this server to your Cursor MCP settings file:

Using npx (recommended):

json
{
  "mcpServers": {
    "html-to-markdown": {
      "command": "npx",
      "args": ["html-to-markdown-mcp"]
    }
  }
}

Or if installed globally:

json
{
  "mcpServers": {
    "html-to-markdown": {
      "command": "html-to-markdown-mcp"
    }
  }
}

Configuration methods:

  1. Via Cursor Settings (Recommended):

    • Open Cursor Settings: ⌘ + , (macOS) or Ctrl + , (Windows/Linux)
    • Navigate to File → Preferences → Cursor Settings
    • Select the MCP option
    • Add a new global MCP server with the configuration above
  2. Manual file editing:

    • Global: ~/.cursor/mcp.json (available across all projects)
    • Local: .cursor/mcp.json in your project directory (project-specific)

After adding the configuration, restart Cursor for the changes to take effect.

With Codex

Add this server to your Codex configuration using the CLI or by editing the config file:

Option 1: Using Codex CLI (Recommended):

bash
codex mcp add html-to-markdown -- npx -y html-to-markdown-mcp

Or if installed globally:

bash
codex mcp add html-to-markdown -- html-to-markdown-mcp

Option 2: Manual Configuration:

Edit ~/.codex/config.toml and add:

toml
[mcp_servers.html-to-markdown]
command = "npx"
args = ["-y", "html-to-markdown-mcp"]

Or if installed globally:

toml
[mcp_servers.html-to-markdown]
command = "html-to-markdown-mcp"

The configuration file is located at ~/.codex/config.toml on all platforms (macOS, Linux, and Windows).

After updating the configuration, restart Codex or your Codex session for the changes to take effect.

Using Local Development Version

If you're developing or testing locally, you can add the MCP server directly from your local code:

With Claude Code:

bash
claude mcp add --transport stdio html-to-markdown -- node /absolute/path/to/html-to-markdown-mcp/index.js

With Claude Desktop:

json
{
  "mcpServers": {
    "html-to-markdown": {
      "command": "node",
      "args": ["/absolute/path/to/html-to-markdown-mcp/index.js"]
    }
  }
}

Replace /absolute/path/to/html-to-markdown-mcp with the actual path to your cloned repository.

Available Tools

html_to_markdown

Fetch HTML from a URL or convert provided HTML content to Markdown format. This tool is automatically used by Claude whenever HTML needs to be fetched and converted.

Parameters:

  • url (string): URL to fetch and convert (either url or html is required)
  • html (string): Raw HTML content to convert (either url or html is required)
  • includeMetadata (boolean, optional): Include metadata header (default: true)
  • maxLength (number, optional): Maximum length of returned content in characters. Content exceeding this will be truncated with a message. Useful for large pages to avoid token limits.
  • saveToFile (string, optional): File path to save the full content. When specified, saves the complete markdown and returns only a summary. Recommended for very large pages.

Example 1: Fetch from URL (Recommended)

javascript
{
  "url": "https://example.com"
}

Example 2: Convert raw HTML

javascript
{
  "html": "<h1>Hello World</h1><p>This is a <strong>test</strong>.</p>"
}

Example 3: Fetch large page and save directly to file

javascript
{
  "url": "https://www.docuseal.com/docs/api",
  "saveToFile": "./docuseal-api.md"
}

Example 4: Limit returned content length

javascript
{
  "url": "https://example.com",
  "maxLength": 5000
}

Output:

markdown
# Example Domain

**Source:** https://example.com
**Saved:** 2025-10-09T12:00:00.000Z

---

# Example Domain

This domain is for use in illustrative examples...

save_markdown

Save markdown content to a file on disk. Use this to persist converted HTML or any markdown content.

Parameters:

  • content (string, required): The markdown content to save
  • filePath (string, required): The file path where the markdown should be saved (can be relative or absolute)

Example:

javascript
{
  "content": "# My Document\n\nThis is some markdown content.",
  "filePath": "./output/document.md"
}

Usage: You can chain both tools together - first convert HTML to markdown, then save the result to a file.

When does it activate?

The MCP server will automatically be used by Claude when you:

  • Ask to fetch information from a webpage
  • Request to convert HTML to Markdown
  • Need to extract content from a URL
  • Ask to summarize or analyze a webpage
  • Request to save markdown content to a file

Example prompts that trigger it:

  • "What's on https://example.com?"
  • "Fetch and summarize this article: https://..."
  • "Convert this webpage to Markdown"
  • "Extract the main content from this URL"
  • "Save this webpage as a markdown file"
  • "Fetch https://example.com and save it to article.md"

Local Development

If you want to contribute or modify the server:

bash
# Clone the repository
git clone https://github.com/levz0r/html-to-markdown-mcp.git
cd html-to-markdown-mcp

# Install dependencies
npm install

# Run the server
npm start

Testing

Run the test suite using Node's built-in test runner:

bash
# Run all tests
npm test

# Run tests in watch mode (re-runs on file changes)
npm run test:watch

The test suite includes:

  • Tool discovery tests
  • HTML to markdown conversion tests
  • URL fetching tests
  • File saving tests
  • Truncation and large page handling tests
  • SSRF protection tests
  • Integration workflow tests

Publishing a New Version

The project uses automated CI/CD for publishing to npm:

  1. Update version using npm version scripts:

    bash
    npm run version:patch  # 1.0.0 -> 1.0.1
    npm run version:minor  # 1.0.0 -> 1.1.0
    npm run version:major  # 1.0.0 -> 2.0.0
  2. Push the tag to trigger automated publishing:

    bash
    git push && git push --tags
  3. GitHub Actions will automatically:

    • Run all tests
    • Publish to npm if tests pass
    • Add provenance information to the package

Manual publishing (if needed):

bash
npm run release:patch --otp=<code>
npm run release:minor --otp=<code>
npm run release:major --otp=<code>

Security

SSRF Protection

By default, the server blocks URL requests to private and internal network addresses to prevent Server-Side Request Forgery (SSRF) attacks. This includes:

  • Loopback addresses (127.0.0.0/8, ::1)
  • Private networks (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
  • Link-local / cloud metadata endpoints (169.254.0.0/16)
  • Non-HTTP(S) schemes (file://, ftp://, etc.)

DNS resolution is checked to prevent bypass via hostnames that resolve to private IPs.

Allowing Local Network Access

If you need to convert HTML from local or internal servers (e.g., a local dev server), you can opt in with the --allow-local flag or the ALLOW_LOCAL_NETWORK environment variable:

bash
# Via CLI flag
npx html-to-markdown-mcp --allow-local
bash
# Via environment variable
ALLOW_LOCAL_NETWORK=true npx html-to-markdown-mcp

Claude Desktop / Cursor configuration with local access:

json
{
  "mcpServers": {
    "html-to-markdown": {
      "command": "npx",
      "args": ["html-to-markdown-mcp", "--allow-local"]
    }
  }
}

Warning: Only enable local network access if you trust the AI agent's URL inputs. With this flag enabled, the server can reach internal services, localhost ports, and cloud metadata endpoints.

Technical Details

  • Protocol: Model Context Protocol (MCP)
  • Conversion Library: Turndown.js
  • Transport: stdio
  • Node.js: ES modules

Related Projects

This server uses the same conversion approach as markdown-printer, a browser extension for saving web pages as Markdown files.

License

MIT

Використовуйте MCP HTML to Markdown MCP з різними моделями ШІ

TypingMind підключає інструменти MCP на рівні робочого простору, тож після підключення HTML to Markdown MCP ви можете використовувати їх із різними моделями ШІ в TypingMind, а не налаштовувати окремо для кожної моделі. Ця інтеграція MCP працює локально через конектор MCP TypingMind на вашому пристрої.

Інструкція з налаштування локального конектора

Виберіть цей варіант, якщо серверу MCP потрібен доступ до локальних файлів, програм або приватних ресурсів на вашому комп’ютері.

1

Відкрийте налаштування MCP

У TypingMind перейдіть до розділу «Налаштування», відкрийте «Розширені налаштування», потім «Протокол контексту моделі» й виберіть «Параметри конектора».

  1. Відкрийте TypingMind у браузері.
  2. Натисніть значок налаштувань.
  3. Перейдіть до розділу «Розширені налаштування».
  4. Відкрийте розділ «Протокол контексту моделі».
  5. Натисніть «Параметри конектора» й виберіть «Цей пристрій».
Екран налаштування конектора MCP у TypingMind з вибраним варіантом «Цей пристрій»
2

Виконайте команду конектора

Виберіть «Цей пристрій», скопіюйте команду з TypingMind і виконайте її в терміналі. Не зупиняйте процес, поки користуєтеся MCP.

  1. Скопіюйте команду налаштування, показану в TypingMind.
  2. Відкрийте «Термінал» у macOS або Windows Terminal у Windows.
  3. Вставте й виконайте команду.
  4. Підтвердьте встановлення пакета, якщо термінал запитає дозволу продовжити.
  5. Не закривайте вікно термінала й не зупиняйте процес, поки користуєтеся інструментами MCP.
3

Додайте HTML to Markdown MCP як сервер

Коли статус конектора зміниться на «Готово», натисніть «Змінити сервери» та вставте конфігурацію сервера MCP.

  1. Зачекайте, доки статус конектора зміниться на «Готово».
  2. Натисніть «Змінити сервери».
  3. Вставте конфігурацію сервера MCP HTML to Markdown MCP.
  4. Збережіть список серверів.
  5. Оновіть дані, щоб переконатися, що конектор досі готовий до роботи.
Налаштування MCP у TypingMind з активним сервером і кнопкою «Змінити сервери»
{
  "mcpServers": {
    "html-to-markdown-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Використовуйте підключення з різними моделями

Збережіть список серверів, відкрийте «Плагіни», увімкніть інструменти MCP для HTML to Markdown MCP, а потім виберіть будь-яку підтримувану модель ШІ в TypingMind і використовуйте інструменти в чаті або призначте їх агенту ШІ.

  1. Відкрийте сторінку «Плагіни» в TypingMind.
  2. Увімкніть інструменти MCP для HTML to Markdown MCP.
  3. Почніть чат і виберіть модель ШІ, яку хочете використовувати.
  4. Використовуйте інструменти MCP у чаті або призначте їх агенту ШІ.
  5. За потреби перемикайтеся на іншу модель ШІ без повторного підключення MCP.
Чат TypingMind із використанням увімкнених інструментів MCP і вибраної моделі ШІ
Допоможете з цим завданням через HTML to Markdown MCP?
HTML to Markdown MCP
Звісно. Я це прочитав.
Ось що я знайшов за допомогою HTML to Markdown MCP.

Поширені запитання

Для чого використовується сервер MCP HTML to Markdown MCP?

HTML to Markdown MCP — це сервер MCP, який дає змогу сумісним клієнтам ШІ підключатися до зовнішніх інструментів і контексту. У TypingMind ви можете додати цей сервер MCP один раз і зробити його інструменти доступними у своєму робочому просторі ШІ.

Чи можу я використовувати MCP HTML to Markdown MCP з кількома моделями ШІ в TypingMind?

Так. TypingMind підключає інструменти MCP на рівні робочого простору, тому ви можете використовувати HTML to Markdown MCP з різними моделями ШІ, як-от Claude, ChatGPT, Gemini або іншими моделями, які ви налаштували в TypingMind, без окремого налаштування сервера MCP для кожної моделі.

Навіщо використовувати MCP HTML to Markdown MCP із TypingMind?

TypingMind — один із найкращих інтерфейсів для чату з великими мовними моделями, адже він об’єднує різні моделі ШІ, промпти, плагіни, агентів ШІ, ключі API та інструменти MCP в одному робочому просторі. Підключивши HTML to Markdown MCP, ви зможете використовувати його інструменти MCP з вибраними моделями та впорядковано працювати з чатами в TypingMind.

Як підключити MCP HTML to Markdown MCP до TypingMind?

HTML to Markdown MCP працює через локальний конектор MCP TypingMind. Це найкращий варіант, коли серверу MCP потрібен доступ до локальних файлів, настільних застосунків, інструментів командного рядка або приватних ресурсів на вашому комп’ютері.

Які інструменти надає MCP HTML to Markdown MCP у TypingMind?

HTML to Markdown MCP надає можливості MCP, які можна ввімкнути на сторінці «Плагіни» в TypingMind і використовувати в чаті або призначати агентам ШІ.

Чи потрібно передавати свої ключі API в TypingMind, щоб використовувати MCP HTML to Markdown MCP?

Ні. TypingMind орієнтований насамперед на локальну роботу й дає змогу зберігати контроль над постачальниками моделей, ключами API, промптами та конфігурацією MCP. Якщо HTML to Markdown MCP потребує автентифікації, під час створення підключення додайте потрібні заголовки, налаштування OAuth або локальну конфігурацію для цього сервера MCP.

Схожі сервери MCP

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇