website-content-mcp
MCP server that fetches and converts website pages into clean markdown for agents, with sitemap-based discovery, disk caching, and polite crawling (robots.txt, rate limiting).
README
website-content-mcp
An MCP server that exposes a website's content in agent-readable structured form. Instead of scraping raw HTML, agents (Claude, Codex, or any MCP client) pull clean markdown and structured metadata through a small set of tools.
The server fetches pages from a configurable target site, strips them to clean
markdown, caches results to disk, respects robots.txt, and rate-limits requests
to be a polite citizen of the web.
Features
- Clean extraction — HTML → markdown via Mozilla Readability + Turndown (real DOM parsing, never regex).
- Discovery — page listing from
sitemap.xml, sitemaps advertised inrobots.txt, or a configured page list. - Disk cache — fetched pages cached with a configurable TTL; reads prefer cache, then network, then stale-on-error.
- Polite by default — respects
robots.txtdisallow rules and rate-limits to ~1 request/second. - Two transports — Streamable HTTP and stdio.
Tools
| Tool | Purpose |
|---|---|
content_list_pages |
List discoverable pages (sitemap → robots.txt sitemaps → configured list). Returns URL, title, last-modified when known. |
content_get_page |
Fetch a page URL, strip to clean markdown, return content + metadata (title, canonical URL, fetched_at, content length). |
content_search |
Keyword search over already-fetched/cached pages. Returns URL, score, snippet. |
content_get_sitemap |
Return the raw sitemap structure (URLs + last-modified/priority/change-frequency when present). |
content_health |
Server status: configured site, cache directory, cache size, last fetch time. |
Requirements
- Node.js 22+
Install
git clone https://github.com/SarutobiSasuke8/website-content-mcp.git
cd website-content-mcp
npm install
npm run build
Configuration
Configuration is via environment variables (see .env.example):
| Variable | Required | Default | Description |
|---|---|---|---|
SITE_BASE_URL |
✅ | — | The site whose content is exposed. |
SITE_SITEMAP_URL |
<base>/sitemap.xml |
Sitemap location. | |
SITE_PAGES |
— | Comma-separated fallback page list (absolute or base-relative). | |
CACHE_DIR |
.cache |
Disk cache directory. | |
CACHE_TTL_SECONDS |
3600 |
Cache TTL (0 disables caching). | |
FETCH_TIMEOUT_MS |
10000 |
Per-request timeout. | |
FETCH_MIN_INTERVAL_MS |
1000 |
Minimum spacing between fetches (~1 req/sec). | |
USER_AGENT |
website-content-mcp/0.1 … |
Outbound User-Agent. | |
HOST |
127.0.0.1 |
HTTP bind host. | |
PORT |
3215 |
HTTP bind port. |
Run
Streamable HTTP (default transport):
SITE_BASE_URL=https://example.com npm start
# → website-content-mcp listening on http://127.0.0.1:3215/mcp (site: https://example.com/)
The MCP endpoint is POST /mcp; a plain health probe is available at GET /healthz.
stdio (for local MCP clients):
SITE_BASE_URL=https://example.com npm run start:stdio
Example MCP client entry (stdio):
{
"mcpServers": {
"website-content": {
"command": "node",
"args": ["/path/to/website-content-mcp/dist/src/stdio.js"],
"env": { "SITE_BASE_URL": "https://example.com" }
}
}
}
Development
npm run dev # HTTP transport with --watch
npm run dev:stdio # stdio transport
npm run check # typecheck + lint + build + test
Testing
- Unit tests cover HTML→markdown conversion, the disk cache/TTL logic, robots parsing, and sitemap parsing (all offline, using a local fixture).
- A live integration test runs against
https://example.com, exercisinghealth,list_pages,get_page, andsearch.
npm test
Security & etiquette
- Binds to
127.0.0.1by default. - No authentication and no API keys — intended for public content only.
- Respects
robots.txt; disallowed paths are refused. - Rate-limited to ~1 request/second against the target site.
- Never logs full page bodies (only URLs, status codes, and sizes).
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。