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.0.tar.gz (21.6 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.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stride28_search_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 21.6 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.0.tar.gz
Algorithm Hash digest
SHA256 305d70518a3679b1ef92a1e56ac03bd5fd924fdc53560e4109439d23d0bd69df
MD5 c862c8b1d5afbac6cf1dd8fbdac6bc44
BLAKE2b-256 d280d295a48a0a1f0d4313db3e2cecba746e2b736513880e3fdcb885b64b9393

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stride28_search_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66cc9c81a1e92e194cf5eb785e5e8fb68c0d215ef4df223e7a0147816f5a3b48
MD5 f153a4ef6c3373a04345d93f4e75fb73
BLAKE2b-256 b6d8c29abb4c998570e2ded2d8f4a2321a5c99da2c9876fc503924671657a3ce

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