# How to give your AI agent web access (free, open source)

Practical ways to connect coding agents to live web search and scrape with Webcrawl MCP, CLI, and REST. Free hosted credits and MIT self-host.

Published: 2026-11-11
Updated: 2026-11-28
Author: Ajain Vivek

**TL;DR:** Connect your AI agent to the live web in under a minute using Webcrawl's hosted MCP (npx webcrawl setup), local stdio MCP, or REST via @webcrawl/client. Start free with 1,000 monthly credits or self-host the MIT engine.

Agents that cannot fetch the live web fill gaps from training data. That is fine for trivia and terrible for “what does this docs page say today?” This guide shows how to give an AI agent real web access with Webcrawl: hosted MCP, local MCP, CLI, and REST. You can start on the free hosted tier (1,000 credits a month, no card) or self-host the MIT engine. Checked **2026-11-28**.

Related reading: [AI agent web access use case](/use-cases/ai-agent-web-access), [best MCP servers for web scraping](/blog/best-mcp-servers-for-web-scraping), [what is an MCP server](/glossary/mcp-server).

## What should “web access” give an AI agent?

For coding agents and tool-using LLMs, web access usually means four verbs:

1. **Search** the public web for candidate URLs
2. **Scrape** a URL into Markdown the model can quote
3. **Map** or **crawl** a docs origin when you need coverage
4. **Extract** structured fields when you need JSON, not prose

Webcrawl exposes those as `POST /v1/search`, `/v1/scrape`, `/v1/map`, `/v1/crawl`, and `/v1/extract`, plus MCP tools that call the same engine. Credit costs are published on [`/health`](https://webcrawl.app/health) (`creditSchedule`) and [pricing](https://webcrawl.app/pricing).

## How do you connect hosted MCP (fastest for Claude, Cursor, Codex)?

```bash
npx webcrawl setup --agent cursor
# or
npx webcrawl setup --agent claude
npx webcrawl setup --agent codex
```

Hosted config shape:

```json
{
  "mcpServers": {
    "webcrawl": { "url": "https://webcrawl.app/mcp" }
  }
}
```

Claude CLI:

```bash
claude mcp add --transport http webcrawl https://webcrawl.app/mcp
```

Step-by-step install notes live on [Claude Code](/integrations/claude-code), [Cursor](/integrations/cursor), and [Codex](/integrations/codex).

## How do you run local MCP with an API key?

```bash
npx webcrawl login
```

```json
{
  "mcpServers": {
    "webcrawl": {
      "command": "npx",
      "args": ["-y", "@webcrawl/mcp"],
      "env": { "WEBCRAWL_API_KEY": "YOUR_API_KEY" }
    }
  }
}
```

Local MCP is the right default for headless agents and CI-like sandboxes where interactive sign-in is awkward.

## How do you wire REST or `@webcrawl/client` in your own tools?

When the runtime is LangChain, LlamaIndex, Mastra, CrewAI, the OpenAI Agents SDK, or a custom router, wrap the API yourself. We do not publish official packages for those frameworks; the honest guides are under [integrations](/integrations). For converting a single page into LLM-ready Markdown, see the [URL to Markdown](/url-to-markdown) API guide.

```bash
npm install @webcrawl/client
```

```ts
import { createClient } from "@webcrawl/client";

const client = createClient({ apiKey: process.env.WEBCRAWL_API_KEY });
const page = await client.scrape({ url: "https://example.com/docs" });
console.log(page.markdown);
```

## How do you use it free and open source without a card?

- **Hosted free tier:** 1,000 credits a month on [webcrawl.app](https://webcrawl.app) (see [pricing](/pricing))
- **MIT engine:** [brainfish-ai/webcrawl-anything](https://github.com/brainfish-ai/webcrawl-anything) with npm packages `webcrawl`, `@webcrawl/mcp`, and `@webcrawl/client`
- **Free tools (rate limited):** [website to Markdown](/tools/website-to-markdown), [URL extractor](/tools/website-url-extractor)

```bash
npx webcrawl doctor
npx webcrawl scrape https://example.com/docs
```

## Which prompt patterns work best?

- “Search for the official docs for X, scrape the getting-started URL, and quote the install commands.”
- “Map https://example.com/docs, list API reference URLs, then scrape the auth page.”
- “Extract plan names and prices from https://example.com/pricing as JSON.”

## When should you use something else?

- Need a marketplace Actor for one stubborn site: compare [Apify](/alternatives/apify)
- Already standardized on Firecrawl SDKs: read [compare Firecrawl](/compare/firecrawl)
- Looking for [Tavily alternatives](/alternatives/tavily) or a sourced [Webcrawl vs Tavily](/compare/tavily) comparison
- Looking for [SerpAPI alternatives](/alternatives/serpapi) or a sourced [Webcrawl vs SerpAPI](/compare/serpapi) comparison
- Looking for [Exa alternatives](/alternatives/exa) or a sourced [Webcrawl vs Exa](/compare/exa) comparison
- Looking for a [Jina Reader alternative](/alternatives/jina-reader) for URL to markdown
- Shopping a broader LLM scraping shortlist: [best web scraping APIs for LLMs in 2026](/blog/best-web-scraping-apis-for-llms)

## FAQ

### What is the fastest way to give Claude Code or Cursor web access?

Run `npx webcrawl setup --agent claude` or `npx webcrawl setup --agent cursor`. It registers `https://webcrawl.app/mcp` and walks through OAuth with 1,000 free monthly credits.

### How much does Webcrawl cost for an individual developer?

The hosted free tier gives 1,000 credits per month with no credit card required, and the underlying engine is MIT-licensed if you want to self-host without credit limits.

### Should an agent use search, map, or scrape first?

Use `search` when you do not know the URL yet, `map` when you know the domain and want its page list, and `scrape` once you have the exact URLs to read.

## Bottom line

Give agents web access with tools that map to real endpoints, publish credits, and offer a self-host path. Webcrawl’s MCP + REST + MIT engine is built for that loop. Start with `npx webcrawl setup`, verify with a scrape, then wrap REST only when your framework does not speak MCP.

HTML: https://webcrawl.app/blog/how-to-give-ai-agent-web-access
