MCP Web Search for AI Agents
Large language models are good at answering questions based on their training data, but they struggle when tasks require current information. Documentation, news, pricing, and company details change constantly.
MCP Web Search solves this by letting AI agents query the live web directly via the Model Context Protocol.
Using the 2Captcha Web Search MCP, any MCP-compatible agent can run a search, get ranked results, and discover URLs to fetch when it needs deeper context. Instead of a human manually searching and pasting links into the chat, the agent simply calls the search tool automatically.
What is MCP Web Search?
MCP Web Search connects AI agents to traditional web search engines through an MCP server.
When the agent sends a query to the search_web tool, it gets back ranked organic results that include the title, URL, and a text snippet. The tool also accepts optional parameters to specify the search engine, target country, or the desired number of results.
A typical workflow looks like this:
User request
↓
AI agent
↓
search_web
↓
Search results
↓
Relevant URLs
↓
scrape_page
↓
Page content
↓
AI analysis
This turns web search into a powerful discovery step for broader workflows like data extraction, continuous monitoring, and web scraping.
How MCP Web Search works
The core process is straightforward:
- The user asks the agent to find information.
- The agent calls
search_web. - The MCP server performs the web search.
- The agent receives ranked results and decides which ones are relevant.
- If deeper context is needed, the agent opens the selected URLs using scraping tools.
- The new information becomes part of the agent's active context.
Note that 2Captcha bundles this web search capability directly into its main MCP server under the parsing tool group, avoiding the need to run a separate server just for searching.
Search the web from an AI agent
In a standard LLM workflow, the human does the heavy lifting:
User finds information
↓
Copies URLs or text
↓
Sends it to the AI
↓
AI processes it
With MCP Web Search, the agent handles discovery on its own:
User asks a question
↓
Agent searches the web
↓
Agent selects sources
↓
Agent retrieves pages
↓
Agent analyzes the information
This autonomy is crucial whenever the agent encounters knowledge gaps. Common examples include:
- finding current technical documentation;
- researching a company or product;
- discovering relevant articles and publications;
- locating specific resources for research;
- compiling a list of target URLs before a scraping job;
- retrieving real-time information about an unfolding topic.
The search_web MCP tool
The primary tool for this capability is:
search_web
It accepts a query and returns a ranked list of results. Each result typically looks like this:
{
"title": "Example page",
"url": "https://example.com/page",
"snippet": "A short description of the page..."
}
According to the MCP tool reference, search_web provides organic search results and supports options like count, country, and engine. Because the search backend handles the heavy lifting, the tool doesn't require an LLM call to perform the search itself.
Search query
The query tells the agent exactly what to look for. For example:
best headless browser tools for AI agents
or:
Model Context Protocol browser automation
Result count
Agents can dictate how many results they need. A quick fact-check might only require the top three URLs, while a deep research workflow could request a much larger set.
Country
The country parameter filters results by location. This is especially useful for local searches, regional product research, discovering country-specific websites, and finding geographically relevant services.
Search engine
When supported by the backend, the engine parameter lets you choose which specific search engine to query.
From search results to page content
Search results usually provide enough context to identify relevant pages, but they rarely contain enough detail to complete complex tasks.
For example, a search result provides:
Title
URL
Snippet
But the agent might actually need:
Full article
Product specifications
Documentation
Pricing
Structured data
To bridge this gap, agents can combine search with the scrape_page tool:
search_web
↓
Select relevant URL
↓
scrape_page
↓
Readable page content
The Web Search MCP explicitly supports chaining search with scraping, allowing agents to seamlessly move from a list of links to the full text of the selected pages. For workflows dedicated entirely to extraction, see the MCP Scraper documentation.
MCP Web Search for AI research
Research is one of the most compelling use cases for MCP Web Search.
Consider this prompt:
Find the latest documentation about three MCP browser automation
projects and compare their approaches.
Without web access, the model has to rely on potentially outdated information in its training data. With MCP Web Search, the agent can actively gather what it needs:
Search for each project
↓
Find official documentation
↓
Retrieve relevant pages
↓
Extract important information
↓
Compare the results
This same discovery pattern applies to competitor analysis, market research, product comparisons, and academic source discovery.
Discover URLs before scraping
Web search is the ideal starting point for a scraping pipeline.
If a user asks:
Find five websites selling a specific product and compare their prices.
The agent doesn't magically know which URLs to visit. It starts with:
search_web
to discover the product pages. Once it has the URLs, it transitions to:
scrape_page
or other extraction tools to pull the pricing data. This splits the workflow into two clear stages:
Discovery
search_web
↓
URLs
Extraction
scrape_page / extract
↓
Data
(For more complex discovery within a single, known website, the MCP server also provides tools like discover_urls.)
MCP Web Search API
Web Search MCP is available through the hosted 2Captcha endpoint:
Authentication relies on a standard bearer token:
Authorization: Bearer YOUR_API_TOKEN
This token is usually your 2Captcha API key or another token issued by the server operator. The hosted server communicates via Streamable HTTP. Current setup instructions are maintained on the 2Captcha Web Search MCP page.
How to connect MCP Web Search
You can connect either to the hosted endpoint or run the server locally.
Hosted MCP server
If your MCP client supports remote HTTP servers and custom headers, you can connect directly:
MCP endpoint:
https://mcp.2captcha.com/mcp
Header:
Authorization: Bearer YOUR_API_TOKEN
This approach requires no local Node.js process.
Local MCP server
Alternatively, launch the official package locally:
npx @2captcha/mcp
For a search-focused setup, enable the parsing tool group in your client's MCP configuration:
{
"mcpServers": {
"2captcha": {
"command": "npx",
"args": ["@2captcha/mcp"],
"env": {
"API_TOKEN": "YOUR_API_TOKEN",
"GROUPS": "parsing"
}
}
}
}
The parsing group currently provides these tools:
scrape_page
search_web
discover_urls
discover_search_params
parse_marketplace
extract
get_account
MCP Web Search with Claude Code
Claude Code can connect directly to the hosted server using Streamable HTTP:
claude mcp add --transport http 2captcha https://mcp.2captcha.com/mcp \
--header "Authorization: Bearer YOUR_API_TOKEN"
To run the package locally instead:
claude mcp add 2captcha \
-e API_TOKEN=YOUR_API_TOKEN \
-e GROUPS=parsing \
-- npx @2captcha/mcp
MCP Web Search with Cursor
In Cursor, add the local MCP server directly to your configuration settings:
{
"mcpServers": {
"2captcha": {
"command": "npx",
"args": ["@2captcha/mcp"],
"env": {
"API_TOKEN": "YOUR_API_TOKEN",
"GROUPS": "parsing"
}
}
}
}
This gives your AI coding environment immediate access to web search without needing a separate extension.
MCP Web Search with Codex
The Codex can also launch the local package:
codex mcp add 2captcha \
--env API_TOKEN=YOUR_API_TOKEN \
--env GROUPS=parsing \
-- npx @2captcha/mcp
Once configured, the agent will call the web tools naturally as part of its normal workflow. The official repository maintains updated configuration examples for Claude, Cursor, VS Code, Windsurf, Gemini CLI, and other MCP-compatible clients.
MCP Web Search GitHub repository
The official implementation and technical docs are hosted on GitHub:
The repository provides everything needed for deployment, including installation instructions, hosted and local setups, tool references (like search_web and scraping tools), and client-specific examples.
The official npm package is @2captcha/mcp. Run it directly with:
npx @2captcha/mcp
MCP Web Search vs traditional search API
A traditional search API dictates a rigid flow:
Application
↓
Search API request
↓
JSON search results
↓
Custom application logic
MCP introduces an autonomous agent layer:
AI agent
↓
Decides whether search is needed
↓
Calls search_web
↓
Evaluates results
↓
Calls additional tools if necessary
↓
Continues the task
The key difference isn't the search results themselves, but who controls the workflow. With MCP, the model decides when search is necessary and determines how best to use the returned data.
MCP Web Search vs MCP Scraper
Search and scraping handle different halves of a web-data pipeline.
| MCP Web Search | MCP Scraper |
|---|---|
| Finds relevant pages | Retrieves page content |
| Starts with a query | Starts with a URL |
| Returns search results | Returns page data |
| Useful for discovery | Useful for extraction |
They are designed to work together:
search_web
↓
Find URL
↓
scrape_page
↓
Extract content
For workflows strictly focused on pulling data from known URLs, see the 2Captcha MCP Scraper documentation.
MCP Web Search vs Browser MCP
Web Search is for discovery; Browser MCP is for interaction.
Use MCP Web Search when the task is to:
Find something
Discover sources
Locate pages
Research a topic
Use Browser MCP when the task requires you to:
Open a web application
Click an element
Fill a form
Navigate a dynamic page
Maintain a browser session
For interactive browser workflows, see 2Captcha Browser MCP.
MCP Web Search vs Web MCP
While Web Search MCP handles discovery, Web MCP is a broader suite that combines multiple web capabilities:
Web MCP
├── Web Search
├── Web Scraping
├── Structured Extraction
├── Browser Automation
├── Proxy Access
└── Unlock
Use Web Search MCP when search is your primary goal. Use Web MCP when the agent needs to freely move between searching, scraping, extracting, and automating a browser within a single complex workflow. See 2Captcha Web MCP for the full toolset.
MCP Web Search use cases
Research agents: Search for current sources and retrieve the pages required to answer complex questions.
Coding agents: Locate documentation, GitHub repositories, technical discussions, and current implementation details.
Product research: Discover products, stores, and marketplaces before extracting structured pricing or specification data.
Source discovery: Find relevant articles or websites to feed into downstream scraping tools.
Competitive research: Discover competitor sites, public company information, and pricing pages.
RAG pipelines: Use web search as a real-time discovery layer before retrieving and embedding relevant content.
Web monitoring: Search for newly published pages on a topic before processing them.
FAQ
What is MCP Web Search?
It's a capability that gives AI agents access to live web search via the Model Context Protocol. Agents submit queries and receive ranked results containing titles, URLs, and snippets.
Which MCP tool is used for web search?
The tool is search_web, and it belongs to the parsing tool group.
Can MCP Web Search access current information?
Yes. It searches the live web, bypassing the limitations of the model's static training data.
Can I control the number of results?
Yes, the search_web tool supports a count option.
Can MCP Web Search return country-specific results?
Yes, you can filter by location using the country parameter.
Can I choose the search engine?
Yes, the tool supports an engine option to select the backend search engine.
Can Web Search MCP open search results?
Search simply returns the results. To open them, the agent must combine search with a tool like scrape_page to retrieve the content of the selected URLs.
Do I need a separate MCP server for web search?
No. Web search is bundled into the main 2Captcha MCP server under the parsing group.
What is the MCP Web Search API endpoint?
You can use the hosted 2Captcha MCP endpoint: Hosted MCP endpoint. Authentication requires the header: Authorization: Bearer YOUR_API_TOKEN.
Where is the MCP Web Search source code?
The implementation, documentation, and configuration examples are available in the official 2Captcha MCP GitHub repository.