Listed from the MCP registry; nobody on Odel publishes it.
MyWebSearch - multi-engine web search MCP server, CLI and local daemon. No API keys required.
Runs on your machine from its package; the steps are below.
At most: only reads or looks up information.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
npx -y my-websearch
MCP client config
{
"mcpServers": {
"mywebsearch": {
"command": "npx",
"args": [
"-y",
"my-websearch"
]
}
}
}Keyless Multi-Engine AI Web Search & High-Purity Content Extraction Engine
MCP Server · CLI · Local HTTP Daemon · Skill-Guided Agent Workflows
One server, four ways to use it: connect an AI client over MCP, run a one-shot CLI query, keep a local daemon alive, or use the built-in diagnostics before going live.
Jump to: Quick start · MCP tools · CLI · Configuration · Diagnostics · Development
my-websearch is a full-stack search and technical documentation engine built specifically for AI coding agents (Claude Desktop, Cursor, Cherry Studio, Windsurf, Cline, ZCode, etc.). Out of the box, ready for multiple mainstream AI clients:
auto), parallel multi-query execution (queries: string[]), URL deduplication, and automatic minResults cascading fallback. When DuckDuckGo is unhealthy, Yahoo automatically joins the English primary group from the fallback pool.wreq-js with native modern TLS/HTTP2 handshake emulation and persistent session cookies. Includes pure-JS/Rust solvers for Startpage's Anubis SHA-256 PoW challenge and DuckDuckGo's d.js (isJsaChallenge) HTML5/arithmetic challenge, so most challenges resolve without launching a browser. Request stacks are engine-specific: DuckDuckGo requires the wreq Chrome profile via GET (axios POST is challenged with HTTP 202), while Brave defaults to curl HTTP/1.1 (Windows Schannel; tested curl 7/10 before rate limiting, axios 0/10, wreq HTTP/2 429). When a Brave 429 turns out to be an anti-bot challenge page, the engine retries once through a disguised headless CDP browser that clicks the Argon2 PoW button itself (~4–6s; measured 8/8 while plain HTTP stayed 429). Note: DuckDuckGo's page-level HTTP 202 anomaly CAPTCHA ("select all squares containing a duck") is human verification and is intentionally not bypassed — it is reported as bot_challenge; Brave's challenge is computational (Argon2 PoW) and is solved by the page's own JavaScript, not by us. Real URL resolution for Sogou redirect links, Baidu Location, and Bing Base64 links.mp.weixin.qq.com), StackOverflow questions & accepted answers, and transparent internal routing for CSDN & Juejin. Removes <nav>, <aside>, <footer>, and breadcrumbs while faithfully preserving article titles, code blocks, and GFM tables. Supports seamless pagination (startIndex), plus three token-saving modes: BM25 relevance-ranked focus, CSS-selector extract to JSON with no LLM, and numbered citations.queryDocs)"next.js", "vue") or Context7 IDs without needing a separate resolve step. Includes automatic candidate ranking, blind-guess 404 self-healing, and related alternatives discovery.fetchGithubContent (formerly fetchGithubReadme) supports both GitHub and Gitee: repository READMEs, any source file (/blob/..., with lines/#L120-L180 slicing), directory trees (/tree/...), complete issue / PR discussions, commits (/commit/<sha>), compare views (/compare/a...b), and releases (/releases, /releases/tag/<tag>).
Tokenless Code Symbol Search: Pass symbol: "Use" to perform fast, tokenless whole-repository syntactic code symbol search across Go, TypeScript/JavaScript, Python, Rust, Java, C#, Ruby, PHP, and Swift. Instantly locates function, class, struct, type, and macro declarations with line numbers and contextual implementation code blocks.198.18.0.0/15 for TUN / Fake-IP compatibility while enforcing strict SSRF security bounds.
No proxy is the supported default: outside mainland China, leave PROXY_URL unset and every engine is queried directly — you don't need Clash/v2ray to use this server./metrics monitoring.| Engine | Mainland China Connectivity | API Key | Core Technology | Best For |
|---|---|---|---|---|
bing | 🇨🇳 Direct | None | Chrome TLS impersonation + Base64 real URL resolution + stealth fallback | General technical search, mixed EN/ZH queries |
bing-news | 🌐 Proxy in CN | None | Bing News RSS + pubDate 24h filter + apiclick.aspx?url= decoding; direct can 302 to an HTML page, so it is proxy-eligible by default; opt-in vertical engine | Breaking news, last-24h updates |
baidu | 🇨🇳 Direct | None | Concurrent Location redirect resolution + challenge detection | Chinese news, documentation, domestic forums |
csdn | 🇨🇳 Direct | None | WAF cookie jar persistence + empty response auto-retry | Chinese error logs, debugging tutorials |
juejin | 🇨🇳 Direct | None | Direct official API querying for clean long-form articles | Modern frontend/backend technical blogs |
sogou | 🇨🇳 Direct | None | Desktop & mobile dual parsing + redirect link decoding + ad removal | WeChat ecosystem links & long-tail queries |
duckduckgo | 🌐 Proxy in CN | None | wreq Chrome-profile GET of the HTML endpoint (202 anomaly CAPTCHA only on the axios fallback); d.js solver retained for the preload fallback | English technical search & open-source discussions |
startpage | 🌐 Proxy in CN | None | Multi-worker Anubis SHA-256 PoW solver (difficulty ≤ 6) + cookie session (no browser needed) | Google-backed high-privacy results |
yahoo | 🌐 Proxy in CN | None | SSR HTML + homepage cookie warm-up + RU= redirect decoding; English fallback pool (auto-substitutes when DuckDuckGo is unhealthy) | Stable Bing-index English fallback |
brave | 🌐 Proxy in CN | None | curl HTTP/1.1 (Windows Schannel; tested 7/10 before 429; axios 0/10; wreq HTTP/2 429) + strict sponsored ad stripping; compatible with Windows' older curl builds (no --compressed requirement); on 429 it auto-triggers the PoW challenge through a disguised desktop headless CDP browser (~4–6s, measured 8/8 while HTTP stayed 429); if that still fails: wait / rotate IP / use BRAVE_API_KEY | Independent English index & technical blogs |
exa | 🌐 Proxy preferred | Optional Free Key | Official semantic search API (skipped if key is unset); direct works too, but proxy measured ~0.77s vs ~1.17s direct | Semantic similarity, AI research & papers |
github | 🌐 Direct API | None | Official GitHub Search REST API + exact owner/repo fast path (issues & repositories) | GitHub issues, bug reports, repositories, and exact repo lookup |
stackoverflow | 🌐 Direct API | None | Official StackExchange 2.3 API with HTML entity decoding | Developer troubleshooting, stack traces & answers |
hackernews | 🌐 Direct API | None | Algolia HN Search API with points, comments & author metadata | Tech discussions, startup launches & engineering news |
arxiv | 🌐 Direct API | None | Official arXiv Atom XML API parsing titles, authors & abstracts | Scientific papers, machine learning & AI research |
code | 🌐 Proxy in CN | None | grep.app API search across global GitHub code with repo, path & exact line numbers | Source code implementations, API usage patterns |
Version note: this README tracks the current source tree (1.6.0). 1.6.0 is a code intelligence and multi-source documentation release:
fetchGithubContentadds tokenless whole-repo syntactic symbol search (symbol, powered by in-memory streaming tarball unpack & two-stage sampling across Go/TS/Python/Rust and more);queryDocsoverhauled with multi-source authority (DevDocs, Javadoc, docs.rs, pkg.go.dev, MDN, Context7, and package registries with syntax-level Markdown section extraction and preamble protection); removal ofcodeSymboland heavy external dependencies, converging the MCP tool surface to 4 lean core tools (total description characters ≤1000). 1.5.1 is a search-quality release: diversity-aware early return, host cap, Chinese-tech routing to Bing/Baidu/Sogou, official-intent anchors, Baidu real-URL extraction, and aneval:qualitybenchmark. 1.5.0 unified test suites (Vitest), centralized env access, Brave 180s browser-only window, and Node.js ≥22 requirement.
💡 Token Budget & Slimming: All tool descriptions are strictly kept within 250 characters (total description characters ≤ 1000), while detailed routing guidance is delegated to
McpServer({ instructions }), significantly reducing LLM context consumption.
| Tool Name | Purpose | Key Highlights |
|---|---|---|
search | Federated web & code search (16 engines) | Supports parallel queries, timeRange: day|week|month|year date filter, site: string[] filter, and query operators (site:, filetype:, after:, before:, -exclude) translated per engine with local post-filtering; fetchTop preview injection, code engine (grep.app); explicit engines defaults to minResults=0 (no unconstrained cascade); returns inline diagnostics on failure |
fetchWebContent | Web page extraction, Markdown & transparent PDF parsing | All-in-one content extractor: Built-in disk-level Markdown cache (Node 22 node:sqlite / partitioned JSON fallback, 200MB LRU, cache: default|reload); transparent PDF parsing (up to 20MB / 50 pages, [page N] tags, scanned doc detection); pagination & focus keyword targeting (bm25 relevance-ranked blocks by default, window for the legacy fixed window); selector to scope extraction to a CSS subtree (errors instead of silently returning the whole page); extract for CSS-selector JSON with no LLM; citations for numbered references; retainLinks to strip URLs (-50% on index pages) |
fetchGithubContent | Comprehensive GitHub / Gitee content reader & code symbol search | Fetches README, source files (/blob/<ref>/<path>, optional lines/#L120-L180 slicing), directory trees (/tree/), Issue / PR discussions, commits, compare, releases; tokenless whole-repo symbol search (symbol="Use", in-memory stream unpack, locates functions/classes/types/macros with lines and code blocks); ref may be a branch, tag, or commit; Gitee parity; returns warnings |
queryDocs | All-in-one official docs, middleware & Web standards API | Multi-Source Authority: Resolves package names, middleware, or Context7 IDs; optional source selection (auto smart cascade, official standalone sites, docs.rs Rust, pkg.go.dev Go, devdocs 800+ tools/langs, mdn Web standards, javadoc Maven packages, context7, npm, pypi, github); optional version multi-source pinning; Syntax-Level Markdown Section Extraction (for docs >8000 chars with query, keeps preamble import & bootstrap code 100% intact, extracts full matching sections with TOC; zero truncation for short docs); 24h local cache (cache: reload bypasses); precise failover notices (402 Quota vs outages vs low-confidence); returns source, confidence, documentationUrl & warnings |
💡 Backward Compatibility: Legacy
fetchCsdnArticleandfetchJuejinArticleare automatically routed underfetchWebContent; legacyresolveLibraryIdis merged intoqueryDocs(which accepts alibraryname or the legacylibraryIdalias). The separate legacy tools were removed — theREGISTER_LEGACY_ARTICLE_TOOLSswitch is gone, because keeping three unregistered handlers around still cost tool-description budget for nothing.
🧩 MCP Prompts:
deep-research(multi-source research with citations) andcode-lookup(official docs + source + release notes) are registered as server-side prompt templates; clients that support MCP Prompts can invoke them directly.
🗂️ MCP Resources: read-only
websearch://cache/pages/websearch://cache/docsindexes plus per-entry Markdown resources expose already-cached content without another tool call. Resources never trigger network fetches.
queryDocs is purpose-built for AI Agents, connecting directly to authoritative primary documentation for open-source libraries, infrastructure middleware, and Web standards:
Multi-Source Architecture (source parameter):
auto (Default smart routing & cascade): Tries Context7 first; on quota exhaustion or missing index, automatically cascades to Standalone Official Doc Sites $\to$ DevDocs $\to$ Registry Readmes (npm / PyPI / crates.io / Go Proxy / Maven) & GitHub. Supports prefix shortcuts like crates:, go:, mdn:, devdocs:, and javadoc:.official: Connects directly to dedicated official documentation sites (e.g. FastAPI, Vue, Vite, Next.js).devdocs: Covers 800+ offline/standard API documentation sets (e.g. Redis, Docker, Nginx, PostgreSQL, Python, C++, Bash), with native versioned slugs (e.g. python~3.12, angular~21).mdn: Connects to official MDN Web Docs APIs (JavaScript standards, Web APIs, CSS, HTML), with automatic English/Chinese detection and localized locale=zh-CN extraction.docs.rs: Connects directly to the official Rust crates documentation ecosystem with precise version pinning.pkg.go.dev: Connects directly to official Go modules and standard library documentation.javadoc: Resolves Maven coordinates (groupId:artifactId) directly on Javadoc.io.context7: Context7 structured LLM codebase documentation index.npm / pypi / github: Ecosystem registry metadata sniffing and README fallbacks.Syntax-Level Markdown Section Extraction (Preamble & Imports Protection):
import / require) and initialization setup, causing LLMs to generate hallucinated or broken code.query is provided, the extractor 100% guarantees complete preservation of the preamble: package declarations, installation instructions, every import statement, and bootstrap setup.Multi-Source Version Pinning & Transparent Failover:
version parameter across sources (e.g. 18.2.0, 3.11, 1.38.0, v1.9.1).warnings for configuring CONTEXT7_API_KEY or switching sources.// Example 1: Query Redis commands via DevDocs
{ "library": "redis", "query": "hset", "source": "devdocs" }
// Example 2: Query Web standard APIs via MDN (localized extraction)
{ "library": "fetch", "source": "mdn" }
// Example 3: Query a specific Rust crate version via docs.rs
{ "library": "tokio", "version": "1.38.0", "source": "docs.rs" }
// Example 4: Long document with section extraction preserving imports
{ "library": "fastapi", "query": "middleware" }
No installation required:
npx -y my-websearch@latest
💡 Automated Proxy Discovery: The server automatically detects your operating system's proxy settings. If a local proxy environment is active, overseas engines automatically use the proxy while domestic engines stay on fast direct lines.
198.18.0.0/15is whitelisted out of the box for Fake-IP environments.
init detects installed MCP clients, writes the server entry into their config files, and keeps a .bak backup:
npx -y my-websearch@latest init # auto-detect and write
npx -y my-websearch@latest init --dry-run # preview the diff, write nothing
npx -y my-websearch@latest init --client cursor,code # target specific clients
Supported out of the box: Claude Desktop, Cursor, and VS Code (workspace .vscode/mcp.json). An existing entry is never overwritten unless you pass --force, corrupt config files are left untouched, and on Windows it writes cmd /c npx for you. Restart the client, then verify with my-websearch doctor.
Claude Desktop / Cursor / Windsurf / Cline (STDIO Mode)
Add to your MCP settings file:
{
"mcpServers": {
"my-websearch": {
"command": "npx",
"args": ["-y", "my-websearch@latest"],
"env": {
"MODE": "stdio"
}
}
}
}
(For Windows: init handles this automatically. When configuring manually, if npx is not in the system path, set command to cmd and args to ["/c", "npx", "-y", "my-websearch@latest"])
Start the server in your terminal with npx my-websearch@latest (default port 3211), then configure:
{
"mcpServers": {
"web-search": {
"name": "MyWebSearch",
"type": "streamableHttp",
"baseUrl": "http://localhost:3211/mcp"
}
}
}
my-websearch can be used directly from your terminal as a standalone CLI tool or persistent daemon. Use --json in automation and keep the daemon on 127.0.0.1 unless you explicitly need remote access:
# Global install
npm install -g my-websearch
# Detect installed MCP clients and write their config (--dry-run to preview)
my-websearch init
# Start persistent local HTTP daemon (port 3210 by default)
my-websearch serve
# One-shot terminal search (reuses running daemon automatically)
my-websearch search "Model Context Protocol best practices" --limit 5 --min-results 5 --json
# Only results published within the last week (day|week|month|year)
my-websearch search "typescript 5.9 release" --time-range week --json
# Extract web page as clean Markdown
my-websearch fetch-web "https://blog.vuejs.org/posts/vue-3-5" --max-chars 15000 --json
# View daemon status and Prometheus metrics (/health, /status, /metrics)
my-websearch status --json
# Clear in-memory search cache
my-websearch cache-clear
Use the built-in doctor command before troubleshooting a proxy, browser, or engine:
# Local configuration and browser checks (path only; use --browser to verify launch)
my-websearch doctor
# Verify the Chromium-based browser can actually launch (auto-detected, CHROME_PATH, or PLAYWRIGHT_CDP_ENDPOINT)
my-websearch doctor --browser
# Real proxy/engine probes (may contact upstream services)
my-websearch doctor --network
# Limit network probes to selected engines
my-websearch doctor --network --engine bing,duckduckgo --json
# Reset and clear cached engine circuit breaker / health state
my-websearch doctor --reset-health
The report separates configuration, proxy TCP reachability, HTTP reachability, application parsing, browser launch, and challenge verification status. For Brave, a 429 is additionally classified as captcha (human verification — retrying usually stays challenged) or quota (rate-limit window) in both the text report (challenge=...) and --json (challengeKind). Network mode also summarizes cache hit rates (search cache and fetch page cache), remaining circuit cooldowns per engine, and P50/P95 engine latency when persisted samples exist. Network mode performs real requests and should not be used as a high-frequency health check.
When configuring or diagnosing proxy connectivity, refer to these common edge cases:
Startup log shows 🌐 Proxy: disabled even though proxy.url is set?
useProxy flag: In ~/.my-websearch/config.json, setting "useProxy": false takes precedence and explicitly overrides and disables url (setting PROXY_URL='false'). Change "useProxy": true or simply omit the field (providing a valid url automatically enables the proxy).scutil / HTTPS_PROXY) is used for overseas engines and generic fetches — you do not need PROXY_URL just because a proxy client is running. If detection fails or you want to pin a specific proxy, set PROXY_URL (e.g. http://127.0.0.1:7897).~/.my-websearch/config.json over client env: put proxy.url and API keys in the config file. Some MCP clients (e.g. WorkBuddy) fingerprint the server by command + args + env key names + cwd, so adding a PROXY_URL env entry changes the trust fingerprint and the server may silently drop out of the session. Config-file settings are read at startup and avoid that.| Location | Use it when |
|---|---|
~/.my-websearch/config.json → "proxy": { "url": "http://127.0.0.1:7897" } | Recommended. Applies to every client (CLI, daemon, MCP) and does not change client trust fingerprints. |
MCP client env → PROXY_URL | Per-client override. Restart the client; some clients include env keys in their trust fingerprint. |
| Proxy client's "system proxy" switch | No config at all. Since 1.3.8 it is auto-detected for overseas engines and generic fetches. |
Proxy works, but an overseas engine still fails or times out? (Per-engine diagnosis, not a config error)
d.js arithmetic solver does not bypass it. The engine first requests the HTML endpoint with a wreq Chrome-profile GET, which normally returns 200 even when the axios POST path is challenged with 202 — so a 202 now only appears if that path fails and the axios fallback is used. If you still see 202, confirm your build includes the wreq GET path (1.3.8 and earlier do not), then retry or check that the proxy is attached. DDG remains best-effort: the same exit can still be challenged intermittently, so do not treat it as an SLA; for stability use Bing/Startpage or configure BRAVE_API_KEY/EXA_API_KEY. Note: SEARCH_MODE=playwright:duckduckgo is not supported (DDG has no browser-rendering path), so it falls back to HTTP.challengeSet), so it is reported as bot_challenge rather than rate_limited. Recovery follows the window, not a fixed timer: requests pass again once the oldest request of the burst ages out of 60 s (measured 62.9 s after a 6-request burst; ~15 s when the same 6 requests were spread over 52 s). Retrying inside the window adds requests and extends it — probing every 15 s / 30 s kept the IP blocked for 255 s / 6.5 min respectively. The engine therefore trips the Brave circuit for 60 s (then 120 → 240 → 300 s) and retries once through a disguised desktop headless CDP browser that clicks the PoW 验证 button automatically (8/8 success, ~4–6 s per query on a hard-blocked IP). That fallback only serves that search and does not clear the HTTP window: after a successful browser pass, the next HTTP attempt succeeded once and then hit 429 again. Client-stack swaps do not help either (axios 0/10; wreq HTTP/2 429; curl Schannel HTTP/1.1 7/10 before the window trips). The official API (BRAVE_API_KEY) remains the stable path. BRAVE_BROWSER_FALLBACK=0 disables both the retry and the window. After a 429 the engine enters a 180 s browser-only window (long-running MCP/daemon processes only; one-shot CLI invocations start fresh): HTTP is skipped entirely and every Brave call goes straight to the disguised browser (no wasted curl request that would only extend the server-side window); browser-only engines stay eligible but are ranked last by auto routing and cascade, so they do not slow down normal searches; if the browser fails too, the circuit opens (60 → 120 → 240 → 300 s) and routing/cascade substitute other engines.auto mode Yahoo also replaces an unhealthy DDG from the fallback pool); Brave 429 → the disguised-browser fallback usually rescues it (see above); otherwise wait out the window, rotate the exit IP, or set BRAVE_API_KEY; Bing 0 results → retry or adjust the query; Startpage PoW → retry. Switch exit IP only after the engine-specific step fails. As a last resort use engines: ["bing", "baidu"], or configure an official key (BRAVE_API_KEY / EXA_API_KEY) for an SLA path.The defaults are safe as a package, and every one of them matters:
| Default | What it protects |
|---|---|
Bind to 127.0.0.1 | Nothing outside the machine can reach the port |
| No authentication | Acceptable only because of loopback binding |
| Host header validation | Blocks DNS-rebinding attacks from a browser on the same machine |
| CORS disabled | No cross-origin browser access |
Relaxing one without the others silently removes the protection:
HOST=0.0.0.0 (Docker) → the Host allowlist follows the bind address automatically; if you also use a public domain, add it via OPEN_WEBSEARCH_ALLOWED_HOSTS (comma-separated).FETCH_WEB_INSECURE_TLS=true disables certificate verification for user-supplied URLs; only enable it for a trusted network.~/.gemini/config/mcp_config.json / ~/.workbuddy/mcp.json into ~/.my-websearch/config.json (mode 0600) on first run. Run my-websearch doctor to see where each key came from; set MYWEBSEARCH_NO_AUTO_BOOTSTRAP=1 to disable the copy.~/.my-websearch/config.json)To share settings across all MCP clients without duplicate configuration:
{
"apiKeys": {
"context7": "ctx7sk-...",
"exa": "...",
"github": "ghp_...",
"gitee": "...",
"brave": "..."
},
"proxy": {
"url": "http://127.0.0.1:7897",
"useProxy": true,
"engines": ["duckduckgo", "exa", "brave", "startpage"]
}
}
⚠️ Note on
useProxy: When"url"is configured, proxy is enabled automatically. Setting"useProxy": falsewill explicitly override and disableurl. If you want proxy enabled, set"useProxy": trueor omit the field entirely. Keys & restart: entries underapiKeysare mapped to env vars at startup (github→GITHUB_TOKEN,gitee→GITEE_TOKEN,context7→CONTEXT7_API_KEY, …) and only fill variables that are not already set in the client env. Restart the MCP server after editing the file;my-websearch doctorshows which keys are currently visible.
Can be set via the global configuration file (~/.my-websearch/config.json), local .env, or system environment variables:
Precedence (highest first): process environment → project .env → project .my-websearch.json → ~/.my-websearch/config.json → built-in defaults.
| Variable | Default | Allowed Values / Description |
|---|---|---|
MODE | both | both / http / stdio. http enables Streamable HTTP + SSE. |
HOST | 127.0.0.1 | MCP HTTP bind address. Binding to a non-loopback address also registers that host in the Host allowlist and prints a no-auth warning. |
PORT | 3211 | MCP HTTP port |
OPEN_WEBSEARCH_ALLOWED_HOSTS | empty | Extra Host-header allowlist entries (comma-separated), needed when serving through a public domain/reverse proxy |
OPEN_WEBSEARCH_DAEMON_HOST / OPEN_WEBSEARCH_DAEMON_PORT | 127.0.0.1 / 3210 | Local REST daemon bind address (no auth: keep it on loopback) |
METRICS_ENABLED | false | Enables in-process counters and the daemon /metrics endpoint |
FETCH_WEB_DEADLINE_MS | 45000 | Hard deadline for one fetchWebContent call (cookie + browser + retries combined) |
GITHUB_CONTENT_CDN_FIRST | false | Prefer jsDelivr over raw.githubusercontent.com for README and source files (public repos only). |
GITHUB_CONTENT_BUDGET_MS | 12000 (6000 in CDN-first) | Total time budget for one fetchGithubContent call; per-attempt timeout is capped at 4.5s. |
BING_BROWSER_BUDGET_MS / BING_PLAYWRIGHT_BUDGET_MS | 6000 | Budget for the Bing browser fallback (now backed by raw CDP) before HTTP results are kept; legacy name BING_PLAYWRIGHT_BUDGET_MS supported |
MYWEBSEARCH_NO_AUTO_BOOTSTRAP | unset | Set to 1 to stop copying API keys out of other apps' MCP configs on first run |
| Variable | Default | Allowed Values / Description |
|---|---|---|
DEFAULT_SEARCH_ENGINE | auto | Default engine: auto (smart query routing: Chinese baidu,sogou, English/foreign bing,duckduckgo). Supports all 16 engines: auto, bing, bing-news, baidu, sogou, duckduckgo, brave, csdn, juejin, startpage, yahoo, exa, github, stackoverflow, hackernews, arxiv, code (vertical developer engines can be configured as default, though auto or general web engines are recommended for global default) |
ALLOWED_SEARCH_ENGINES | all | Comma-separated whitelist of allowed search engines (e.g. bing,baidu,duckduckgo) |
BING_BASE_URL | https://cn.bing.com/search | Base URL for Bing queries. Overseas users or reverse proxy nodes can set to https://www.bing.com/search |
DEFAULT_MIN_RESULTS | 5 | Cascade threshold: triggers fallback engines when usable results are fewer than this value |
DEFAULT_SEARCH_LIMIT | 10 | Default result limit when not explicitly specified in tool calls (max 50) |
SEARCH_DEADLINE_MS | 30000 | Global hard deadline for multi-engine search execution (milliseconds) |
SEARCH_FUSION | legacy | Result fusion mode: legacy (engine-hit count + arrival order) or rrf (Reciprocal Rank Fusion over per-engine ranks, which also replaces the position/consensus terms in re-ranking). RRF stays opt-in until a larger evaluation exists. |
SEARCH_FUSION_RRF_K | 20 | RRF constant k; lower values amplify rank differences. Only used when SEARCH_FUSION=rrf. |
ENGINE_CIRCUIT_BASE_COOLDOWN_MS | 30000 | First circuit-breaker cooldown for an engine (429 / 202 / bot_challenge). Repeated failures back off exponentially (30s → 60s → 120s…). Brave overrides the first step to 60s because its 429 is a rolling 60-second window of 6 requests (the 7th is challenged) and recovery only starts once the oldest request ages out; setting this variable explicitly disables the per-engine override. |
SEARCH_AUTHORITY_DOMAINS | empty | Additional authority domain whitelist for result re-ranking (comma-separated, appended to built-in list) |
SEARCH_MODE | auto | Search mode and browser policy. Supports single mode, multi-engine per mode, and compound multi-mode combinations: • Global mode: auto (default fallback), request/none (pure HTTP), browser/playwright (force CDP browser)• Single mode, multiple engines: browser:bing,startpage, auto:bing,startpage, bing,startpage• Compound multiple modes: browser:bing;auto:startpage (bing forces browser, startpage uses auto fallback), auto;request:startpage (global auto but startpage uses pure HTTP) |
BRAVE_BROWSER_FALLBACK | 1 | When the keyless Brave web path returns HTTP 429 / an anti-bot challenge, retry once through a disguised desktop headless CDP browser that auto-triggers the Argon2 PoW 验证 button (1 enabled, 0 disables and fails fast). A 429 then opens a 180 s browser-only window: HTTP is skipped and every Brave call in the window goes straight to the browser; if that also fails the engine trips its circuit (60 → 120 → 240 → 300 s) and routing/cascade substitute other engines. Measured 8/8 success at ~4–6s per query while plain HTTP stayed 429. Still best-effort: it cannot pass the interactive slider CAPTCHA |
AUTO_ROUTE_EN_ENGINES | bing,duckduckgo | Comma-separated engines for default English auto-routing |
AUTO_ROUTE_ZH_ENGINES | baidu,sogou | Comma-separated engines for default Chinese auto-routing |
| Variable | Default | Allowed Values / Description |
|---|---|---|
PROXY_URL | empty (off) | Consolidated upstream proxy configuration (merges previous USE_PROXY and PROXY_ENGINES). Not needed in TUN mode.• Default proxy: passing empty PROXY_URL="" or PROXY_URL=true activates default http://127.0.0.1:7897 (common local proxy ports include 7897, 7890, 10809; overseas engines use proxy, domestic engines stay direct)• Custom address: PROXY_URL=http://127.0.0.1:10809• Custom engines: PROXY_URL="http://127.0.0.1:7897;duckduckgo,brave" or all engines PROXY_URL=";all" |
FAKE_IP_CIDRS | 198.18.0.0/15 | Whitelisted CIDRs for Fake-IP / TUN mode to avoid SSRF false-positive blocking |
CUSTOM_DNS_SERVERS | 223.5.5.5,119.29.29.29,1.1.1.1,8.8.8.8 | Comma-separated DNS servers used by the internal c-ares resolver (helps when the system DNS is polluted). Overrides the built-in list entirely |
IMPERSONATE_BROWSER | chrome_149 | wreq-js browser TLS/H2 fingerprint profile (e.g. chrome_149, safari_18) |
IMPERSONATE_OS | windows | Operating system platform for fingerprint impersonation (windows, macos, linux) |
BING_IMPERSONATE | true | Toggle Chrome TLS impersonation for Bing HTTP mode (auto-trips circuit breaker after consecutive empty results) |
FETCH_WEB_INSECURE_TLS | false | Disable TLS certificate verification for fetchWebContent only (for broken legacy site certs) |
Custom proxy engine lists: if you set
proxy.enginesin~/.my-websearch/config.jsonor use the;engine1,engine2suffix ofPROXY_URL,yahooandbing-newsare added automatically because they cannot be reached directly from CN (Yahoo times out in 15–20s; Bing News returns a 302/HTML page). Removing the list entirely is still recommended: defaults include them and keep the direct API engines (GitHub / Stack Overflow / Hacker News / arXiv) off the proxy.
| Variable | Default | Allowed Values / Description |
|---|---|---|
CONTEXT7_API_KEY | empty | Context7 API Key (strongly recommended for proxy/TUN users to avoid shared IP quotas) |
EXA_API_KEY | empty | Exa Free API Key (only required if using the exa semantic search engine) |
BRAVE_API_KEY | empty | Brave Search API Key (optional; uses official high-reliability API when set) |
GITHUB_TOKEN | empty | GitHub Personal Access Token (optional; raises rate limit to 5,000 req/hr) |
GITEE_TOKEN | empty | Gitee Personal Access Token (optional; raises Gitee API rate limits and enables private repos). Also configurable as piKeys.gitee in ~/.my-websearch/config.json. |
STACKOVERFLOW_API_KEY | empty | Stack Apps Key (optional; raises quota to 10,000 req/day) |
| Variable | Default | Allowed Values / Description |
|---|---|---|
MODE | both | MCP transport mode: stdio (stdin/stdout only), http (HTTP/SSE only), both (concurrent) |
PORT | 3211 | MCP HTTP/SSE listen port (local persistent daemon uses 3210 by default) |
MAX_CONCURRENT_SEARCHES | 20 | Max concurrent searches in daemon mode (0 for unlimited) |
MCP_MAX_SESSIONS | 100 | Max retained MCP HTTP sessions before returning HTTP 429 Too Many Requests |
MCP_SESSION_TTL_MS | 1800000 | Idle session expiration duration before reaping (default 30 min) |
LOG_LEVEL | info | Log level: quiet (completely silent), debug, info, warn, error |
SECURITY_AUDIT | false | Enable SSRF blocking and host header security audit logging |
OPEN_WEBSEARCH_ALLOWED_HOSTS | loopback | Host header whitelist for HTTP server (DNS Rebinding protection, comma-separated) |
Note
The browser fallback uses raw Chrome DevTools Protocol via chrome-remote-interface, so it requires a Chromium-based browser: Chrome, Edge, Chromium, Brave, Vivaldi or Opera (Firefox/WebKit are not supported). Standard install paths for all of these are auto-detected; override with CHROME_PATH / BROWSER_PATH / PLAYWRIGHT_EXECUTABLE_PATH, or connect a remote browser via PLAYWRIGHT_CDP_ENDPOINT (no local install needed). my-websearch doctor --browser reports which browser was found and how to fix a missing one. The PLAYWRIGHT_* env names and SEARCH_MODE=playwright value are kept for backward compatibility only. Browser fallback behavior is governed by SEARCH_MODE.
Two independent knobs — don't mix them up:
BROWSER_DRIVER picks the driver library: cdp (default, built in via chrome-remote-interface) or playwright (legacy escape hatch that requires you to install playwright-core).PLAYWRIGHT_CDP_ENDPOINT / CHROME_PATH / BROWSER_PATH / PLAYWRIGHT_EXECUTABLE_PATH decide where the browser comes from: an already-running local/remote CDP endpoint, an explicit executable, or auto-detection.Every browser path — Bing fallback, Startpage, DuckDuckGo, Brave, fetchWebContent, CSDN article fetch, and doctor --browser — goes through the same entry point, so these settings apply to all of them.
| Variable | Default | Allowed Values / Description |
|---|---|---|
BROWSER_DRIVER | cdp | Browser backend. cdp (default, raw CDP). playwright is a legacy escape hatch and requires you to install playwright-core manually; it is no longer bundled. |
BROWSER_PROFILE | off | CDP device profile: off, windows-chrome-8, windows-chrome-16, macos-chrome-8, or random. Applies UA, screen/DPR, timezone and locale to browser sessions. It does not affect HTTP-only engines such as DuckDuckGo/Brave. |
DDG_BROWSER_FALLBACK | 1 | When DuckDuckGo's HTTP paths return 202/CAPTCHA, retry the HTML endpoint through the CDP browser. Uses BROWSER_PROFILE when set, otherwise the coherent windows-chrome-8 default; set 0 to disable. |
BROWSER_CDP_ENDPOINT / PLAYWRIGHT_CDP_ENDPOINT | empty | Remote Chrome/Edge CDP endpoint URL (e.g. http://127.0.0.1:9222 or ws://...); legacy name, used by the CDP driver |
BROWSER_PATH / PLAYWRIGHT_EXECUTABLE_PATH | auto | Absolute path to a Chromium-based browser executable. Auto-detection covers Chrome / Edge / Chromium / Brave / Vivaldi / Opera in standard locations; CHROME_PATH and BROWSER_PATH are checked first and work as equivalents; legacy name |
BROWSER_HEADLESS / PLAYWRIGHT_HEADLESS | true | Run headless (on Windows, an isolated hidden desktop window is used); legacy name |
BROWSER_TIMEOUT_MS / PLAYWRIGHT_NAVIGATION_TIMEOUT_MS | 20000 | Hard page navigation timeout (milliseconds); legacy name, applied to CDP navigation |
| Variable | Default | Allowed Values / Description |
|---|---|---|
MYWEBSEARCH_DATA_DIR | ~/.my-websearch | Root directory for configuration and persistent cookie files |
OPEN_WEBSEARCH_RESPONSE_CAP_BYTES | 60000 | Maximum character limit returned to LLMs to prevent prompt context explosion |
💡 Zero-Config Upgrades (Redundant Variables Removed):
- CORS Switches (
ENABLE_CORS/CORS_ORIGIN): CORS is disabled by default; enable it explicitly and restrict origins when browser clients need cross-origin access.- Browser Backend: raw CDP via
chrome-remote-interface;playwright-coreis no longer bundled.PLAYWRIGHT_*names andSEARCH_MODE=playwrightremain as compatibility aliases.- Emoji Switch (
OPEN_WEBSEARCH_NO_EMOJI): Automatic console code page detection smoothly falls back to ASCII tags on legacy terminals.- Fragmented Debug Flag (
OPEN_WEBSEARCH_DEBUG): Unified into standardLOG_LEVEL=debug.- Cookie Persistence TTL (
MYWEBSEARCH_COOKIE_TTL_DAYS): Solidified to 30 days with automated sliding renewal.
Pull requests and issues are welcome! To run the test suite locally:
npm install
npm run build
npm test # Run the Vitest suite (`npm test` prints the current file/test counts)
npm run check:docs # Verify README env tables match docs/env-schema.json (edit the schema, then `npm run docs:env`)
npm run test:live # Run bounded-concurrency live integration tests
npm run eval:live # Run 23-case live STDIO JSON-RPC evaluation suite
Author: wtznicy
This project evolved from Open-WebSearch (originally created by Aas-ee) — special thanks to the original author. Thanks also to: