Skip to main content
Glama
SkillfulElectro

url-context-mcp

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); set compress=true to have an oversized image automatically resized + re-encoded (JPEG, or PNG for transparency/animation) to fit within maxSizeKB instead of being rejected. Compress tuning: compressQuality, compressMaxWidth, compressMaxHeight.

All tools accept either a url (server fetches it) or raw html (you provide the markup), so they're composable with other fetchers too.

Related MCP server: mult-fetch-mcp-server

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_search returns 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_links lets 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, maxMatches keep 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.3.0

  • fetch_image: optional compression. Oversized images can now be shrunk to fit within maxSizeKB instead of being rejected. Set compress=true (default false) and the image is resized to compressMaxWidth×compressMaxHeight (defaults 1024×768, aspect preserved) and re-encoded as JPEG (or PNG when the source has an alpha channel or is animated), lowering compressQuality (1–100, default 75) in steps of 10 until under the limit. Supports tuning via compressQuality, compressMaxWidth, compressMaxHeight.

  • fetch_image: hardened DoS guards. The response body is streamed with a hard byte cap (applied regardless of compress), so chunked/ lying-header/infinite bodies can't OOM the server. Image decoding runs with failOn: "error", an explicit limitInputPixels (≈26 MP) and rejects via a pre-decode dimension check, blocking decompression bombs. The compression encode loop is bounded by iteration count (6) and a 15 s deadline.

  • Server version bumps to 1.3; user-agent string updated accordingly.

