> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prefetch.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> Connect Claude, ChatGPT, Cursor or any MCP client to Prefetch, so your agent can scrape, crawl, enrich and monitor on its own.

Prefetch speaks the [Model Context Protocol](https://modelcontextprotocol.io), so an AI agent can call the API directly instead of you writing HTTP glue for it.

There's nothing to install. The MCP server *is* the API, at one endpoint:

```
https://api.prefetch.io/mcp
```

Apps sign you in with your Prefetch account, so there's no key to copy. Clients you configure yourself can use your API key instead.

## Connect

> [tab] Claude
>
> Prefetch is in the Claude directory. It works on claude.ai, Claude Desktop and Claude mobile.
>
> 1. Open [Prefetch in the Claude directory](https://claude.ai/directory/prefetch) and select **Connect**.
> 2. Sign in to Prefetch and select **Allow access**.
>
> On Team and Enterprise plans, an Owner first adds Prefetch under **Organization settings → Connectors**. Members then connect with their own Prefetch account.

> [tab] ChatGPT
>
> 1. Open [chatgpt.com/plugins](https://chatgpt.com/plugins), select **+**, then **Add custom MCP server**.
> 2. Enter a name, paste `https://api.prefetch.io/mcp`, and choose **OAuth** for authentication.
> 3. Create it, sign in to Prefetch, and select **Allow access**.

> [tab] Claude Code
>
> If you sign in to Claude Code with your Claude account, connectors you add on claude.ai come with it. Once you've connected Prefetch from the [Claude directory](https://claude.ai/directory/prefetch), it's already listed under `/mcp`.
>
> Otherwise, add the server directly:
>
> ```bash theme={"theme":"css-variables"}
> claude mcp add --transport http prefetch https://api.prefetch.io/mcp
> ```
>
> Then run `/mcp`, choose **prefetch**, and select **Authenticate** to sign in from your browser.
>
> To use an API key instead, for CI or a machine without a browser:
>
> ```bash theme={"theme":"css-variables"}
> claude mcp add --transport http prefetch https://api.prefetch.io/mcp \
>   --header "X-API-Key: $PREFETCH_API_KEY"
> ```

> [tab] Cursor
>
> Add this to `.cursor/mcp.json` in your project, or to `~/.cursor/mcp.json` for every project:
>
> ```json theme={"theme":"css-variables"}
> {
>   "mcpServers": {
>     "prefetch": {
>       "url": "https://api.prefetch.io/mcp"
>     }
>   }
> }
> ```
>
> Cursor opens the Prefetch sign-in when it first connects. To use an API key instead, add `"headers": { "X-API-Key": "your_api_key_here" }`.

> [tab] Other clients
>
> Any client that supports remote MCP servers over streamable HTTP works. Point it at:
>
> ```
> https://api.prefetch.io/mcp
> ```
>
> Clients that support MCP authorization sign you in on their own. Otherwise, send your key as an `X-API-Key` or an `Authorization: Bearer` header.

When you sign in, the consent screen shows which app is asking and where it will send you back. A connected app's calls use your account's credits, exactly like API requests. You can see and disconnect your apps under **Connected Apps** on the [dashboard](https://prefetch.io/dashboard). A disconnected app loses access on its next call.

> [!WARNING]
>
> If you use an API key, keep it in your client's secret storage or an environment variable, never in the URL. URLs end up in logs, shell history and shared config files.

## Try it

Once you're connected, ask for what you want in plain language:

> Get me the brand colors and industry category for stripe.com

> Find every pricing page on vercel.com and summarize what changed

> Crawl the /docs section of fastapi.tiangolo.com and list the endpoints it documents

> Watch linear.app/pricing every morning and tell me when a plan's price changes

Your agent picks the right tool, calls it, and reads the result.

## The tools

| Tool | What it does | Credits |
| - | - | - |
| `prefetch_resolve` | A company, brand or product name → its domain | 1, or 3 with a live lookup |
| `prefetch_transaction` | A card transaction line → its merchant | 3, or 1 for a repeat |
| `prefetch_search` | Web search results, optionally with each page's content | 2 per 10 results, + each page scraped |
| `prefetch_scrape` | One page as markdown, summary, HTML, links, images or JSON | 1, or 4 with summary or JSON |
| `prefetch_map` | Every URL a site exposes, without fetching the pages | 1 |
| `prefetch_crawl` | Many pages of a site as markdown | 1 per page |
| `prefetch_batch_scrape` | A list of known URLs as markdown | 1 per page |
| `prefetch_batch` | Brand, enrich, company, classify, screenshot or styleguide on many URLs | Each URL's price |
| `prefetch_check_crawl_status` | Status and results for a crawl or batch | Free |
| `prefetch_cancel_crawl` | Stop a crawl early | Free |
| `prefetch_enrich` | Brand, company and classification in one call | 12 |
| `prefetch_brand` | Colors, fonts, logos, favicon and Open Graph images | 10 |
| `prefetch_company` | Name, emails, addresses and social profiles | 5 |
| `prefetch_classify` | IAB category, description and stock tickers | 5 |
| `prefetch_styleguide` | A site's design system, with CSS and Tailwind exports | 10 |
| `prefetch_screenshot` | Render a page and return a hosted image URL | 1 |
| `prefetch_logo_urls` | Embeddable logo URLs for up to 50 domains | Free, from your logo quota |
| `prefetch_answer` | A researched, sourced answer in the JSON shape you give | 10, or 100 in `ultra` mode |
| `prefetch_create_monitor` | Watch pages on a schedule, optionally against a goal | Free. Each check is billed. |
| `prefetch_run_monitor` | Run a monitor's check now and see what changed | 1 per page, +3 per JSON extraction, +1 per change judged |
| `prefetch_get_monitor_check` | What a monitor's check found | Free |
| `prefetch_list_monitors`, `prefetch_get_monitor` | Your monitors and their recent checks | Free |
| `prefetch_update_monitor`, `prefetch_delete_monitor` | Change, pause, resume or delete a monitor | Free |

See the [tool reference](https://docs.prefetch.io/mcp/tools.md) for every parameter. Credits work exactly as they do over REST: same prices, and only successful calls are charged. See [Credits](https://docs.prefetch.io/concepts/credits.md).

## How crawling works

A crawl takes minutes, which is longer than an agent wants to wait on a tool call. So `prefetch_crawl` starts the crawl and waits for it, up to `wait_seconds` (60 by default).

If the crawl finishes in time, you get the pages straight away. If not, you get the crawl id and an instruction:

```
Crawl crw_a1b2c3 is still running: 12 of 25 pages done.

Call prefetch_check_crawl_status with id="crw_a1b2c3" to collect the results.
Call prefetch_cancel_crawl with the same id to stop it early.
```

* **Polling is free.** Pages are billed as they complete, so checking twice never charges twice.
* **Disconnecting cancels the crawl.** If your client hangs up while `prefetch_crawl` is still waiting, the crawl stops rather than running on and billing pages nobody will read.

`prefetch_batch` and `prefetch_batch_scrape` wait the same way.

## How monitors work

A monitor keeps checking after the conversation ends, so its results have to be read back. `prefetch_run_monitor` runs a check and waits for it, and `prefetch_get_monitor_check` shows the latest check at any time. Both answer with what changed, not with every page:

```
Check chk_8e2d… completed (manual). 12 pages: 1 changed, 11 unchanged. Credits charged: 37.

## CHANGED: Pricing (https://example.com/pricing)
Judge: MEANINGFUL (high confidence). The Starter plan went from $19 to $24 a month.
- plans[0].price: "$19/mo" → "$24/mo"
```

The first check records a baseline, so changes show from the second check on. `run_now: true` on `prefetch_create_monitor` takes that first check straight away. Every check is billed for as long as the monitor is active, and the create tool tells the agent so. Pause or delete monitors you no longer need.

## Response size

Tool results go straight into your agent's context window, so content is capped at **50,000 characters** per result, well below the REST API's 1 MB cap. A full Wikipedia article in `raw_html` is about 240,000 characters, and one uncapped call like that would crowd out most of what the agent knows.

Truncation is always announced:

```
---
[truncated: 189,747 of 239,747 characters omitted.
 Narrow the extraction with include_selectors, or keep only_main_content=true.]
```

To fit more signal into less space:

> [card] Target the content
>
> Pass `include_selectors` with the part of the page you want, like `["article"]`.

> [card] Ask for a summary
>
> Use `formats: ["summary"]` instead of `["markdown"]` when you only need the gist.

## Errors

Failures come back as readable tool results rather than transport errors, so your agent can read the message and correct itself:

```
formats: unsupported value(s) pdf. Supported: markdown, summary, html, raw_html, links, images, json (HTTP 400)
The target URL could not be resolved. Please check the domain name. (HTTP 422)
Private or reserved IP ranges are not allowed (HTTP 400)
```

Authentication is the exception, and fails at the HTTP layer. A `401` means no credentials, or an access token that expired or was disconnected, and apps react by refreshing the token or asking you to sign in again. A `403` means an invalid key or an account out of credits, which signing in again won't fix. See [Authentication](https://docs.prefetch.io/concepts/authentication.md) and [Error handling](https://docs.prefetch.io/concepts/errors.md).

## Good to know

> [accordion] What a connected app can do
>
> A connected app can call every tool on this page as you, and its calls use your credits. It can't see your password, payment details or API keys, and it can't change your plan.
>
> Each tool tells the app whether it only reads or changes something. Claude runs the read-only tools (scraping, mapping, brand and company lookups, reading monitors) without asking, and asks before anything that starts a crawl or creates, changes, runs or deletes a monitor.

> [accordion] MCP and REST are the same API
>
> Both run the same pipeline, so credits, caching, rate limits and the blocklist behave the same either way. An MCP scrape can even be answered from the cache a REST scrape filled, because both build the same cache key.

> [accordion] The endpoint is stateless
>
> Every request stands alone, so there are no MCP sessions to manage. Every tool is one request and one response. Long-running work like crawls and monitor checks is stored on our side and read back by id, so nothing is lost. `GET` and `DELETE` on `/mcp` return `405`. Use `POST`.

> [accordion] RapidAPI subscriptions can't use MCP
>
> RapidAPI meters usage from a response header that has to be set before the response body is written, and over MCP the cost of a call isn't known until the tool has run. Rather than under-bill silently, `/mcp` returns `400` for RapidAPI traffic.
>
> Everything is available over REST through RapidAPI as documented. MCP needs a Prefetch account: sign in when your app asks, or use a key from the [dashboard](https://prefetch.io/dashboard).

> [accordion] Which tool should my agent use?
>
> Each tool's description tells the agent when to use it and when to use something else, so this mostly takes care of itself. Two patterns help:
>
> * **`prefetch_enrich` beats three separate calls.** It's one page fetch instead of three, and costs less than `prefetch_brand`, `prefetch_company` and `prefetch_classify` together.
> * **Map, then scrape, usually beats crawling.** `prefetch_map` is cheap and tells you which pages exist. Scraping the three you want costs far less than crawling fifty.

## Next steps

> [card] [Tool reference](https://docs.prefetch.io/mcp/tools.md)
>
> Every tool, every parameter.

> [card] [Agent quickstart](https://docs.prefetch.io/agent-quickstart.md)
>
> One prompt that sets Prefetch up in your project.

> [card] [Authentication](https://docs.prefetch.io/concepts/authentication.md)
>
> Keys, OAuth and error codes.

> [card] [REST API](https://docs.prefetch.io/api-reference/introduction.md)
>
> The same capabilities over HTTP.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.