Skip to main content

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

Project description

Stride28 Search MCP

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

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

演示

Kiro 搜索演示 1

Kiro 搜索演示 2

使用场景

跟 AI 助手说:

  • "帮我搜小红书上关于 RAG 的面试题"
  • "看看那篇笔记的详细内容和评论"
  • "去知乎搜搜 Agent 开发相关的讨论"
  • "只搜小红书的视频笔记"
  • "获取知乎这个问题的完整回答,不要截断"

AI 会自动调用对应的 MCP tool。首次使用时会弹出浏览器让你完成登录。

安装

需要 Python 3.10+。

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

# 或 pipx
pipx install stride28-search-mcp

安装 Playwright 浏览器:

stride28-search-mcp install-browser

配置 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
    }
  }
}

可用 Tool

Tool 平台 说明
login_xiaohongshu 小红书 扫码登录,Cookie 持久化
search_xiaohongshu 小红书 关键词搜索笔记,支持图文/视频类型过滤
get_note_detail 小红书 获取笔记详情(正文/评论翻页/图片/互动数据/发布时间)
login_zhihu 知乎 手动登录
search_zhihu 知乎 关键词搜索(问答/专栏/视频)
get_zhihu_question 知乎 获取问题 Top N 回答,内容长度可配置

search_xiaohongshu 参数

参数 类型 默认值 说明
query string 必填 搜索关键词
limit int 10 返回条数(建议 10-20)
note_type string "all" "all" / "normal"(图文)/ "video"

get_note_detail 参数

参数 类型 默认值 说明
note_id string 必填 笔记 ID(从搜索结果获取)
xsec_token string "" 安全 token(从搜索结果获取)
max_comments int 50 最大评论获取数量

get_zhihu_question 参数

参数 类型 默认值 说明
question_id string 必填 问题 ID(从搜索结果的 xsec_token 字段获取)
limit int 5 返回回答数
max_content_length int 10000 每条回答最大字符数,0 = 不截断

错误码

所有错误返回统一 JSON 格式,包含 retryable 字段供 agent 判断是否自动重试。

错误码 含义 可重试 建议操作
login_required 未登录或 Cookie 失效 调用对应的 login tool
login_timeout 登录超时(5 分钟) 重新登录
search_timeout 搜索/获取超时 稍后重试
browser_init_failed 浏览器启动失败 执行 stride28-search-mcp install-browser
browser_crashed 浏览器崩溃 重启 MCP Server
captcha_detected 被验证码拦截 等待后重试或手动处理
unknown_error 未知错误 查看 server 日志

环境变量

变量 默认值 说明
STRIDE28_SEARCH_MCP_HOME ~/.stride28-search-mcp 数据目录(浏览器 Cookie 等)
STRIDE28_RATE_LIMIT_SECONDS 2.0 同平台请求最小间隔(秒)

常见问题

  • 返回 browser_init_failed → 执行 stride28-search-mcp install-browser
  • 返回 login_required → 调用 login_xiaohongshulogin_zhihu
  • 返回 captcha_detected → 请求太频繁被风控,等几分钟再试
  • 搜索结果为空 → 正常情况,确实没有匹配内容(已自动排除验证码拦截的情况)

环境自检

stride28-search-mcp doctor

兼容的 MCP 客户端

KiroCursorClaude CodeVS Code + Copilot • 任何支持 MCP stdio transport 的客户端

开发

详见 ARCHITECTURE.md

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.5.tar.gz (612.5 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.5-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for stride28_search_mcp-0.1.5.tar.gz
Algorithm Hash digest
SHA256 687321d196c7366545684b628007f09a030348747704e0e9de72d667cca05e90
MD5 3220dd51bdb58f1d7af9bdbadbefada5
BLAKE2b-256 3f5d7ee546fb0deb85e4a81b97f84a2100cda8d46783a4db3df96190e3a8fe7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stride28_search_mcp-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9fc96c445d26c7b902db2f6bc669c3d5af350f429ae35380cd292c5a132b5229
MD5 c8794567192ca595f6c4f2f0055826e6
BLAKE2b-256 8a4acc09fd61e0c99cd2fe7b05db76d4c8d42f230d22257e31501ea291709559

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