Give Claude Code web search and a browser in one command
Add a remote MCP server to Claude Code in one terminal command for live web search, page crawling, and browser screenshots on one prepaid API key.
Nov 14, 2026 · 6 min read

One terminal command gives Claude Code claude code web search and a headless browser: register the Lovely Router MCP server. A single remote Model Context Protocol endpoint covers live web search, markdown page fetching, and full-page rendering on one prepaid API key. You skip local browser binaries and a separate set of search keys.
claude mcp add lovelyrouter \
--transport http \
https://api.lovelyrouter.com/mcp \
--header "Authorization: Bearer $LOVELYROUTER_API_KEY"After that, Claude Code can query the live web, read documentation published after its training cutoff, crawl multi-page sites, and screenshot rendered pages from the terminal session.
Why built-in web tools hit a wall on real tasks#
Claude Code ships with native WebSearch and WebFetch, documented in the Claude Code Python Agent SDK reference. In managed environments, the Claude Platform Web Search tool lets the model filter search results before they hit the context window. Those defaults are enough for a public error message or a static blog post. They fall short on three common engineering tasks.
Custom endpoints and newer models often drop default tool availability. The Claude Code Agent SDK documentation notes that several built-in tools are enabled by default only on Claude Opus 4.7, Claude Sonnet 4.6, Claude Haiku 4.5, and earlier models, unless you opt in. Route Claude Code through a custom base URL, or move to newer model IDs such as claude-sonnet-5.5 or claude-opus-5.5, and native search may not be attached to the session.
Static HTTP fetching cannot see JavaScript-rendered interfaces or visual layouts. Ask a coding agent to check how a competitor's pricing toggle renders, or to inspect a client-side single-page application, and a raw HTML fetch returns an empty shell. claude code mcp browser tools fix that by handing rendering and screenshots to a cloud browser worker, instead of stuffing raw DOM trees into the reasoning model's context window.
Local browser MCP servers need heavy local dependencies. Headless Chromium on a development machine or in a CI container uses memory, trips bot protections on target sites, and forces the main reasoning model through low-level click and navigation loops. Offload search, crawling, and browser agent work to a remote tool server and the local environment stays clean, with token use you can predict.
Add the MCP server and route your model on one key#
You can connect Lovely Router to Claude Code in two ways: attach the MCP tools to the setup you already have, or route both the Claude reasoning model and the MCP data tools through the same prepaid API key. One key means token spend for Claude, GPT, or Gemini and per-call spend for web tools come out of one balance.
Export your API key and point Claude Code at the Lovely Router Anthropic-compatible endpoint before you register the MCP server:
# 1. Point Claude Code at Lovely Router for model inference
export ANTHROPIC_BASE_URL="https://api.lovelyrouter.com"
export ANTHROPIC_API_KEY="lr_live_your_api_key_here"
# 2. Register the remote MCP server for web search and browser tools
claude mcp add lovelyrouter \
--transport http \
https://api.lovelyrouter.com/mcp \
--header "Authorization: Bearer $ANTHROPIC_API_KEY"
# 3. Verify the tools are registered
claude mcp listStart a session with claude --model claude-sonnet-5.5 and the agent sees the remote data tools for agents next to its local file and bash tools. You do not need wrapper scripts or hand-written tool schemas. The MCP server exposes tool definitions that Claude Code calls when a prompt needs external data:
web-search: Run a natural-language web query and return structured URLs and snippets for $0.00090 per search.google-search: Fetch a full Google results page when you need exact SERP ordering or domain-specific operator queries for $0.0013 per page.web-fetch: Read a single web page and convert its main content into clean markdown for $0.00090 per page.website-crawl: Crawl a multi-page documentation site or subdomain into markdown for $0.01 per page plus $0.01 per run.website-screenshot: Render a live web page in a real browser and capture a screenshot for $0.0027 per screenshot.
To check a tool outside Claude Code, or to call the same endpoint from a Python script the agent writes, hit the REST API with that same key:
import os
import requests
API_KEY = os.environ["ANTHROPIC_API_KEY"]
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
# Run a web search and capture a browser screenshot of the top result
search_resp = requests.post(
"https://api.lovelyrouter.com/v1/tools/web-search",
headers=headers,
json={"query": "Stripe Webhook signature verification v2026"},
timeout=30,
)
top_url = search_resp.json()["results"][0]["url"]
screenshot_resp = requests.post(
"https://api.lovelyrouter.com/v1/tools/website-screenshot",
headers=headers,
json={"url": top_url},
timeout=60,
)
print("Rendered screenshot URL:", screenshot_resp.json()["screenshot_url"])Run a task Claude Code could not finish before#
Take a job that fails in an offline terminal: migrate a billing integration to a newly released SDK, and check that the live checkout page still renders its regional payment methods.
Without web search and a browser, Claude Code guesses SDK method names from training data, hallucinates deprecated webhook headers, and cannot inspect the live staging URL. With the MCP server attached, one prompt is enough:
claude -p "Search for the latest webhook verification changes in our payment provider's docs, crawl their migration guide to markdown, update src/webhooks.ts, and take a screenshot of our staging checkout page plus two competitor checkout pages to verify the layout."Claude Code breaks the job into four tool steps before it writes code:
- Discovery (
web-search): The agent runs 4 targeted queries to locate the current changelog, the webhook signature specification, and two live reference checkouts. - Deep documentation read (
website-crawl): Instead of fetching URLs one by one, the agent triggers one crawl run across the 8-page migration guide (website-crawl), pulling clean markdown into its context. - Single-page verification (
web-fetch): The agent reads 5 individual GitHub issue pages and API reference endpoints to check edge cases on timestamp tolerances. - Visual verification (
website-screenshot): Because Claude is a multimodal model, the agent callswebsite-screenshoton the 3 live checkout URLs, inspects the returned images to confirm the payment buttons and fee disclosures render without layout shifts, and then patches the local TypeScript file.
Claude Code keeps the system prompt, repository tree, and crawled markdown in memory across tool turns, so prompt caching absorbs most of the token cost after the initial crawl. Run /cost inside the Claude Code session after the task to see the exact token counts for your repository.
Cost of a single migration and browser verification run#
Here is the cost of that task on claude-sonnet-5.5. The agent processes 50,000 uncached input tokens (new tool outputs and prompts), 150,000 cached input tokens across the multi-turn tool loop, and 8,000 output tokens for reasoning and code diffs.
| Item | Amount | Price | Cost |
|---|---|---|---|
Claude Sonnet 5.5 input (claude-sonnet-5.5) | 0.05M tokens | $2.00 per 1M | $0.10000 |
Claude Sonnet 5.5 cached input (claude-sonnet-5.5) | 0.15M tokens | $0.10 per 1M | $0.01500 |
Claude Sonnet 5.5 output (claude-sonnet-5.5) | 0.008M tokens | $10.00 per 1M | $0.08000 |
Web search (web-search) | 4 searches | $0.00090 per search | $0.00360 |
Read a web page (web-fetch) | 5 pages | $0.00090 per page | $0.00450 |
Crawl a website to markdown (website-crawl pages) | 8 pages | $0.01 per page | $0.08000 |
Crawl a website to markdown (website-crawl run) | 1 run | $0.01 per run | $0.01000 |
Screenshot a web page (website-screenshot) | 3 screenshots | $0.0027 per screenshot | $0.00810 |
| Total | $0.30120 |
The debugging, documentation crawl, and visual browser check costs $0.30120. LLM tokens are $0.10000 + $0.01500 + $0.08000 = $0.19500. The four web and browser tools add $0.00360 + $0.00450 + $0.08000 + $0.01000 + $0.00810 = $0.10620. Run the same workflow on claude-opus-5.5 ($4.00 per 1M input tokens, $20.00 per 1M output tokens, $0.20 per 1M cached input tokens) for deeper architectural changes and only the token rows change. MCP tool costs stay the same.
Scaling to automated nightly audits in CI#
Once the MCP configuration works interactively, run Claude Code headlessly in CI (claude -p "..." --output-format json) to audit external dependencies, watch competitor pricing pages, or check that production pages and contact forms render cleanly every night.
For high-volume jobs, pair claude-haiku-5.5 with search and extraction tools and a month of batch runs stays under ten dollars. Suppose a nightly job over 30 days checks 50 Google search result pages (google-search), reads 100 target web pages (web-fetch), takes 30 browser screenshots (website-screenshot), and extracts contact details from 20 partner domains (website-contacts, $0.015 per website plus $0.0015 per run). Over the month, claude-haiku-5.5 processes 2M input tokens, 10M cached input tokens, and 0.5M output tokens.
| Item | Amount | Price | Cost |
|---|---|---|---|
Claude Haiku 5.5 input (claude-haiku-5.5) | 2M tokens | $0.10 per 1M | $0.20000 |
Claude Haiku 5.5 cached input (claude-haiku-5.5) | 10M tokens | $0.01 per 1M | $0.10000 |
Claude Haiku 5.5 output (claude-haiku-5.5) | 0.5M tokens | $0.50 per 1M | $0.25000 |
Search Google (google-search) | 50 pages | $0.0013 per page | $0.06500 |
Read a web page (web-fetch) | 100 pages | $0.00090 per page | $0.09000 |
Screenshot a web page (website-screenshot) | 30 screenshots | $0.0027 per screenshot | $0.08100 |
Find emails & contacts (website-contacts sites) | 20 websites | $0.015 per website | $0.30000 |
Find emails & contacts (website-contacts runs) | 20 runs | $0.0015 per run | $0.03000 |
| Total | $1.11600 |
That 30-day pipeline costs $1.11600. Every tool has a flat per-item or per-run price, so you can cap the CI budget in advance. A stuck browser loop will not burn through thousands of reasoning tokens.
Set up your Claude Code MCP tools today#
Create a prepaid API key, run claude mcp add in your terminal, and follow the walkthrough in our guide to give Claude Code web search and a browser.
Try it yourself
One prepaid key, no subscription. Every price in this article is the price you pay.
Keep reading
All articles →
How to Automate Login with 2FA Using a Browser Agent
Automate login with 2FA safely by pairing an AI browser agent with vault secrets and local TOTP tools so credentials never enter the LLM prompt.

Track TikTok trends for a niche every morning
Pull TikTok search and hashtag data on a daily schedule, extract transcripts and comments, and see what a full week of tracking costs.

What Reddit Really Thinks About Standing Desks
Reddit threads and Amazon reviews, pulled with data tools and run through an AI market-research workflow, show what standing-desk owners hate.