web-search-mcp-no-api-key
Provides web search using DuckDuckGo search results, returning structured results with titles, URLs, and descriptions without requiring an API key.
Provides web search by scraping Google search results, returning structured results with titles, URLs, and descriptions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@web-search-mcp-no-api-keySearch the web for latest advancements in artificial intelligence"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Web Search MCP Server
A Model Context Protocol (MCP) server that enables free web searching with anti-detection, using Google primarily and falling back to Bing then DuckDuckGo (no API keys required).
Features
Search the web with stealth browser and orchestrated failover: Google (Playwright, stealth, UA rotation, consent cookies, rate limit, block cooldown) -> Bing (Playwright) -> DuckDuckGo (https+cheerio lightweight)
DuckDuckGo fallback is lightweight
node:https+cheerio(no browser) againsthtml.duckduckgo.comNo API keys or authentication required
Returns structured results with titles, URLs, and descriptions
Configurable number of results per search (1-10) and language (
lang, defaulten)
Related MCP server: DuckDuckGo MCP Server
Architecture - Fallback Order
Orchestrator (src/search-orchestrator.ts) tries engines sequentially and returns the first success (isSuccessResults filters synthetic error titles):
Order | Engine | Transport | Notes |
1 | Playwright ( | Stealth + UA rotation + consent cookies; rate limit + block cooldown (see details below) | |
2 | Bing | Playwright ( | Same stealth context + UA rotation; decodes |
3 | DuckDuckGo |
| Hits |
Google antibot details (src/antibot-config.ts / src/playwright-helpers.ts):
Stealth JS (
STEALTH_JS): hidesnavigator.webdriver,window.chrome,navigator.languages,navigator.plugins,navigator.permissions.query(notifications)UA rotation (
USER_AGENTS): 21 desktop UAs (Windows Chrome 120-131, macOS, Linux, Edge, Firefox) - random per contextConsent cookies (
GOOGLE_CONSENT_COOKIES):CONSENT+SOCSfor.google.comRate limit (
RATE_LIMIT_MS= 2000ms viaenforceRateLimit()with 1.5-3.5s jitter)Block cooldown (
GOOGLE_BLOCK_COOLDOWN_MS= 900s;/sorry/orGoogleBlockedmarks blocked and skips Google and the orchestrator falls back to Bing -> DuckDuckGo for 15m - it does NOT wait/sleep, just bypasses Google until cooldown expires)
query -> enforceRateLimit() -> Google (skip if isGoogleBlocked()) -> Bing -> DuckDuckGo -> Error: AllEnginesFailedSource: src/google-search.ts, src/bing-search.ts, src/duckduckgo-search.ts, src/playwright-helpers.ts, src/antibot-config.ts, src/search-orchestrator.ts.
Installation
Clone or download this repository (requires Node >=18 for
type: module+ Playwright 1.62)Install dependencies:
npm installInstall Playwright browser (needed for Google/Bing stealth):
npx playwright install chromium
# or (Linux only, installs system deps): npx playwright install --with-deps chromiumPrerequisite: Without this, Google/Bing engines fail to launch and the orchestrator falls through to DuckDuckGo only. The
playwrightpackage alone does not download the browser binary.
Build the server:
npm run build
build/is gitignored (see.gitignore). The MCP entrybuild/index.jsis not committed - you must runnpm run buildlocally after clone/pull or after anysrc/edit. The build script istsc && node -e "require('fs').chmodSync('build/index.js', '755')"(uses Node fs, not shellchmod- Windows compatible; noselenium-searchartifact anymore).
Add the server to your MCP configuration:
For VSCode (Claude Dev Extension):
{
"mcpServers": {
"web-search": {
"command": "node",
"args": ["/path/to/web-search/build/index.js"]
}
}
}For Claude Desktop:
{
"mcpServers": {
"web-search": {
"command": "node",
"args": ["/path/to/web-search/build/index.js"]
}
}
}Windows ESM Gotcha - type: module + .js Extension
This project is ESM-only:
package.jsonhas"type": "module"- Node treats.jsas ESM.tsconfig.jsonuses"module": "Node16"+"moduleResolution": "Node16".All local imports must include the
.jsextension even though source is.ts:
// correct
import { googleSearch } from './google-search.js';
import { duckDuckGoSearch } from './duckduckgo-search.js';
// wrong - will throw ERR_MODULE_NOT_FOUND on Windows/Linux
import { googleSearch } from './google-search';
import { googleSearch } from './google-search.ts';On Windows, type: module also makes path casing matter (forceConsistentCasingInFileNames: true). If you rename a file, update every import's casing. After changing tsconfig module settings, delete build/ and rebuild.
Usage
The server provides a single tool named search that accepts the following parameters:
{
"query": string, // The search query
"limit": number, // Optional: Number of results to return (default: 5, max: 10)
"lang": string // Optional: Language code (default: "en")
}Example usage:
use_mcp_tool({
server_name: "web-search",
tool_name: "search",
arguments: {
query: "your search query",
limit: 3 // optional
}
})Example response:
[
{
"title": "Example Search Result",
"url": "https://example.com",
"description": "Description of the search result..."
}
]Limitations
Since this tool scrapes Google/Bing/DuckDuckGo, there are some important limitations to be aware of:
Anti-bot & Rate limiting: Google may block (
/sorry/orGoogleBlocked); orchestrator enforcesRATE_LIMIT_MS(2000ms) +GOOGLE_BLOCK_COOLDOWN_MS(900s) and falls back to Bing then DDG. Rapid DDG calls may return HTTP 202 (treated as engine failure).Network stability: Bing
networkidlemay time out (30s) intermittently - orchestrator falls through to DDG.Legal Considerations:
This tool is intended for personal use
Respect Google/Bing/DuckDuckGo terms of service
Migration (Phase 6.1 - Dependency Hygiene)
src/selenium-search.js(CJS) removed. Use ESM import instead:import { duckDuckGoSearch } from './duckduckgo-search.js' // CLI: node build/duckduckgo-search.js "query" 3Previous
build/selenium-search.cjsartifact no longer produced;npm run buildis nowtsc && node -e "require('fs').chmodSync(...)".Dead deps removed:
selenium-webdriver,chromedriver,axios(+@types/axios). Production DDG now uses nativenode:https. If you relied ontest-search.jswith axios, runnpm i -D axiosor migrate to the ESM CLI above.@types/cheeriomoved todevDependencies(types-only).Dependency hygiene reduced install from ~115 to ~40 packages and cleared 4 audit vulns (remaining 1 high is
@modelcontextprotocol/sdk <1.24.0GHSA-w48q-cv73-mx4w -undiciitself patched to 6.28.0 vianpm audit fix; update SDK to>=1.24.0separately for breaking fix).
Development - Rebuild & Restart
After editing any file under src/:
npm run buildThen restart opencode (or reload the web-search MCP server) to reload build/index.js.
Global lesson (see
global lessons.md#11 - MCP server edits need an opencode restart): The MCP process (build/index.jsvia stdio) is loaded once by opencode and kept alive. Editing source or rebuilding does NOT take effect until the process is restarted. A stale process will still serve the old code (and may return stale errors). This applies tomcp-web-searchthe same asmessages-board-mcp/server.py- always restart opencode after changing this server.
Verify the build:
# smoke test (DDG, no browser needed):
node build/duckduckgo-search.js "test query" 2
# inspector (validates MCP stdio):
npm run inspector # opens @modelcontextprotocol/inspector
# verify artifact exists (Windows):
dir build
# or: npx tsc --noEmit (typecheck without emit)git status # build/ should stay untracked (gitignored); only src/, README.md, package.json are versionedContributing
Feel free to submit issues and enhancement requests!
This server cannot be deployed
Maintenance
Related MCP Connectors
Google, Bing, DuckDuckGo and Google Maps search results, free without an API key.
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
LLM-ready web search + instant answers + URL-to-clean-text fetch for agents and RAG.
Search Google straight from your AI agent. Web results, images, videos, news, products, scholarly ar
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables free web searching using Google search results with no API keys required, returning structured results with titles, URLs, and descriptions.116 npm5MIT
- FlicenseNot gradedqualityDmaintenanceEnables web searching through DuckDuckGo and fetching content from webpages. Provides search capabilities with configurable result limits and webpage content extraction for AI assistants.-
- FlicenseNot gradedqualityDmaintenanceEnables web search capabilities using DuckDuckGo's free API without requiring authentication or API keys.-
- AlicenseNot gradedqualityDmaintenanceEnables free web searching using Google search results without the need for API keys or authentication. It returns structured data including titles, URLs, and descriptions with configurable result limits.16 npm1MIT