Skip to main content

小红书 + 知乎搜索 MCP Server(纯浏览器方案)

Project description

Stride28 Search MCP

中文社区经验聚合搜索 MCP Server。让你的 AI 助手直接搜索小红书和知乎的真实内容。

这是 Stride28 智能学习平台的搜索模块,独立抽出来作为 MCP 工具。

功能

Tool 平台 说明
login_xiaohongshu 小红书 扫码登录,Cookie 持久化
search_xiaohongshu 小红书 关键词搜索笔记(标题/URL/作者/点赞/封面)
get_note_detail 小红书 获取笔记详情(正文/评论/图片/互动数据)
login_zhihu 知乎 手动登录(可选,搜索不需要登录)
search_zhihu 知乎 关键词搜索(问答/专栏/视频)
get_zhihu_question 知乎 获取问题 Top N 回答(需登录)

技术方案

  • 纯浏览器操作:使用 Playwright 在浏览器内完成所有操作,不直接调用 API,零风控风险
  • 小红书:导航到搜索页 + 提取 __INITIAL_STATE__ SSR 数据
  • 知乎:API 响应拦截(/api/v4/search_v3)+ DOM 提取回答
  • Cookie 持久化:Playwright Persistent Context,登录一次后续自动使用

快速开始

安装

推荐使用 uvpipx,一行搞定:

# uv(推荐)
uv tool install stride28-search-mcp

# 或 pipx
pipx install stride28-search-mcp

安装后需要确保 Playwright 浏览器已下载:

playwright install chromium

配置 MCP Client

在你的 AI 客户端(Kiro / Cursor / Claude Code / VS Code)的 MCP 配置中添加:

{
  "mcpServers": {
    "stride28-search": {
      "command": "stride28-search-mcp",
      "disabled": false
    }
  }
}

如果用 uvx 免安装运行:

{
  "mcpServers": {
    "stride28-search": {
      "command": "uvx",
      "args": ["stride28-search-mcp"],
      "disabled": false
    }
  }
}

使用

跟 AI 助手说:

  • "帮我搜小红书上的 RAG 面试题"
  • "看看快手那篇面经的详细内容"
  • "去知乎搜搜 Agent 开发相关的讨论"

AI 会自动调用对应的 MCP tool,首次使用小红书会弹出浏览器让你扫码登录。

从源码安装(开发用)

git clone https://github.com/BrunonXU/Stride28-search-mcp.git
cd Stride28-search-mcp
pip install -e .
playwright install chromium

项目结构

Stride28-search-mcp/
├── pyproject.toml                  # 打包配置
├── stride28_search_mcp/
│   ├── server.py                   # MCP Server 入口
│   ├── adapter.py                  # 小红书浏览器搜索适配器
│   ├── zhihu_adapter.py            # 知乎浏览器搜索适配器
│   ├── lifecycle.py                # 搜索器生命周期管理
│   └── models.py                   # 数据模型
└── browser_data/                   # Cookie 持久化(~/.stride28-search-mcp/)

注意事项

  • 小红书需要扫码登录才能搜索,知乎搜索不需要登录
  • 知乎获取问题详情(get_zhihu_question)需要登录
  • 浏览器数据存储在 ~/.stride28-search-mcp/browser_data/,不会污染项目目录
  • 首次运行 playwright install chromium 会下载约 150MB 的浏览器

兼容的 MCP 客户端

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stride28_search_mcp-0.1.2.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stride28_search_mcp-0.1.2-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file stride28_search_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: stride28_search_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.7

File hashes

Hashes for stride28_search_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 803731573f09feb7af45ad31cde6a206b5b17e4f04916217d06666b200de72a4
MD5 738243ccf452056bbf36ba9df3b2e081
BLAKE2b-256 84ec6e175c3c470cddf29f4ce2d17252c8c9e4a24aa0997e3b187373298c57c8

See more details on using hashes here.

File details

Details for the file stride28_search_mcp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for stride28_search_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b1094b8606c6ea5a0674515b764727909f27a6fc37f8ff7c0cc52766badf819
MD5 0a81565f6b3b53bf62f233a5e26f9154
BLAKE2b-256 38f4aa99583c3ab8525ec5f2e411c544bd88821bdcf0a915889b503325bd033a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page