wechat-mp-search
This server lets you search WeChat official-account articles via Sogou WeChat Search and fetch their full text content.
weixin_search – Search one page of WeChat articles for a keyword (
query), with optionalpage; returns results containing title, link, real_url, publish_time, and page.weixin_search_all – Automatically paginate through multiple pages of search results, up to
max_pages(default 10, server-side capped), aggregating results until an empty page, an anti-crawl block, or the page limit is reached.get_weixin_article_content – Fetch the plain-text body of a WeChat article using its
real_url, with an optionalreferer; on failure it returns an error message string instead of throwing.Anti-scraping handling – Built-in session cookies, request delay/jitter, one retry with a fresh session on crawl detection, and a hard page limit help reduce blocking.
MCP server – Exposes the same tools as a stdio MCP server for use by any MCP client (e.g. Claude Code, Cursor, Codex).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@wechat-mp-searchSearch WeChat official account articles about artificial intelligence and show me the top results."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dsh-wechat-mp-search
deepseek-harness (dsh) 插件,同时提供同构的 MCP server 入口:零配置抓取搜狗微信搜索(weixin.sogou.com),用于检索微信公众号文章并抓取正文。
两种分发形态共享同一套核心逻辑(src/sogou.ts),工具名、参数与返回字段完全一致:
dsh 插件(
src/index.ts):进程内 Cordis 插件,随宿主 dsh 运行时加载;MCP server(
src/mcp-server.ts):标准 Model Context Protocol stdio server,供 Claude Code、Cursor、Codex 等任意 MCP 客户端使用。
工具
工具名 | 参数 | 说明 |
|
| 搜索单页结果,返回 |
|
| 按页翻页搜索,直到达到页数上限或命中反爬拦截; |
|
| 抓取文章正文纯文本;失败时返回 |
weixin_search/weixin_search_all 返回的每条结果字段:title、link(搜狗跳转链接)、real_url(还原后的微信公众号真实链接,解析失败为空串)、publish_time、page。
Related MCP server: WeChat Article Reader MCP Server
反爬 / 限流策略
本插件进行了四项反爬增强,均可通过插件配置调整:
会话级 cookie jar:同一次搜索会话内(一次
weixin_search调用及其后续链接解析请求)共享并累积Set-Cookie,使后续请求携带前序请求获得的 cookie。请求间限速抖动:链接解析之间使用
linkDelayMs+[0, linkDelayJitterMs)随机抖动延迟;weixin_search_all翻页之间使用pageDelayMs+[0, pageDelayJitterMs)随机抖动延迟。反爬重试:命中反爬验证(响应体或跳转后 URL 出现反爬特征)时,重建一个全新会话(全新 cookie jar)重试一次;仍失败才判定为
blocked: true。max_pages硬上限:weixin_search_all的max_pages参数无法突破插件配置项maxPages(默认 30)。
配置项
配置项 | 默认值 | 说明 |
|
| 单次 HTTP 请求超时(毫秒)。 |
|
| 响应体最大字节数;流式读取达到上限即停止下载并按字符边界截断。 |
|
| 链接解析之间的最小延迟与随机抖动上限。 |
|
| 翻页之间的最小延迟与随机抖动上限。 |
|
| 命中反爬后重建会话重试前的最小延迟。 |
|
|
|
各数值配置项均有下界(如 requestTimeoutMs >= 1,延迟类 >= 0):dsh 形态下非法值会在插件加载时被校验拒绝;MCP 形态(不经过配置校验)会将非法值(负数、NaN 等)回退为默认值。
安装
dsh 插件
# 本地路径安装
dsh plugin --profile <profile-name> add ${workspace}/dsh-wechat-mp-search
# 发布到 npm 后
dsh plugin --profile <profile-name> add dsh-wechat-mp-searchMCP server(任意 MCP 客户端)
本包的默认可执行入口即 MCP stdio server。
本地路径使用(无需发布到 npm):先用 npm install && npm run build 生成 lib/,然后在支持 MCP 的客户端中添加:
{
"mcpServers": {
"wechat-mp-search": {
"command": "node",
"args": ["${workspace}/dsh-wechat-mp-search/lib/mcp-server.js"]
}
}
}Claude Code 也可以一行命令添加:
claude mcp add wechat-mp-search -- node ${workspace}/dsh-wechat-mp-search/lib/mcp-server.js修改源码后重新 npm run build 即生效。频繁迭代可在项目目录执行 npm link,之后配置直接写 "command": "dsh-wechat-mp-search"。
发布到 npm 后:
{
"mcpServers": {
"wechat-mp-search": {
"command": "npx",
"args": ["-y", "dsh-wechat-mp-search"]
}
}
}或全局安装后直接使用命令:
npm install -g dsh-wechat-mp-search
# 客户端配置: { "command": "dsh-wechat-mp-search" }MCP 入口零配置运行,各反爬参数使用上文默认值;需要自定义时可在 dsh 形态下通过插件 config 调整。
开发
npm install
npm run build # tsc -p tsconfig.json
npm run typecheck # tsc --noEmit
npm test # vitest run
peerDependencies中的@deepseek-ai/cordis、@deepseek-ai/dsh-tools由宿主 dsh 运行时提供。 本仓库的.npmrc已将 registry 指向官方https://registry.npmjs.org/,因为这几个包 (含其自身的@deepseek-ai/dsh-llm、@deepseek-ai/dsh-session等传递 peer 依赖)已在公网 npm 发布对应版本,可直接npm install;若你的环境配置了指向其他镜像源的全局 registry, 请临时使用--registry=https://registry.npmjs.org/或本仓库自带的.npmrc。
免责声明
仅学习研究使用,请控制请求频率,遵守搜狗 / 微信与相关法规。目标站点接口变更可能导致解析逻辑失效
Available Tools
3 toolsget_weixin_article_contentA
抓取微信公众号文章正文纯文本。失败时返回以"获取文章内容失败:"开头的说明,而非报错。
| Name | Required | Description | Default |
|---|---|---|---|
| referer | No | 可选的 Referer 请求头 | |
| real_url | Yes | 微信公众号文章真实链接(https://mp.weixin.qq.com/...) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It does disclose a key behavioral trait: on failure it returns a message starting with '获取文章内容失败:' instead of raising an error, and it returns plain text. However, it omits other potentially relevant behaviors such as authentication requirements or rate limits, so it is only partially transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, compact sentence that front-loads the primary purpose and then adds the essential failure-behavior note. There is no wasted wording or redundant restating of the tool name.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a straightforward fetch-content tool, the description covers the core action, the output type (plain text), and the failure mode. The lack of an output schema is mitigated by mentioning '纯文本'. Minor gaps like referer usage are already covered by the schema's parameter descriptions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description does not add any parameter-level semantics beyond the schema, but it doesn't need to because the schema already documents both parameters clearly.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('抓取' / fetch) and a specific resource ('微信公众号文章正文纯文本' / WeChat article body plain text). This clearly distinguishes it from the sibling search tools (weixin_search, weixin_search_all), which find articles rather than retrieve their content.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given about when to use this tool versus the sibling search tools. The description only explains what the tool does and its failure behavior, leaving the agent to infer usage context from the name and schema.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
weixin_searchA
在搜狗微信搜索(weixin.sogou.com)中搜索微信公众号文章,返回单页结果。
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | 搜索结果页码,从 1 开始,默认 1 | |
| query | Yes | 搜索关键词 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It discloses that the tool searches Sogou WeChat and returns one page, which is a useful behavioral trait. However, it omits operational details such as possible anti-bot/captcha behavior, per-page result count, and whether the return value is raw HTML or parsed results.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one compact sentence that leads with the action and platform, then states the single-page return behavior. It contains no filler and does not duplicate schema content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With only two well-documented parameters and no nested objects, invocation is simple. However, there is no output schema and the description only says '返回单页结果', leaving the return format and contents unspecified, which is a notable gap for downstream planning, especially with the sibling get_weixin_article_content.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema describes both parameters with 100% coverage: 'query' is '搜索关键词' and 'page' is 1-based with a default of 1. The description adds no parameter-specific detail, but the schema already carries that burden, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description contains a specific action ('搜索'), a target ('微信公众号文章'), and a named platform ('搜狗微信搜索/weixin.sogou.com'). The phrase '返回单页结果' distinguishes this tool from the sibling weixin_search_all, so an agent can identify it without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description's '返回单页结果' gives clear contextual scope: this tool is for retrieving a single page of search results. It does not explicitly say to use weixin_search_all for all pages, so it lacks an explicit alternative, but the context is clear enough for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
weixin_search_allA
自动翻页搜索多页微信公众号文章并聚合结果,直到空页、命中反爬拦截或达到页数上限为止。
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | 搜索关键词 | |
| max_pages | No | 最多翻页数,默认 10;不可超过服务端硬上限 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It explains that the tool automatically turns pages, aggregates results, and stops under three named conditions (empty page, anti-crawler interception, page limit). This is useful context beyond simply saying 'search'. It doesn't cover auth requirements or return format, but the core behavior is transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, dense sentence that front-loads the main action and resource, then provides the termination logic. Every part contributes essential information, with no redundant filler or restatement of the tool name.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 2-parameter tool with no output schema, the description covers the key functional behavior and edge cases (stopping conditions) well. It does not describe the return format or error handling for anti-crawler interception, but the parameter schema is fully covered and the invocation logic is clear. Minor gap: it doesn't explain what 'aggregated results' look like.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds no new meaning to the parameters beyond what the schema already provides: the 'query' is a keyword and 'max_pages' is a page count with a default and hard limit. The tool description's mention of 'page limit' aligns with but does not exceed the schema's parameter description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb phrase ('自动翻页搜索' - automatically paginate search) and clearly identifies the resource ('微信公众号文章') and action ('聚合结果' - aggregate results). It also lists explicit termination conditions (empty page, anti-crawler interception, page limit), which distinguishes it from the likely single-page sibling 'weixin_search' and the content-fetching sibling 'get_weixin_article_content'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage context is implied: an agent can infer this tool is for multi-page search aggregation because it explicitly mentions pagination and aggregation. However, the description does not either explicitly say when to use this vs. the sibling 'weixin_search' or state any exclusions. No alternatives are named.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
get_weixin_article_content - First observed
weixin_search - First observed
weixin_search_all
TDQS
Scored across 3 tools
weixin_search and weixin_search_all both search Sogou WeChat articles, but their descriptions clearly distinguish single-page vs aggregated multi-page results. get_weixin_article_content is a separate retrieval step with no overlap.
The weixin_search and weixin_search_all names share a consistent prefix and action style, but get_weixin_article_content breaks the pattern by leading with get_ and placing article before content. The naming is still readable, just not uniformly structured.
Three tools is appropriately scoped for a focused WeChat article search-and-read server. Each tool has a distinct role: one-page search, multi-page search, and content retrieval.
For the stated purpose of searching WeChat public account articles and reading article text, the surface is complete. Search covers both quick single-page and full paginated needs, and content fetching provides the end-to-end workflow.
Maintenance
Related MCP Connectors
Read WeChat public account articles via MCP. 99.89% anti-scraping success, 50-87% token compression.
Scrape, crawl and search the web for AI agents via MCP.
Search and read public social data from Chinese and global platforms, pay per call.
One MCP for the Web. Easily search, crawl, navigate, and extract websites without getting blocked.…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables parsing and extracting content from WeChat public account articles using browser simulation, supporting multiple output formats (JSON, Markdown, HTML) and media resource extraction.-
- FlicenseNot gradedqualityDmaintenanceEnables fetching, searching, and summarizing WeChat public account articles through browser automation. Supports multiple output formats and provides article metadata and statistics.1-
- AlicenseAqualityDmaintenanceRead WeChat (微信) Official Account articles with native multimodal output — body, images, and video keyframes returned as MCP content blocks. Handles all three embed types: Tencent Video, WeChat-native, and Channels (视频号 metadata via public API).17MIT
- AlicenseAqualityCmaintenanceEnables crawling WeChat Official Account articles via the mp.weixin.qq.com search interface, including account search, article listing, incremental crawling, and fetching articles as Markdown with local SQLite storage.61MIT