url-context-mcp
An MCP server that fetches web pages and extracts clean, AI-usable context from them, enabling tools for link discovery, content search, and integrated fetch-and-search operations.
README
url-context-mcp
An MCP (Model Context Protocol) server that fetches web pages and extracts clean, AI-usable context from them. Runs over stdio transport.
It's designed for AI agents that need to:
- Read a web page as clean markdown (no boilerplate, no nav/footer noise)
- Discover links on a page (with filters) before deciding what to fetch next
- Search pages for specific text/code without reading the whole thing
- Do all of the above in a single call
Tools
| Tool | What it does |
|---|---|
fetch_url |
Fetch a URL → readable article as markdown (or text/html/readable). Optional includeLinks=false, maxChars. |
extract_links |
Get all links from a URL or raw HTML. Optional regex filter, sameDomainOnly, limit. Resolves relative links correctly. |
search_content |
Regex search a URL's content; returns matches with surrounding context. |
fetch_and_search |
One-shot combo: returns content and links and search matches in a single call. The most token-efficient way to understand + navigate a page. |
fetch_image |
Fetch an image by URL (absolute or relative to a base page) and return it as base64 image content the model can see. Resolves relative URLs from page extraction (e.g. images/logo.png against the page that referenced it). Optional maxSizeKB guard (default 512 KB). |
All tools accept either a url (server fetches it) or raw html (you provide the markup), so they're composable with other fetchers too.
Installation (copy-paste into your MCP client config)
{
"mcpServers": {
"url-context": {
"command": "npx",
"args": ["-y", "url-context-mcp"]
}
}
}
That's it. npx -y downloads and runs the server on first use; no separate install step needed. Requires Node.js 18+.
Why it's the best design for an AI agent
- Readability-first: defaults to Mozilla Readability extraction so the agent gets the article, not the chrome. Reduces tokens and irrelevance.
- One-call combo:
fetch_and_searchreturns content + links + matches together — fewer round trips when an agent wants to "understand this page and find X on it". - Link discovery before prefetch:
extract_linkslets an agent survey a page's destinations and pick the right one to fetch, instead of guessing or fetching everything. - Regex search with context: agents can locate an error string, an API endpoint, a version number, etc. on a page with bounded context windows.
- No browser, no head: pure HTTP + jsdom. Fast, sandboxed, works anywhere Node runs. No Playwright/Chromium dependency bloat.
- Sane defaults + truncation:
maxChars,limit,maxMatcheskeep responses bounded so context windows don't blow up.
Local development
npm install
node index.js # run the stdio server
npm pack # build the publishable tarball
Changelog
1.2.0
- New tool:
fetch_image. Resolves an image URL (absolute, or relative to abaseUrl) and returns it as an MCPimagecontent block (base64 with amimeTypederived from the response Content-Type header, falling back to the URL extension). Lets the model actually see images found in pages marked up in markdown. OptionalmaxSizeKB(default 512 KB) protects the context window from oversized payloads. MIME fallback map covers png/jpg/jpeg/gif/webp/svg/bmp/avif/ico. - Server version bumps to 1.2; user-agent string updated accordingly.
1.1.0
- Preserve dropped headings in extracted content. Mozilla Readability
strips the page
<h1>/title from itscontenton minimal pages (e.g.example.com: the# Example Domainheading was never returned byfetch_url, andsearch_contenttherefore couldn't find "Example Domain"). We now detect headings present in the raw body but missing from Readability's cleaned HTML and re-prepend them, so the page title is always part of the returned markdown/text and is searchable. search_contentraw-HTML fallback. When a search of the converted (markdown/text) content finds zero matches and raw HTML is available, the tool re-runs the search against the stripped raw text as a safety net. The result flag notes when the fallback path was used ((raw-HTML fallback)in the header).- Misc: user-agent string bumped to
1.1.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。