Skip to main content

SkySearch

为 AI Agent 设计的搜索工具,解决"Agent 需要实时、准确获取互联网信息"的问题。


解决了什么问题

Agent(如 Claude Code)做深度研究时,需要:

  1. 搜索 — 从 Bing 获取最新结果
  2. 抓取 — 从结果 URL 提取完整内容(很多是 JS 动态渲染)
  3. 判断 — 人工或程序判断哪些 URL 值得抓

传统方案的问题:

  • requests / curl 抓不到 JS 渲染的页面(知乎、SPA、单页应用)
  • Selenium 太重、启动慢、资源占用大
  • Google Search API 要钱,Bing API 也要钱

SkySearch = Bing 搜索 + DrissionPage 动态渲染 + BM25 排序,轻量、免费、Agent 友好。


核心能力

能力 说明
搜索 Bing 分页搜索,支持中文分词
抓取 自动检测动态/静态页面,动态页面自动 JS 渲染
排序 BM25 对搜索结果按相关性排序(可选)
MCP MCP Server 协议,Claude Code 直接调用

安装

pip install skysearch

快速开始

Agent 工作流

# Step 1: 调用 search工具,获取 Bing搜索结果
search(query="浙江大学 录取 分数线", num=10)

# Step 2: Agent 人工/程序判断哪些 URL 值得抓

# Step 3: 对选中的 URL 调用 fetch 工具
fetch(url="https://example.com", output_mode="info")

MCP Server

Claude Code 等 MCP 客户端可直接调用 search 和 fetch 工具:

skysearch-mcp

API 设计理念

search + fetch 分离,而不是 search_and_fetch 自动完成:

  • Agent 可以先看搜索结果(快),再决定抓哪些
  • 抓取是按需的,不浪费资源在无关 URL 上
  • 适合深度研究场景,不适合"搜完就完事"的简单场景

命令行

# 搜索
skysearch "关键词" -n 10

# 抓取
skysearch --url https://example.com --mode info

# 强制动态渲染
skysearch --url https://example.com --mode info --headed

Claude Code 配置

在 CLAUDE.md 或项目根目录添加 MCP 服务器配置

{
  "mcpServers": {
    "skysearch": {
      "command": "python",
      "args": ["-m", "skysearch.mcp"],
      "description": "Bing 搜索 + 网页抓取"
    }
  }
}

配置后 Claude Code 会自动连接,Agent 可直接调用 search 和 fetch 工具。


项目结构

skysearch/
├── __init__.py         # 导出 search, fetch, utils
├── cli.py              # Click CLI
├── core/
│   ├── search.py       # Bing 搜索 + BM25
│   ├── fetcher/        # Fetcher 类
│   │   ├── fetcher.py  # 单次 fetch 封装
│   │   ├── static_fetch.py
│   │   ├── dynamic_fetch.py
│   │   └── parse.py
│   ├── utils/          # 解析工具
│   │   ├── utils.py    # parse_bing_results, extract_real_url
│   │   └── ranker.py   # rank_documents
│   └── service.py      # API 封装
└── mcp/
    ├── server.py        # FastMCP 入口
    └── tools.py         # @mcp.tool() search/fetch

License

MIT

Metadata

Release files for skysearch 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skysearch 1.1.1
File Size Uploaded Provenance Actions
skysearch-1.1.1.tar.gz 15.6 kB Without provenance Details for skysearch-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for skysearch 1.1.1
File Interpreter ABI Platform Actions
skysearch-1.1.1-py3-none-any.whl Python 3 none any Details for skysearch-1.1.1-py3-none-any.whl

Total release size: 35.3 kB

Release files / skysearch-1.1.1.tar.gz

Download URL skysearch-1.1.1.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
426fe04ea494686a58727a8fa0ce42e8f19f8aaa7910cf8887672a41f1ff20c7
BLAKE2b-256 checksum
How to use checksums
391ee8440b2cbf5b812110af104eeb129c42800112aabe592dd1f87bd0be8ef3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Release files / skysearch-1.1.1-py3-none-any.whl

Download URL skysearch-1.1.1-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cfac0b07fd4171071b3c70243d2065ca246f2381a2a49a34a987f76cf9f1cb3
BLAKE2b-256 checksum
How to use checksums
165c9ac62ae538cfd1511bee4f754ba3db40fc6b2964fdfb9f7fdd6cd4e4ed92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Security for skysearch 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page