网页搜索CLI工具

web-search 是一个Unix风格的命令行工具,提供网页搜索、内容提取和代理轮换功能。

  • by Oremus-Labs
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 Oremus-Labs/web-search-mcp

使用说明

网络搜索

web-search 是一个Unix-style CLI,用于通过托管REST API进行web搜索、提取和代理轮换。

它与以下人员交谈:

  • https://web-search.oremuslabs.app 用于API请求
  • https://search.oremuslabs.app 间接通过API进行SearXNG-based搜索

CLI公开了三个命令:

  • search SearXNG支持的网络结果
  • extract 用于Trafilatura支持的页面提取
  • rotate 用于手动VPN/代理轮换

安装

GitHub发布tarball

npx -y https://github.com/Oremus-Labs/web-search/releases/latest/download/web-search.tgz search "vatican"

npm

npx -y @oremus-labs/web-search search "vatican"

配置

可选环境变量:

  • WEB_SEARCH_API_URL
    • 默认为 https://web-search.oremuslabs.app
  • USER_AGENT
    • 首选命令: web-search

命令

search

web-search search "vatican" --json
web-search search "site:docs.python.org asyncio" --language en --time-range year

旗帜:

  • --json
  • --pageno <n>
  • --time-range day|month|year
  • --language <code>
  • --safesearch 0|1|2

extract

web-search extract "https://example.com/article" --json
web-search extract "https://github.com/org/repo/blob/main/README.md" --max-chars 4000 --start-char 0

旗帜:

  • --json
  • --include-comments
  • --include-tables
  • --no-proxy
  • --max-chars <n>
  • --start-char <n>
  • --max-fetch-bytes <n>
  • --fetch-timeout-seconds <n>
  • --user-agent <value>
  • --accept-language <value>
  • --plain-text-fallback
  • --no-rewrite-github-blob-to-raw
  • --max-total-seconds <n>

rotate

web-search rotate --json

本地开发

cd web-search
npm install
npm test
npm run build
WEB_SEARCH_API_URL="http://127.0.0.1:18090" npm run smoke

本地群集访问

如果不想使用公共主机名,则为集群内API的端口:

kubectl -n searxng port-forward svc/searxng-web-search-api 18090:8090
WEB_SEARCH_API_URL="http://127.0.0.1:18090" web-search search "example domain"

备注

  • 此仓库不再提供MCP服务器。
  • Kubernetes侧MCP端点和MCP会话恢复逻辑被简单的REST API所取代。