contextfetch-mcp
This MCP server gives AI agents web search, clean LLM-ready Markdown, multi-query research, crawling, site mapping, and account management.
Search the web with optional domain filters and query-pruned Markdown results (
contextfetch_search).Fetch any public page as clean Markdown, optionally limited to passages relevant to a query (
contextfetch_extract_url).Find similar pages to a URL while excluding the source domain (
contextfetch_find_similar).Run server-side research with up to 5 sub-queries, deduped sources, ranked evidence packs, and numbered citations (
contextfetch_research; legacycontextfetch_deep_researchwith up to 3).Get extractive answers as verbatim quoted passages with citations, with no generated text (
contextfetch_answer).Crawl a site within depth/page limits, obeying robots.txt, with optional query-based pruning (
contextfetch_crawl).List a site’s URLs from sitemaps and start-page links without fetching pages (
contextfetch_map).Check remaining credits, burn rate, and auto-reload settings (
contextfetch_balance).Turn auto-reload on/off or adjust threshold, pack, and monthly cap (
contextfetch_auto_reload).Claim a free API key with 2,500 searches, one per network (
contextfetch_get_free_key).
Returns ready-to-use Stripe Checkout buy links for ContextFetch credit packs (instant, builder, scale) when credits run out or the free tier is exhausted, and supports configuring auto-reload, which re-purchases a pack against the card saved at checkout up to a monthly spending cap.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
ContextFetch MCP server
Web search and clean, LLM-ready Markdown for AI agents: $1 per 1,000 searches, and 25 a day free with no key and no signup.
claude mcp add contextfetch -- npx -y @contextfetch/mcpThat is the whole setup for Claude Code. Then ask your agent something that needs the web:
Search for how Postgres SKIP LOCKED works for job queues
contextfetch_search returns each page as Markdown, cut down to the passages that answer the query:
## 1. PostgreSQL Job Queues with SKIP LOCKED | CodeNotes
https://codenotes.tech/blog/postgresql-job-queues-with-skip-locked · score 1.000
FOR UPDATE SKIP LOCKED is useful because it lets many workers claim different rows without blocking on rows
another worker has already locked. But it is only the claiming primitive. A production queue also needs the
right schema, indexes, retry policy, stuck-job recovery, cleanup, monitoring, and replay-safe handlers.
...11 tools: search, page to Markdown, find similar, research, answer, crawl, site map, balance, free key and auto top-up. Exa- and Tavily-compatible API underneath, at contextfetch.dev.
Install
Claude Code (one line, keyless):
claude mcp add contextfetch -- npx -y @contextfetch/mcpWith a paid key:
claude mcp add contextfetch -e CONTEXTFETCH_API_KEY=your_key -- npx -y @contextfetch/mcpCursor: add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project):
{
"mcpServers": {
"contextfetch": {
"command": "npx",
"args": ["-y", "@contextfetch/mcp"],
"env": { "CONTEXTFETCH_API_KEY": "your_key" }
}
}
}Windsurf: add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"contextfetch": {
"command": "npx",
"args": ["-y", "@contextfetch/mcp"],
"env": { "CONTEXTFETCH_API_KEY": "your_key" }
}
}
}To use the free tier, drop the env block (or leave CONTEXTFETCH_API_KEY empty). The same JSON works in Claude Desktop's claude_desktop_config.json and in any other MCP client that launches stdio servers.
Requires Node.js 18 or newer.
Related MCP server: Neurobird Search MCP server
Tools
Tool | Arguments | What it does | Cost |
|
| Web search. Each result comes back as title, URL and only the passages relevant to your query (cross-encoder pruned Markdown). | $1 per 1,000 |
|
| Any public page (docs, articles, GitHub files, arXiv) as clean Markdown with tables kept. With | $1 per 1,000 |
|
| Pages similar to a URL, excluding its own domain. | $1 per 1,000 |
|
| Server-side research: runs the sub-queries concurrently, dedupes pages by URL, ranks them all against | $1 per 1,000 sub-queries (max 5) |
|
| The earlier name of | $1 per 1,000 sub-queries (max 3) |
|
| Extractive answer: the best-scoring passages of the top pages, quoted verbatim with | $1 per 1,000 |
|
| Crawls one site from | $1 per 1,000 pages |
|
| Lists a site's URLs from its sitemaps and the start page's links without fetching the pages. | $1 per 1,000 |
| none | Remaining credits, burn rate (credits/day over the last 7 days) and auto-reload settings, including the last auto-reload error if a payment failed. Needs | free |
| none | Claims the network's free API key (2,500 searches, one per network) and uses it for the rest of the session. Give it to your user to keep in | free |
|
| Turns auto-reload on or off or changes it: when credits drop below | free |
All tools return Markdown text. Without a key, contextfetch_balance and contextfetch_auto_reload return a short message saying they need one, with the buy link. On the free tier, results start with a one-line notice showing how many free searches are left today. When the API reports them, a closing line shows latency (total and per stage: recall, fetch, rerank), whether the answer came from cache, and token savings (pruned tokens vs raw page tokens).
contextfetch_research sub-queries
Pass your own sub_queries (different angles on the question); the tool description tells the calling model to do so. If you omit them, the API derives them from query with fixed rules:
the query itself;
the query +
documentation;the query +
benchmarkwhen it mentions speed, performance, latency, memory or a comparison (vs,compare), otherwise the query +example.
A suffix the query already contains is skipped (so react useActionState example runs 2 searches, not 3). The whole research runs server-side in one /v1/research call that costs $1 per 1,000 sub-queries; a sub-query that fails is refunded and named in the header. If all fail, the tool returns the error.
Environment variables
Variable | Default | Meaning |
| unset | Your API key. Unset or empty uses the free keyless tier. |
|
| API base URL. Point it at your own engine if you self-host. |
Free tier and pricing
Price | |
No key | 25 searches a day per network, no signup |
Free key ( | 2,500 searches, one per network, no card |
Search, page to Markdown, answer, find similar, map | $1 per 1,000 |
Crawl | $1 per 1,000 pages returned |
Research | $1 per 1,000 sub-queries |
Pay as you go: top up from $10 (+10% from $100, +20% from $500). The balance never expires and one balance covers all your keys. Monthly plans and per-key limits are in the dashboard at contextfetch.dev/account.
When the balance or the free tier runs out (HTTP 402), the tool returns a one-click top-up link (Stripe: card,
Apple Pay, Google Pay) and a line to pass on to your user. Then set CONTEXTFETCH_API_KEY as shown above.
Retries and connections
Connection failures before the request is sent (refused, DNS, connect timeout), HTTP 429 and HTTP 5xx are retried with exponential backoff and jitter (about 0.25-0.5 s, then 0.5-1 s), at most 3 attempts per API call and 30 seconds in total, retries included. A 429 or 5xx with a Retry-After header waits exactly that long, unless that would pass the 30 second budget. 400, 401, 402, 422 and other 4xx responses are never retried. A connection that drops after the request was sent is not retried either, since the search may already have been billed. Connections are pooled and kept alive by Node's built-in fetch (undici), so there is no extra HTTP dependency.
Errors
Errors never crash the server; they come back as tool results with isError: true and a plain explanation: invalid key (401), out of credits or free limit reached (402, lists the packs with their buy links), no saved card for auto-reload (409, with the buy link), URL not allowed (400, only public http(s) URLs), a page contextfetch_extract_url could not fetch (with the reason, such as HTTP 404), rate limited (429), server errors (5xx), network failures, and a 30 second limit per call (retries included).
Develop
npm install
npm run build # compiles src/ to dist/ and marks dist/index.js executable
npm test # builds, then drives dist/index.js over stdio against a local mock API (no network)
CONTEXTFETCH_API_BASE=http://localhost:8000 node dist/index.jsPublish
Publishing @contextfetch/mcp needs the npm organization contextfetch (create it at npmjs.com and add the publishing account as a member). Then npm publish from this folder; publishConfig.access is already public and prepublishOnly builds first.
License
MIT
Available Tools
11 toolscontextfetch_answerContextFetch extractive answerARead-onlyInspect
Answer a question with passages quoted verbatim from the web, never generated: searches, scores every passage of the top pages with a cross-encoder and returns the best ones with [n] citations to their sources. Use it for quick factual lookups; the quotes may not fully answer an open-ended question. Costs 1 credit.
Inputs: query (required), num_results.
contextfetch_auto_reloadContextFetch auto-reloadAIdempotentInspect
Turn auto-reload on or off, or change it: when credits drop below threshold, the saved card buys pack again, up to monthly_max_usd per month. Needs CONTEXTFETCH_API_KEY and a card saved at checkout. The monthly cap cannot be raised above $500 here.
Inputs: enabled (required), pack, threshold, monthly_max_usd.
contextfetch_balanceContextFetch balanceARead-onlyInspect
Show the API key's remaining credits, daily burn rate (7-day average) and auto-reload settings, including the last auto-reload error if a payment failed. Needs CONTEXTFETCH_API_KEY; free. Check it before long jobs.
Inputs: no named parameters.
contextfetch_crawlContextFetch site crawlARead-onlyInspect
Crawl one website from a start URL and get its pages as Markdown: same-site links only, up to max_depth hops (<= 3) and limit pages (<= 50), robots.txt obeyed. Pass query to rank the pages by relevance and return only their relevant passages. Costs 1 credit per page returned.
Inputs: url (required), limit, query, max_depth, +2 more.
contextfetch_deep_researchContextFetch deep researchARead-onlyInspect
Same as contextfetch_research (kept for existing setups): up to 3 sub-queries run server-side, sources deduped and ranked against the question, one Markdown evidence pack with numbered sources and query-pruned passages. Each sub-query is one search and costs 1 credit. You SHOULD pass your own sub_queries (up to 3 distinct angles on the question) for better coverage. If omitted they are derived from query: the query itself, query + "documentation", and query + "benchmark" when it asks about speed, performance or comparisons, else query + "example" (a suffix the query already contains is skipped).
Inputs: query (required), sub_queries, num_results_per_query.
contextfetch_extract_urlContextFetch URL to MarkdownARead-onlyInspect
Fetch a public web page (docs, articles, GitHub files, arXiv papers) as clean Markdown with tables preserved. Pass query to get only the passages relevant to it instead of the whole page.
Inputs: url (required), query.
contextfetch_find_similarContextFetch find similar pagesARead-onlyInspect
Find pages similar to a given URL (alternatives, related docs, competing libraries), excluding the source domain. Returns titles, URLs and the most relevant passages as Markdown.
Inputs: url (required), num_results.
contextfetch_get_free_keyContextFetch free API keyAInspect
Get a free ContextFetch API key with 2,500 searches (one per network, no sign-up). This session uses it right away; give it to your user so they can set CONTEXTFETCH_API_KEY to keep it.
Inputs: no named parameters.
contextfetch_mapContextFetch site mapARead-onlyInspect
List a website's URLs without fetching its pages: its sitemaps (from robots.txt, else /sitemap.xml) plus the start page's links, same site only, up to limit (<= 5,000). Use it to find the right pages before contextfetch_extract_url or contextfetch_crawl. Costs 1 credit.
Inputs: url (required), limit, exclude_paths, include_paths.
contextfetch_researchContextFetch research (evidence pack)ARead-onlyInspect
Research a question in one call, server-side: runs up to 5 web searches (sub-queries) concurrently, dedupes the pages by URL, ranks them all against the question with a cross-encoder and returns one Markdown evidence pack with numbered [n] sources and their query-pruned passages, quoted verbatim (no generated text). Costs 1 credit per sub-query. Pass your own sub_queries (distinct angles on the question) for better coverage. If omitted they are derived from query: the query itself, query + "documentation", and query + "benchmark" when it asks about speed, performance or comparisons, else query + "example" (a suffix the query already contains is skipped).
Inputs: query (required), sub_queries, num_results_per_query.
contextfetch_searchContextFetch web searchARead-onlyInspect
Search the web and get LLM-ready Markdown. Each result has its title, URL and only the passages relevant to the query (cross-encoder pruned context), so it costs far fewer tokens than raw pages. Use for current events, documentation, APIs, research and fact checking.
Inputs: query (required), num_results, exclude_domains, include_domains.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools target clearly distinct operations (search, extract_url, crawl, map, find_similar, balance). The main overlap is contextfetch_research vs contextfetch_deep_research, which the description openly admits is essentially the same tool kept for backwards compatibility, plus some conceptual overlap among search/answer/research.
All names use a consistent contextfetch_ prefix and snake_case, making the set predictable. The only deviation is that some are verb_noun (extract_url, find_similar, get_free_key) while others are bare verbs or nouns (search, answer, crawl, map, balance), but this is minor and readable.
11 tools is well within the ideal 3-15 range for a web-context service. Each tool covers a distinct capability (fetch, crawl, search, research, discovery, billing), with only the redundant deep_research arguably not earning a slot.
The surface covers the full lifecycle for a web-context service: onboarding (get_free_key), discovery (map, find_similar), retrieval (extract_url, crawl, search), synthesis (research, answer) and account management (balance, auto_reload). No obvious dead ends for the stated purpose.
Maintenance
Related MCP Connectors
Web search, Google SERP, page extraction to markdown and cited answers for AI agents.
LLM-ready web search + instant answers + URL-to-clean-text fetch for agents and RAG.
Web search and content extraction for AI: Google results, any page as Markdown or JSON
Web scraping, search, crawling, structured extraction and research for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceWeb search, clean page reading & one-call research dossiers for AI agents. No API key — your agent does the synthesis.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to perform live web searches with ranked results and extracted page passages, plus clean markdown extraction of any URL.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to search multiple web providers in parallel and crawl single pages or entire sites into clean, deduplicated Markdown or JSON, including authenticated crawls.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to search the web across configured providers and crawl individual pages or entire sites into clean, deduplicated Markdown or JSON.-