CrawlForge
HomeUse CasesIntegrationsPricingDocumentationBlog
How to Scrape Websites with Claude Code (2026 Guide)
Tutorials
Back to Blog
Tutorials

How to Scrape Websites with Claude Code (2026 Guide)

C
CrawlForge Team
Engineering Team
April 14, 2026
10 min read

On this page

Claude Code can edit files, run shell commands, and write tests -- but it cannot fetch live web pages on its own. Connect it to CrawlForge MCP and it gains 20 scraping tools that run straight from your terminal.

Bash

This guide shows you how to scrape websites with Claude Code using CrawlForge MCP, from installation to stealth-mode bypass. Every code block below is runnable.

Table of Contents

  • The Problem: Claude Code Cannot Fetch URLs
  • Prerequisites
  • Step 1: Install CrawlForge MCP
  • Step 2: Get Your API Key
  • Step 3: Register the MCP Server with Claude Code
  • Step 4: Verify the Connection
  • Step 5: Your First Scrape
  • Full Working Example: Scrape a Pricing Page
  • Advanced: Scrape JavaScript-Rendered Sites
  • Troubleshooting
  • FAQ

The Problem: Claude Code Cannot Fetch URLs

By default, Claude Code has no network access. Ask it to "read this blog post" and it will tell you it cannot open URLs. The built-in WebFetch helper exists in Claude Desktop but is limited, rate-capped, and frequently blocked by Cloudflare, Akamai, and other edge protections.

CrawlForge MCP solves this by exposing 20 scraping tools -- fetch_url, extract_content, scrape_structured, stealth_mode, deep_research, and more -- as Model Context Protocol tools that Claude Code can call like any other function. For more background on the protocol itself, see our complete guide to MCP web scraping.

Prerequisites

  • Node.js 18+ -- check with node --version
  • Claude Code -- install with npm install -g @anthropic-ai/claude-code
  • A CrawlForge account -- free at crawlforge.dev/signup (1,000 credits included, no credit card)

Step 1: Install CrawlForge MCP

Bash

Verify the install:

Bash

Step 2: Get Your API Key

  1. Go to crawlforge.dev/signup and create an account.
  2. Open the dashboard at crawlforge.dev/dashboard/api-keys.
  3. Copy the key -- it starts with cf_live_.

Step 3: Register the MCP Server with Claude Code

The fastest path is the setup wizard:

Bash

It writes the correct entry to ~/.config/claude-code/mcp.json (Linux/macOS) or %APPDATA%\claude-code\mcp.json (Windows).

If you prefer manual configuration, add this to your Claude Code MCP config:

Json

Restart Claude Code so it picks up the new server.

Step 4: Verify the Connection

Open Claude Code and run:

/mcp

You should see crawlforge listed as connected with 20 tools available. If not, jump to Troubleshooting.

Step 5: Your First Scrape

Paste this prompt into Claude Code:

Fetch https://news.ycombinator.com using CrawlForge and give me the top 5 story titles with their URLs as a JSON array.

Claude Code will call fetch_url (1 credit), parse the HTML, and return something like:

Json

That is it. You are scraping.

Full Working Example: Scrape a Pricing Page

Here is a realistic task: extract pricing tiers from a SaaS site. Paste this prompt:

Use scrape_structured to extract pricing from https://crawlforge.dev/pricing. Return an array of { plan, price, credits, features[] }.

Behind the scenes, Claude Code builds a request like this:

Typescript

Cost: 2 credits. Compare that to running a headless browser locally: zero infrastructure, no Puppeteer debugging, no Cloudflare roulette.

Advanced: Scrape JavaScript-Rendered Sites

Some sites render pricing or product data through client-side React. fetch_url returns the pre-hydration HTML shell and misses the data. Switch to scrape_with_actions (5 credits):

Typescript

For Cloudflare and Akamai-protected sites, use stealth_mode (also 5 credits). We cover the fingerprint-rotation tradeoffs in our stealth mode deep dive.

Tool Quick Reference

ToolCreditsWhen to use
fetch_url1Static HTML, you will parse yourself
extract_text1Clean readable text from article pages
extract_content2Readability-style main content extraction
scrape_structured2CSS selectors into typed fields
search_web5You do not know the URL yet
scrape_with_actions5SPA requires clicks, waits, scrolls
stealth_mode5Anti-bot systems (Cloudflare, DataDome)
deep_research10Multi-source research with citations

Full list in our 20-tools overview.

Troubleshooting

"MCP server failed to start" -- Confirm crawlforge-mcp-server is on your PATH. Run which crawlforge-mcp-server. If empty, reinstall globally: npm install -g crawlforge-mcp-server.

"Unauthorized" or 401 errors -- Your API key is missing or malformed. It must start with cf_live_. Re-export in your shell: export CRAWLFORGE_API_KEY="cf_live_..." and restart Claude Code.

