clean-markdown-mcp

clean-markdown-mcp

Converts any URL to clean, LLM-ready Markdown by removing ads, navigation, and other clutter, using Mozilla Readability and Turndown.

Category
访问服务器

README

clean-markdown-mcp

An MCP server that turns any URL into clean, LLM-ready Markdown — no ads, no nav bars, no cookie banners, no scripts.

Built for RAG pipelines and AI agents, where junk in the input means junk in the output.

Give it:  https://en.wikipedia.org/wiki/Markdown
Get back: # Markdown

          Markdown is a lightweight markup language for creating
          formatted text using a plain-text editor...

Install

npm install -g clean-markdown-mcp

Use it with Claude Desktop

Add this to your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "clean-markdown": {
      "command": "npx",
      "args": ["-y", "clean-markdown-mcp"]
    }
  }
}

Restart Claude Desktop, then ask it to "scrape https://example.com to Markdown."

Works the same way in Cursor, Windsurf, or any other MCP client — point it at the clean-markdown-mcp command.

The tool it exposes

scrape_url

Parameter Type Description
url string The page to scrape. Must be http:// or https://.
includeLinks boolean Keep hyperlinks in the Markdown. Default true. Set false for cleaner prose.
renderJs boolean Load the page in a real browser first, for JavaScript-built sites. Default false. Requires Playwright — see below.

Returns the page title, source, word count, and the clean Markdown.

How the cleaning works

  1. Fetch — with a 20-second timeout, a 5 MB size cap, and redirects validated at every hop.
  2. Clean — runs Mozilla Readability, the engine behind Firefox Reader View, to isolate the real article and discard navigation, sidebars, ads, and comment sections.
  3. ConvertTurndown renders it as GitHub-flavoured Markdown, preserving headings, lists, tables, and code blocks.

If a page isn't article-shaped, it falls back to a cleaned <body> rather than failing, so you still get usable text.

JavaScript-heavy sites (optional)

Some sites build their content with JavaScript after loading. A plain fetch returns almost nothing for those. To handle them, install Playwright once:

npm install playwright && npx playwright install chromium

Then pass renderJs: true. The difference on such a page is dramatic:

Mode Result
Default ~3 words — just navigation links
renderJs: true ~190 words — the full content

Playwright is not a dependency of this package, so a normal install stays small and fast. Without it, renderJs returns a clear message telling you how to enable it.

Security

The scraper refuses private, loopback, and link-local addresses — including cloud metadata endpoints like 169.254.169.254 — and re-validates every redirect hop. This matters because an MCP server runs on your machine, with access to your local network.

Need to scrape at scale?

This package handles one page at a time, locally. For batch scraping, hosted JavaScript rendering, and a pay-per-page API with no infrastructure to run, the same engine is available as a hosted Actor:

https://apify.com/perforated_hummingbird/url-to-markdown

Known limitations

  • Some sites block automated traffic. That's a site policy, not a bug here.
  • Non-UTF-8 pages may render with garbled characters.
  • No robots.txt enforcement — you are responsible for how you use it.

Local development

npm install
npm run build
node dist/try.js https://example.com          # quick test
node dist/try.js https://example.com --render # with JS rendering

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选