### Common commands for setup, testing, and CLI usage Source: https://github.com/awslew/web-search-mcp/blob/main/AGENTS.md Lists essential npm and node commands for installing dependencies, running unit and network tests, and using the CLI entry points. Node >= 22.5 is required for the node:sqlite DatabaseSync used by the cache layer. ```bash npm install # Node >= 22.5(node:sqlite 的 DatabaseSync 被缓存层使用) ``` ```bash npm run test:unit # 7 套纯离线确定性测试 —— 改代码后先跑这个 ``` ```bash npm test # 9 套全量(含 2 套真实网络测试,可能因外部限流偶发失败) ``` ```bash npm run test:net # 单跑检索通道真实网络测试 ``` ```bash npm run test:mcp # 单跑 MCP 端到端 JSON-RPC 测试 ``` ```bash node ws.js search "关键词" # CLI 入口 ``` ```bash node ws.js fetch "https://..." # 抓正文 ``` ```bash node ws.js status # 看当前闸门/引擎/密钥状态(排查第一步) ``` -------------------------------- ### Clone and install dependencies Source: https://github.com/awslew/web-search-mcp/blob/main/docs/DEPLOY_GUIDE.md Clones the repository and installs runtime dependencies including MCP SDK, Readability, linkedom, and turndown. After cloning, note the absolute path of the repository for client configuration. ```bash # 1. 克隆代码仓库至本地目录 git clone https://github.com/awslew/web-search-mcp.git # 2. 进入项目目录 cd web-search-mcp # 3. 安装依赖(包含 MCP SDK、Readability、linkedom、turndown 等) npm install ``` -------------------------------- ### 源码安装:git clone 与 npm install Source: https://github.com/awslew/web-search-mcp/blob/main/README.md 用于修改代码或运行测试。需要 Node.js ≥ 22.5(推荐 Node 24 LTS),因为项目使用 node:sqlite 的 DatabaseSync 接口。 ```bash git clone https://github.com/awslew/web-search-mcp.git cd web-search-mcp npm install ``` -------------------------------- ### 源码安装与 CLI 使用 Source: https://github.com/awslew/web-search-mcp/blob/main/llms.txt 从源码安装并直接以 CLI 使用。包含 git clone、npm install 以及 search、fetch、status 三个命令的示例。 ```bash git clone https://github.com/awslew/web-search-mcp.git cd web-search-mcp npm install # 直接以 CLI 使用 node ws.js search "mysql 索引 最左前缀原则" node ws.js fetch "https://nodejs.org/api/fs.html" node ws.js status ``` -------------------------------- ### Check Node.js version Source: https://github.com/awslew/web-search-mcp/blob/main/docs/DEPLOY_GUIDE.md Verifies that Node.js version 22.5 or higher is installed. The project requires Node.js ≥ 22.5 because it uses the built-in node:sqlite module; lower versions will throw ERR_UNKNOWN_BUILTIN_MODULE. ```bash node --version ``` -------------------------------- ### ws.js main() 输出格式规范代码 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/baseline_results.md 对应 `ws.js` 中 `main()` 函数的输出代码,逐字节定义了搜索结果的格式规范。首行固定为 `Search results for "":`,每条结果包含序号、`[source]` 标签、标题、URL 和可选的摘要,缩进恒为 3 个空格,每条结果后有一个空行。 ```javascript console.log(`Search results for "${query}":\n`); // 首行含引号原样 query + 一个换行(即首行后空一行) results.forEach((r, i) => { console.log(`${i + 1}. [${r.source}] ${r.title}`); // "序号. [source] 标题" source ∈ {baidu, bing, ddg} console.log(` ${r.url}`); // 3 空格缩进 + url(url 可能为字符串 "null") if (r.snippet) console.log(` ${r.snippet}`); // 3 空格缩进 + snippet(空则整行省略) console.log(); // 每条结果后一个空行 }); ``` -------------------------------- ### CLI 命令行用法:ws.js 检索、抓取与状态 Source: https://github.com/awslew/web-search-mcp/blob/main/README.md 直接使用 ws.js 独立命令行,无需 MCP 模式。支持网页检索、网页正文抽取和查看检索链路与 API 密钥配置状态。 ```bash node ws.js search "mysql 索引 最左前缀原则" ``` ```bash node ws.js fetch "https://nodejs.org/api/fs.html" ``` ```bash node ws.js status ``` -------------------------------- ### 生成垃圾域黑名单:npm run update:blacklist Source: https://github.com/awslew/web-search-mcp/blob/main/README.md 本地生成完整黑名单(4,300+ 条规则),需代理(上游列表在境外)。从 StevenBlack/hosts 与 hagezi/dns-blocklists 下载、压缩去重后写入 blacklist.json,运行时只读该文件、不再联网。任意下载失败则跳过该源,仍用内建名单写出文件。 ```bash HTTP_PROXY=http://127.0.0.1: npm run update:blacklist # 需代理(上游列表在境外) ``` -------------------------------- ### ws.js CLI 搜索与抓取命令 Source: https://github.com/awslew/web-search-mcp/blob/main/skill/SKILL.md MCP 未注册或调用失败时使用 ws.js CLI 兜底,接口逐字节兼容。搜索中文直连更快,抓外网页必须走代理,条数控制使用环境变量 MAX_RESULTS(尾部数字会并入查询,勿改)。 ```bash cd # 搜索(中文直连更快;设代理则走代理出网) node ws.js search "<关键词>" # 抓外网页(必须走代理) $env:HTTP_PROXY="http://127.0.0.1:"; node ws.js fetch "" # 条数控制使用环境变量(尾部数字会并入查询,勿改) $env:MAX_RESULTS="10"; node ws.js search "<关键词>" ``` -------------------------------- ### 运行测试与评估命令(npm test 等) Source: https://github.com/awslew/web-search-mcp/blob/main/README.md 提供全量测试、离线单元测试、质量验证和离线评估的命令。注意 npm test 包含 2 套真实网络测试,可能因限流或网络抖动偶发失败,优先使用 npm run test:unit 验证逻辑。 ```bash npm test ``` ```bash npm run test:unit ``` ```bash npm run verify:quality ``` ```bash npm run eval:capture mytag ``` ```bash npm run eval:replay mytag ``` ```bash npm run eval:compare mytag-baseline mytag-new ``` -------------------------------- ### 日常命令:测试、抓取、重放、对比、重排 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/CHANGELOG-2026-09.md 用于项目日常开发流程的 PowerShell 命令序列。包括全量测试、抓取原始结果(需联网并设置代理)、离线重放(支持 legacy 和 rrf 模式)、对比结果以及启用语义重排。注意:search-core.mjs 改动后需开新会话,缓存版本已升到 v5,RERANK=1 首次使用需下载 266MB 模型。 ```powershell cd # 全量测试(自测 + 回显 + 解析) npm test # 抓一批原始结果存盘(联网,约 3-5 分钟) $env:HTTPS_PROXY="http://127.0.0.1:" node eval/run-eval.mjs capture mytag # 离线重放并出指标(不联网,秒级) node eval/run-eval.mjs replay mytag mytag-rrf $env:EVAL_RANK_MODE="legacy"; node eval/run-eval.mjs replay mytag mytag-legacy # 对比两份结果 node eval/run-eval.mjs compare mytag-legacy mytag-rrf # 启用语义重排(可选) $env:RERANK="1" ``` -------------------------------- ### Agent Prompt Template for Search Tools Source: https://github.com/awslew/web-search-mcp/blob/main/skill/SKILL.md A standardized prompt snippet for embedding search tool capabilities into agent instructions. ```text 联网检索工具(国内直连,外网检索需配置本地代理): - 优先使用 MCP 工具: · web_search "<关键词>" 多引擎自动路由与 RRF 融合排序,带 ⚠️DEGRADED 表示引擎限流 · site_search "" "<查询>" 站内搜索——指定网站必用,查官方文档首选 · web_fetch "" 抓取网页正文 Markdown - MCP 未就绪时的 CLI 兜底: · 搜索:node ws.js search "<关键词>" · 抓取:node ws.js fetch "" - 查准原则:2–5 个核心词空格分隔,切忌整句提问;引号限定短语;指定网站一律 site_search - 降级处理:全部引擎失败才换词重试,遭遇限流优先使用 site_search 或 360 搜索页兜底 ``` -------------------------------- ### Set optional API keys for rescue fallback Source: https://github.com/awslew/web-search-mcp/blob/main/docs/DEPLOY_GUIDE.md Optionally sets third-party API keys for a rescue fallback during extreme network rate limiting. Priority order is Tavily > Bocha > Zhipu. Alternatively, copy api-keys.example.json to api-keys.json and fill in the keys. ```bash # 优先级:Tavily > 博查 (Bocha) > 智谱 (Zhipu) export TAVILY_API_KEY="你的_tavily_key" export BOCHA_API_KEY="你的_bocha_key" export ZHIPU_API_KEY="你的_zhipu_key" ``` -------------------------------- ### 安装依赖并生成黑名单(bash) Source: https://github.com/awslew/web-search-mcp/blob/main/docs/OPTIMIZATION_PLAN.md 在无 Docker 环境下安装 minisearch、创建 Python 虚拟环境并安装 ddgs,最后运行 update_blacklist.mjs 生成黑名单。注意 HTTP_PROXY 环境变量必须设置,否则黑名单下载会失败。 ```bash cd npm install minisearch # 已在本轮验证时安装 python -m venv .venv-ddg # 已建 ./.venv-ddg/Scripts/python.exe -m pip install ddgs # 已装 9.14.4 node update_blacklist.mjs # 走代理拉取黑名单(HTTP_PROXY 必需) ``` -------------------------------- ### Quality Assessment and Testing Commands Source: https://github.com/awslew/web-search-mcp/blob/main/skill/SKILL.md A collection of CLI commands for running tests, evaluating search quality, and maintaining system components. Note that network-dependent tests may fail due to rate limiting. ```bash npm test # 9 套测试驱动(324 项断言,含 2 套真实网络测试) # ⚠️ 联网套件遇限流会偶发失败,先看网络问题,勿当成代码回归;纯离线跑 npm run test:unit npm run verify:quality # 【同池对照】真实联网对照生产与归零配置(约 8 次 API 调用) npm run eval:capture # 抓取原始候选池存盘(联网 3-5 分钟) npm run eval:replay # 离线重放打分出 nDCG/MRR/hit@k(秒级) npm run eval:compare # 对比两份结果看逐条 delta npm run eval:ab # API 闸门受控 A/B(换 provider 需 API_PROVIDER= 或 --refetch) node eval/show.mjs [keyword] --api # 人眼核查最终排序结果(防被聚合宏观指标误导) node update_blacklist.mjs # 黑名单维护更新脚本(走代理拉取最新规则) node eval/gate.test.mjs # 闸门分支单测(20 项,含场景 A2 锁定与注册表密封) node eval/extract.test.mjs # 正文抽取单测(54 项:正文/噪音/结构/编码/相对链接/标题去重) node eval/api-parsers.test.mjs # API 契约单测(52 项,必须密封密钥) node eval/officialdocs.test.mjs # 官方文档召回单测(45 项,必须密封注册表) node test-mcp-e2e.mjs # MCP 端到端 JSON-RPC 测试(15 项) ``` -------------------------------- ### ws.js search 命令的原始输出示例 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/baseline_results.md 实际运行 `node ws.js search "接口格式测试"` 得到的原始输出,展示搜索结果的标准格式:首行 `Search results for "":` 后接空行,每条结果包含序号、`[source]` 标签、标题、URL 和可选的摘要,最后以空行分隔。 ```text Search results for "接口格式测试": 1. [bing] 接口(软件接口)_百度百科 https://baike.baidu.com/item/%E6%8E%A5%E5%8F%A3/15422203 接口(硬件类接口)是指同一计算机不同功能层之间的通信规则称为接口。 接口(软件接口)是指对协定进行定义的引用类型。 其他类型实现接口,以保证它们支持某些操作。 接口指定必须由类提供的 … 2. [bing] Java 接口 - 菜鸟教程 https://www.runoob.com/java/java-interfaces.html Java 接口 接口(英文:Interface),在JAVA编程语言中是一个抽象类型,是抽象方法的集合,接口通常以interface来声明。 一个类通过继承接口的方式,从而来继承接口的抽象方法。 接口并不是类,编 … 3. [bing] 开发口中的「接口」到底是什么 - 知乎 https://zhuanlan.zhihu.com/p/184858592 2020年8月15日 · 接口通过 网络协议 来调用,我们最常用的协议是 HTTP协议。 在定义一个接口时,会写好 接口路径 和接口方法名的 映射,然后前端通过接口路径来调用方法。 举个例子:一个获取商品 … 4. [bing] 什么是接口 - API 基础知识和教程-Apifox https://apifox.com/apiskills/what-is-an-interface/ 当我们在开始学习编程的时候,可能会被各种概念和技术所淹没,而其中一个非常重要的概念就是接口。 下面给大家介绍下接口的概念。 什么是接口? 接口 在编程领域中,接口通常用于描述两个软件系统 … 5. [bing] API接口是干嘛的?这篇通俗理解让你彻底明白 - 知乎 https://zhuanlan.zhihu.com/p/1942291841035796972 2025年8月22日 · 今天我们就用最通俗的语言,带你彻底理解——什么是API接口,它到底在干嘛,又为什么那么重要。 API接口是干嘛的? API,全称是 Application Programming Interface,中文叫“ 应用 … ``` -------------------------------- ### wx.requestPayment 调用示例 Source: https://github.com/awslew/web-search-mcp/blob/main/eval/fixtures/extract-basic.html 使用 wx.requestPayment 发起虚拟支付请求,需要提供 timeStamp、nonceStr 和 package 参数。 ```javascript const res = await wx.requestPayment({ timeStamp: '...', nonceStr: '...', package: 'prepay_id=...' }); ``` -------------------------------- ### 项目目录结构(web-search-mcp/) Source: https://github.com/awslew/web-search-mcp/blob/main/README.md 展示项目根目录下的文件与文件夹布局,包括 MCP 服务器入口、CLI、核心检索层、正文抽取、重排层、黑名单、测试脚本、评估套件、skill 和文档目录。 ```text web-search-mcp/ ├── server-cn.mjs # MCP stdio 服务器入口(注册 3 个 MCP 工具) ├── ws.js # CLI 命令行入口(search / fetch / status) ├── search-core.mjs # 核心检索层(引擎驱动、RRF 融合、黑名单、权威加权、缓存与 API 闸门) ├── extract-core.mjs # 正文抽取管线(linkedom + Readability + turndown + GBK 解码) ├── rerank.mjs # 可选语义重排层(cross-encoder,默认关闭) ├── blacklist.json # 垃圾域名与降权规则数据(本地生成,未随仓库分发,见下) ├── ddgs_search.py # 可选 DuckDuckGo 搜索 Python 桥接脚本 ├── api-keys.example.json # API 密钥模板(复制为 api-keys.json 使用) ├── run-tests.mjs # 测试驱动器(9 套测试调度) ├── test-search.mjs # 检索通道真实网络测试 ├── test-mcp-e2e.mjs # MCP 端到端 JSON-RPC 通信测试 ├── verify-quality.mjs # 权威源信号在线同池对照脚本 ├── verify-api.mjs # 搜索 API 连通性与结果验证脚本 ├── update_blacklist.mjs # 黑名单生成脚本(`npm run update:blacklist`) ├── eval/ # 离线评估套件(40 条标注基准查询 queries.json 与调参脚本) ├── skill/ # Agent skill:检索纪律与实测参考手册(见下) ├── docs/ # 开发与评估文档(过程记录,非使用必需) │ ├── OPTIMIZATION_PLAN.md # 设计依据与取舍记录 │ ├── CHANGELOG-2026-09.md # 检索精准度改造记录(含大量受控实验与否定结论) │ ├── DEPLOY_GUIDE.md # 部署与故障排查手册 │ ├── baseline_results.md # 改动前行为基线(8 条查询逐字输出) │ └── VERIFICATION_REPORT.md # 改动后验收报告(与基线逐条对照) ``` -------------------------------- ### T1 中文技术搜索命令 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/OPTIMIZATION_PLAN.md 用于验证中文技术查询在无代理环境下的搜索结果。预期至少 3 条结果,无 null URL,首屏无营销垃圾。 ```bash node ws.js search "node.js cheerio 教程" ``` -------------------------------- ### Run quick health checks with ws.js Source: https://github.com/awslew/web-search-mcp/blob/main/docs/DEPLOY_GUIDE.md Runs quick health checks from the project root: status, a search self-test, and a web fetch test. These commands verify the CLI mode and network connectivity. ```bash # 1. 查看链路与密钥状态 node ws.js status # 2. 运行快速搜索自测 node ws.js search "Node.js fs 模块" # 3. 运行网页提取测试 node ws.js fetch "https://nodejs.org" ``` -------------------------------- ### Configure Claude Code mcp.json Source: https://github.com/awslew/web-search-mcp/blob/main/docs/DEPLOY_GUIDE.md Adds the web-search MCP server to Claude Code's mcp.json configuration. Replace with the absolute path; on Windows, escape backslashes or use forward slashes. ```json { "mcpServers": { "web-search": { "command": "node", "args": ["/server-cn.mjs"] } } } ``` -------------------------------- ### server-cn.mjs 格式化层代码(不输出 sources) Source: https://github.com/awslew/web-search-mcp/blob/main/docs/CHANGELOG-2026-09.md 展示 web_search 格式化层如何构造输出,仅包含标题、URL、snippet 和 coverage,不包含 r.sources。这是导致 MCP 工具层看不到 [source] 标签的原因。 ```javascript // server-cn.mjs:135-140 const formatted = results.map((r, i) => { const cov = r.coverage !== undefined ? ` (coverage: ${r.coverage.toFixed(2)})` : ""; return `${i + 1}. **${r.title}**\n ${r.url}\n 🔍 ${r.snippet || "(no snippet)"}${cov}`; }) ``` -------------------------------- ### web_fetch Source: https://github.com/awslew/web-search-mcp/blob/main/README.md Fetches a webpage and extracts structured content, automatically stripping navigation, footer, and ads. ```APIDOC ## web_fetch ### Description Fetches a webpage and extracts structured content, automatically stripping navigation, footer, and ads. ### Parameters - **url** (string) - Required - The URL of the webpage to fetch. - **max_length** (number) - Optional - Maximum length of the extracted content (default 8000, max 50000). - **format** (enum: `markdown` | `text`) - Optional - Output format (default `markdown`). ### Response Returns the extracted structured content in the specified format. ``` -------------------------------- ### T8 site_search 测试命令 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/OPTIMIZATION_PLAN.md 验证 site_search 工具只返回目标域结果。 ```bash site_search("github.com","mcp server") ``` -------------------------------- ### 微信文档页输出示例 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/CHANGELOG-2026-09.md MCP 端到端测试中微信文档页的输出示例,显示标题带站点后缀,正文无重复 H1。 ```text # 小程序开发指南 | 微信开放文档 ← 标题带站点后缀,正文无重复 H1 小程序提供了一个简单、高效的应用开发框架和丰富的组件及API… ``` -------------------------------- ### T2 英文直连搜索命令 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/OPTIMIZATION_PLAN.md 验证英文直连搜索在无代理环境下的结果,预期有结果且 snippet 存在。 ```bash node ws.js search "linux command line tutorial" ``` -------------------------------- ### T7 验证墙韧性测试命令 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/OPTIMIZATION_PLAN.md 连续 5 次快速搜索,预期触发验证墙后自动降级 cn.bing,不崩溃。 ```bash node ws.js search "test" ``` -------------------------------- ### PowerShell command to locate host's environment scrubbing constant Source: https://github.com/awslew/web-search-mcp/blob/main/docs/CHANGELOG-2026-09.md Use this command to find the constant name used by the MCP host's source code for filtering sensitive environment variables. Replace with the host's package directory name and with the actual constant name. This avoids hardcoding paths that may change with host versions. ```powershell # 把 换成本机 MCP 宿主的包目录名, 换成其源码中的过滤常量名 Get-ChildItem "$(npm root -g)\ " -Recurse -File -Include *.js | Select-String -Pattern "" -List ``` -------------------------------- ### MCP 客户端配置:一行式接入(npx) Source: https://github.com/awslew/web-search-mcp/blob/main/llms.txt 推荐的一行式接入方式,无需 clone 或填写本地绝对路径。配置 MCP 客户端(如 Claude Code / Claude Desktop)的 mcpServers,使用 npx 运行远程 tgz 包。 ```json { "mcpServers": { "web-search": { "command": "npx", "args": [ "-y", "https://github.com/awslew/web-search-mcp/releases/download/v1.2.0/web-search-mcp-1.2.0.tgz" ] } } } ``` -------------------------------- ### T3 英文代理搜索命令 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/OPTIMIZATION_PLAN.md 验证通过代理进行英文搜索,预期至少 3 条结果,URL 无 /ck/a 包裹,来源含 [bing]/[ddgs]。 ```bash HTTP_PROXY=127.0.0.1: node ws.js search "nodejs http server best practices" ``` -------------------------------- ### T6 黑名单测试命令 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/OPTIMIZATION_PLAN.md 验证黑名单域被剔除,lower 域排到后面。 ```bash node ws.js search "xxx .top 站" ``` -------------------------------- ### blacklist.json 格式示例 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/OPTIMIZATION_PLAN.md 运行时文件 blacklist.json 的结构,包含 remove 数组(硬过滤的域名模式)和 lower 数组(降权域名)。由 update_blacklist.mjs 脚本生成,运行时只读本地文件,不联网。 ```json { "remove": ["*.xyz", "*.top", "spam.example.com", ...], "lower": ["baijiahao.baidu.com", "blog.csdn.net", "zhihu.com"] } ``` -------------------------------- ### Set proxy environment variables on Linux/macOS Source: https://github.com/awslew/web-search-mcp/blob/main/docs/DEPLOY_GUIDE.md Sets proxy environment variables for Linux/macOS in ~/.bashrc or ~/.zshrc. These are used for international engines and external web fetching; domestic engines bypass the proxy. ```bash export HTTP_PROXY="http://127.0.0.1:" export HTTPS_PROXY="http://127.0.0.1:" ``` -------------------------------- ### Claude Code 接入配置(mcp.json) Source: https://github.com/awslew/web-search-mcp/blob/main/README.md 在 mcp.json 中添加此配置以接入 Claude Code。将 替换为仓库的本地绝对路径。 ```json { "mcpServers": { "web-search": { "command": "node", "args": ["/server-cn.mjs"] } } } ``` -------------------------------- ### T4 长 snippet 搜索命令 Source: https://github.com/awslew/web-search-mcp/blob/main/docs/OPTIMIZATION_PLAN.md 验证 ddgs 来源结果 snippet 长度至少 100 字符。 ```bash HTTP_PROXY=... node ws.js search "python async programming" ``` -------------------------------- ### MCP 服务器接入配置(node) Source: https://github.com/awslew/web-search-mcp/blob/main/llms.txt 作为 MCP 服务器接入客户端(Claude Code / Claude Desktop / 任意 MCP 客户端)的配置示例,使用 node 运行 server-cn.mjs,需填写本地绝对路径。 ```json { "mcpServers": { "web-search": { "command": "node", "args": ["/absolute/path/to/web-search-mcp/server-cn.mjs"] } } } ``` -------------------------------- ### web_search Source: https://github.com/awslew/web-search-mcp/blob/main/README.md Performs a multi-engine web search and returns deduplicated, RRF-ranked results with titles, URLs, and snippets. ```APIDOC ## web_search ### Description Performs a multi-engine web search and returns deduplicated, RRF-ranked results with titles, URLs, and snippets. ### Parameters - **query** (string) - Required - The search query. - **max_results** (number) - Optional - Number of results to return (1-10, default 5). ### Response Returns a list of search results with title, URL, and snippet. ``` -------------------------------- ### Set proxy environment variables on Windows PowerShell Source: https://github.com/awslew/web-search-mcp/blob/main/docs/DEPLOY_GUIDE.md Sets proxy environment variables in Windows PowerShell. The first block applies temporarily for the current session; the second block sets them permanently at the user level. ```powershell $env:HTTP_PROXY = "http://127.0.0.1:" $env:HTTPS_PROXY = "http://127.0.0.1:" ``` ```powershell [Environment]::SetEnvironmentVariable('HTTP_PROXY', 'http://127.0.0.1:', 'User') [Environment]::SetEnvironmentVariable('HTTPS_PROXY', 'http://127.0.0.1:', 'User') ``` -------------------------------- ### site_search Source: https://github.com/awslew/web-search-mcp/blob/main/README.md Performs a site-restricted search within a specified domain, ensuring all results are limited to that domain. ```APIDOC ## site_search ### Description Performs a site-restricted search within a specified domain, ensuring all results are limited to that domain. ### Parameters - **query** (string) - Required - The search query. - **domain** (string) - Required - The domain to restrict the search to (e.g., `github.com`, `docs.python.org`). - **max_results** (number) - Optional - Number of results to return (1-10, default 5). ### Response Returns a list of search results limited to the specified domain. ``` -------------------------------- ### PowerShell script syntax validation with Parser::ParseFile Source: https://github.com/awslew/web-search-mcp/blob/main/docs/CHANGELOG-2026-09.md Use this PowerShell one-liner to statically validate a script's syntax after editing. It parses the file and outputs the count of parse errors, which must be 0. This catches syntax errors that may not surface until later execution, such as a trailing comma in an array. ```powershell $e=$null;$t=$null [System.Management.Automation.Language.Parser]::ParseFile('.\your-script.ps1',[ref]$t,[ref]$e); $e.Count # 必须为 0 ```