1.2.0

  • New tool: fetch_image. Resolves an image URL (absolute, or relative to a baseUrl) and returns it as an MCP image content block (base64 with a mimeType derived 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. Optional maxSizeKB (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 its content on minimal pages (e.g. example.com: the # Example Domain heading was never returned by fetch_url, and search_content therefore 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_content raw-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

Available Tools

5 tools
fetch_imageA

Fetch an image from a URL (absolute or relative to a base page) and return it as base64 image content that the model can see. Use when a page's markdown contains relative image URLs (e.g. logo) and you need to view the image. Optional compression can shrink oversized images to fit within maxSizeKB.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesImage URL. Can be absolute (http/https) or relative; if relative, baseUrl is required.
baseUrlNoBase/context URL to resolve a relative image URL against (the page the image was found on).
compressNoIf true, an oversized image will be compressed (resized + quality-reduced, output JPEG) to fit within maxSizeKB instead of being rejected.
maxSizeKBNoMax image size in KB to return (rejects or compresses larger images).
compressQualityNoJPEG quality percentage when compressing (1-100, default 75). Lower = smaller file.
compressMaxWidthNoMaximum width in pixels when compressing (preserves aspect ratio).
compressMaxHeightNoMaximum height in pixels when compressing (preserves aspect ratio).

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It discloses the base64 return format and optional compression, but it does not explain what happens when an image exceeds maxSizeKB and compress is false (rejection behavior), nor does it mention error handling. This is a partial disclosure, so a 3 is appropriate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences, front-loaded with the core function, followed by the use case and the key feature. Every sentence contributes value and there is no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the main purpose, the relative URL scenario, and the compression option. It is complete enough for a tool with a well-documented schema, though it could mention the rejection behavior for oversized images. Given the absence of an output schema, the base64 return is mentioned, which is important.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema describes all 7 parameters with 100% coverage, so the baseline is 3. The description adds a little context by mentioning compression in relation to oversized images and the relative URL use case, but it does not significantly expand on what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Fetch') with a clear resource ('an image from a URL') and specifies the output format ('base64 image content'). It also includes a concrete use case with relative image URLs, effectively distinguishing it from sibling tools like fetch_url.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use the tool: 'Use when a page's markdown contains relative image URLs... and you need to view the image.' It provides clear context but does not explicitly list alternatives or when-not-to-use scenarios, so it doesn't earn a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

fetch_urlA

Fetch a URL and return its main readable content as clean markdown by default (Readability extraction). Options: format=markdown|text|html|readable, includeLinks=false to strip hyperlinks, maxChars to truncate. Useful for reading a web page, understanding a code/docs page, or getting article content without boilerplate.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesAbsolute URL to fetch (http/https).
formatNoOutput format. 'markdown' = readable article as markdown (default). 'readable' = same but also returns title/excerpt/length. 'text' = stripped text. 'html' = raw HTML.markdown
maxCharsNoTruncate output to this many characters (0/unset = no limit).
includeLinksNoIf false, strip <a> links when converting to markdown/text.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It reveals the Readability extraction behavior, default markdown output, and the impact of options like includeLinks and maxChars. This goes beyond minimal disclosure, though it omits potential error behaviors or rate limits, which are not essential for this simple tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no redundancy. The first sentence states the core function and default behavior, while the second lists options and use cases. It is front-loaded with the key action and every clause contributes value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple four-parameter tool with a fully described schema and no output schema, the description covers the operation, options, and ideal use cases. It does not address error handling or rate limits, but these are not critical for this tool's primary functions. The description is sufficiently complete to guide usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description mentions format options, includeLinks, and maxChars, but essentially restates what the schema already provides. It adds no new semantic meaning beyond the schema descriptions, so a 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'Fetch a URL and return its main readable content as clean markdown by default (Readability extraction)', giving a specific verb ('fetch') and resource ('URL'), and clearly distinguishes from sibling tools by focusing on readable content extraction. This differentiates it from extract_links (link extraction), fetch_image (image fetching), and search_content (content search).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit use cases: 'reading a web page, understanding a code/docs page, or getting article content without boilerplate.' It does not explicitly mention alternatives or when-not-to-use, but the context is clear enough to guide selection. The inclusion of sibling tool names in context also helps, but no direct comparison is made.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_contentA

Search the content of a URL (or raw HTML) and return matching snippet(s) with surrounding context and line numbers. Useful to find specific text/code/errors on a page without reading the whole thing.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlNoURL to fetch and search. Required unless 'html' is provided.
htmlNoRaw HTML to search instead of fetching.
formatNoSource content format to search in.markdown
patternYesRegex pattern to search for in the page's text content.
maxMatchesNoMax matches to return.
contextCharsNoCharacters of context before and after each match.

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that it returns snippets with context and line numbers, which clarifies the output format, but it does not disclose details about making network requests, potential side effects, or any limitations. The description is adequate but not rich in behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the primary action, and every word earns its place. It is concise yet informative, with no redundant or filler content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 6 parameters and no output schema, but the description provides sufficient context: it explains the core functionality, gives a use case, and describes the return format (snippets with context and line numbers). However, it does not address the 'format' parameter or clarify the relationship with the sibling tool fetch_and_search, leaving minor gaps for a complex tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds minimal parameter meaning by mentioning 'URL (or raw HTML)', which aligns with the url and html params, but it does not add substantive detail beyond what the schema already documents. Thus, the description neither substantially improves nor harms parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Search the content of a URL (or raw HTML) and return matching snippet(s) with surrounding context and line numbers.' This uses a specific verb and resource, and it distinguishes from fetch_url and extract_links, but it does not explicitly differentiate from the sibling tool fetch_and_search, which likely has a similar purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides context for when to use the tool: 'Useful to find specific text/code/errors on a page without reading the whole thing.' This gives clear usage context, but it does not mention alternative tools or when not to use this tool, so it lacks exclusions or explicit comparisons.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv1.3.0
    • First observedextract_links
    • First observedfetch_and_search
    • First observedfetch_image
    • First observedfetch_url
    • First observedsearch_content

TDQS

A4.2/5.0
Disambiguation5/5

Each tool targets a distinct output (content, links, search snippets, combined result, or image). The combo tool fetch_and_search is explicitly labeled as a one-shot convenience, so there is no ambiguity about when to use it.

Naming Consistency4/5

All tools use snake_case and start with a verb (fetch, extract, search). The only deviation is fetch_and_search, which uses a compound verb phrase rather than a strict verb_noun pattern, but it is still readable and consistent in style.

Tool Count5/5

Five tools is a well-scoped size for a URL context server. Each tool covers a distinct need without unnecessary overlap or bloat.

Completeness5/5

The set covers the core operations of fetching content, extracting links, searching within pages, retrieving images, and a combined mode. No obvious missing functionality for the stated purpose.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    An MCP server that fetches web pages and extracts clean, AI-friendly Markdown content using Mozilla Readability. It provides secure web access for LLMs with built-in SSRF protection and automated content cleaning for improved context retrieval and summarization.
    1
    311
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    An MCP server that enables AI assistants to fetch web content in multiple formats (HTML, JSON, text, Markdown) with intelligent content extraction, chunk management, and browser automation support.
    5
    52
    15
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that gives AI tools a reliable way to fetch content from the web, handling anti-bot protection and JavaScript-rendered pages.
    885
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SkillfulElectro/url-context-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server