"Insufficient credits" -- Check usage at crawlforge.dev/dashboard/usage. Free tier = 1,000 credits/month. Upgrade to Hobby ($19/mo) for 25,000.

Tools list is empty in /mcp -- MCP config is not being read. On macOS the file lives at ~/Library/Application Support/claude-code/mcp.json. On Linux: ~/.config/claude-code/mcp.json. On Windows: %APPDATA%\claude-code\mcp.json.

Cloudflare 403 on every fetch -- Swap fetch_url for stealth_mode. If you still get blocked, the target uses server-side JA3/JA4 fingerprinting; open an issue on GitHub with the URL.

FAQ

See the FAQ section below for quick answers to the most common questions.

Next Steps

  • Read the CrawlForge quick start for five copy-paste examples
  • Browse the getting started docs for full API reference
  • Compare MCP clients in Claude Desktop vs Claude Code
  • Evaluate alternatives at Firecrawl alternative

Start free with 1,000 credits at crawlforge.dev/signup. No credit card required.

Tags

Claude-Codeweb-scrapingMCPtutorialCLIAI-agentsgetting-started

About the Author

C

CrawlForge Team

Engineering Team

Building the most comprehensive web scraping MCP server. We create tools that help developers extract, analyze, and transform web data for AI applications.

On this page

Frequently Asked Questions

Can Claude Code scrape websites without CrawlForge?+

Not reliably. Claude Code has no built-in network access, and the WebFetch helper in Claude Desktop is rate-limited and blocked by most anti-bot systems. CrawlForge MCP adds 20 dedicated scraping tools that handle static HTML, JavaScript-rendered pages, and Cloudflare-protected sites.

How much does it cost to scrape with Claude Code?+

CrawlForge uses a credit model: basic fetches cost 1 credit, structured extraction 2 credits, search 5, stealth 5, deep research 10. Free accounts get 1,000 credits per month with no credit card. The Hobby plan ($19/mo) includes 25,000 credits.

Why do I get 403 errors when Claude Code fetches certain URLs?+

Sites protected by Cloudflare, DataDome, or Akamai block generic HTTP clients via TLS fingerprinting and JavaScript challenges. Switch from fetch_url (1 credit) to stealth_mode (5 credits), which rotates browser fingerprints and solves challenges automatically.

Does CrawlForge MCP work with Claude Code on Windows?+

Yes. Install via npm, run npx crawlforge-setup, and the config lands at %APPDATA%\\claude-code\\mcp.json. Node.js 18+ is the only system requirement. Windows users should run the setup command from PowerShell or Windows Terminal for the cleanest experience.

What is the difference between fetch_url and scrape_with_actions?+

fetch_url returns raw HTML via a fast HTTP request (1 credit). scrape_with_actions spins up a headless browser, executes clicks/waits/scrolls, then captures the hydrated DOM (5 credits). Use fetch_url for static pages and scrape_with_actions only when JavaScript rendering is required.

Related Articles

CrawlForge MCP Quick Start: Zero to Web Scraping in 60 Seconds
Tutorials

CrawlForge MCP Quick Start: Zero to Web Scraping in 60 Seconds

Install CrawlForge MCP, grab your free API key, and run your first web scrape in under a minute. Five copy-paste examples for Claude and Cursor.

C
CrawlForge Team
|
Mar 31
|
3m
How to Scrape Websites in Cursor IDE with CrawlForge MCP
Tutorials

How to Scrape Websites in Cursor IDE with CrawlForge MCP

Turn Cursor IDE into a web scraping workstation. Connect CrawlForge MCP and extract structured data from any site without leaving your editor.

C
CrawlForge Team
|
Apr 14
|
9m
How to Scrape Websites in Zed AI with CrawlForge MCP
Tutorials

How to Scrape Websites in Zed AI with CrawlForge MCP

Add web scraping to Zed AI in 3 minutes. Configure CrawlForge MCP in Zed so your editor can fetch, extract, and research live web data on demand.

C
CrawlForge Team
|
Apr 14
|
9m

Footer

CrawlForge

Enterprise web scraping for AI Agents. 20 specialized MCP tools designed for modern developers building intelligent systems.

Product

  • Features
  • Pricing
  • Use Cases
  • Integrations
  • Changelog

Resources

  • Getting Started
  • API Reference
  • Templates
  • Guides
  • Blog
  • FAQ

Developers

  • MCP Protocol
  • Claude Desktop
  • Cursor IDE
  • LangChain
  • LlamaIndex

Company

  • About
  • Contact
  • Privacy
  • Terms

Stay updated

Get the latest updates on new tools and features.

Built with Next.js and MCP protocol

© 2025-2026 CrawlForge. All rights reserved.