mp2rss-mp
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesemp2rss-mp Skill
mp2rss-mp Skill
通过 Mp2rss CLI 管理微信公众号订阅与文章 —— 订阅 / 列出 / 取消订阅微信公众号,按 mpId 查询单个公众号的历史文章。
Manage WeChat Official Account subscriptions and articles through the Mp2rss CLI — subscribe to / list / unsubscribe from WeChat Official Accounts and query historical articles for a single Official Account by mpId.
Prerequisites
Prerequisites
- 二进制已安装(参考
mp2rss的 Prerequisites)mp2rss-auth - 已登录:显示
mp2rss auth status(首次使用先跑loggedIn: true)mp2rss auth login
- The binary is installed (see the Prerequisites of
mp2rss)mp2rss-auth - You are logged in: displays
mp2rss auth status(on first use, runloggedIn: true)mp2rss auth login
Commands
Commands
List subscriptions
List subscriptions
mp2rss mp list [-q <keyword>] [-p <page>] [--page-size <n>] [-o json]| Flag | Default | Description |
|---|---|---|
| — | 按公众号名模糊搜索 |
| 1 | 页码 |
| 20 | 每页条数(最大 50) |
| table | |
bash
mp2rss mp list
mp2rss mp list -q 财经
mp2rss mp list -p 2 --page-size 50
mp2rss mp list -o json | jq '.items[].mpName'JSON shape:
json
{
"items": [
{
"sourceType": "mp",
"mpId": 123456,
"mpName": "某公众号",
"mpAvatarUrl": "https://...",
"createdAt": 1705000000000,
"mpLastArticleAt": 1705000050000
}
],
"total": 42,
"page": 1,
"pageSize": 20
}mp2rss mp list [-q <keyword>] [-p <page>] [--page-size <n>] [-o json]| Flag | Default | Description |
|---|---|---|
| — | Fuzzy-search by Official Account name |
| 1 | Page number |
| 20 | Number of items per page (maximum 50) |
| table | |
bash
mp2rss mp list
mp2rss mp list -q 财经
mp2rss mp list -p 2 --page-size 50
mp2rss mp list -o json | jq '.items[].mpName'JSON shape:
json
{
"items": [
{
"sourceType": "mp",
"mpId": 123456,
"mpName": "某公众号",
"mpAvatarUrl": "https://...",
"createdAt": 1705000000000,
"mpLastArticleAt": 1705000050000
}
],
"total": 42,
"page": 1,
"pageSize": 20
}Search subscriptions
Search subscriptions
mp2rss mp search <keyword> [-p <page>] [--page-size <n>] [-o json]mp2rss mp list -q <keyword>listbash
mp2rss mp search 财经
mp2rss mp search 财经 -o jsonmp2rss mp search <keyword> [-p <page>] [--page-size <n>] [-o json]This is syntactic sugar for , with the same flags and output as .
mp2rss mp list -q <keyword>listbash
mp2rss mp search 财经
mp2rss mp search 财经 -o jsonSubscribe a WeChat MP
Subscribe to a WeChat Official Account
mp2rss mp subscribe <article-url> [-o json]⚠️ 传入的是文章 URL(),不是公众号名、不是二维码、也不是公众号主页链接。从公众号任意一篇文章里复制链接即可,Mp2rss 会从该文章解析出所属公众号并把整个公众号订阅到你的 Feed。
https://mp.weixin.qq.com/s/...bash
mp2rss mp subscribe https://mp.weixin.qq.com/s/abcDEFghIJKlmnop
mp2rss mp subscribe https://mp.weixin.qq.com/s/abc -o jsonJSON shape:
json
{
"ok": true,
"articleUrl": "https://mp.weixin.qq.com/s/..."
}mp2rss mp subscribe <article-url> [-o json]⚠️ Pass an article URL (), not an Official Account name, QR code, or Official Account homepage link. Copy the link from any article on the Official Account; Mp2rss will parse the account that owns the article and subscribe the entire Official Account to your Feed.
https://mp.weixin.qq.com/s/...bash
mp2rss mp subscribe https://mp.weixin.qq.com/s/abcDEFghIJKlmnop
mp2rss mp subscribe https://mp.weixin.qq.com/s/abc -o jsonJSON shape:
json
{
"ok": true,
"articleUrl": "https://mp.weixin.qq.com/s/..."
}Unsubscribe
Unsubscribe
mp2rss mp remove <mpId> [-y] [-o json]按 mpId 取消订阅。 跳过交互式确认(适合脚本调用)。
-ybash
mp2rss mp remove 123456
mp2rss mp remove 123456 -y
mp2rss mp remove 123456 -y -o jsonJSON shape:
json
{
"ok": true,
"mpId": 123456
}mpId 从 的 获取。
mp2rss mp list -o jsonitems[].mpIdmp2rss mp remove <mpId> [-y] [-o json]Unsubscribe by mpId. skips the interactive confirmation (suitable for scripted calls).
-ybash
mp2rss mp remove 123456
mp2rss mp remove 123456 -y
mp2rss mp remove 123456 -y -o jsonJSON shape:
json
{
"ok": true,
"mpId": 123456
}Obtain the mpId from in .
items[].mpIdmp2rss mp list -o jsonList articles of a MP
List articles of an Official Account
mp2rss mp articles <mpId> [-p <page>] [--page-size <n>] [-o json]按公众号 mpId 查历史文章。
| Flag | Default | Description |
|---|---|---|
| 1 | 页码 |
| 100 | 每页条数(最大 100) |
| table | |
bash
mp2rss mp articles 123456
mp2rss mp articles 123456 -p 2 --page-size 100
mp2rss mp articles 123456 -o json | jq '.items[].title'JSON shape:
json
{
"items": [
{
"mpId": 123456,
"articleId": "article-id",
"title": "文章标题",
"summary": "文章摘要",
"coverImageUrl": "https://...",
"originalUrl": "https://mp.weixin.qq.com/s/...",
"contentMarkdown": "# Markdown 正文",
"publishedAt": 1705000000000,
"updatedAt": 1705000010000
}
]
}⚠️ 文章列表没有分页字段(无 / / ); 为空即视为本页结束。
totalpagepageSizeitemsmp2rss mp articles <mpId> [-p <page>] [--page-size <n>] [-o json]Query historical articles for an Official Account by mpId.
| Flag | Default | Description |
|---|---|---|
| 1 | Page number |
| 100 | Number of items per page (maximum 100) |
| table | |
bash
mp2rss mp articles 123456
mp2rss mp articles 123456 -p 2 --page-size 100
mp2rss mp articles 123456 -o json | jq '.items[].title'JSON shape:
json
{
"items": [
{
"mpId": 123456,
"articleId": "article-id",
"title": "文章标题",
"summary": "文章摘要",
"coverImageUrl": "https://...",
"originalUrl": "https://mp.weixin.qq.com/s/...",
"contentMarkdown": "# Markdown 正文",
"publishedAt": 1705000000000,
"updatedAt": 1705000010000
}
]
}⚠️ The article list has no pagination fields (no / / ); an empty is treated as the end of the current page.
totalpagepageSizeitemsAgent Usage Notes
Agent Usage Notes
- 解析批量输出统一加
-o json - 是数字(int64):JavaScript / jq 解析时注意精度,必要时用字符串模式读取
mpId - 时间字段均为 unix 毫秒数(number)
- 字段命名统一 camelCase:/
mpId/mpName/mpAvatarUrl/mpLastArticleAt/articleId/originalUrl/contentMarkdownpublishedAt - 订阅参数最常犯的错:用户说「订阅这个公众号 <X>」时,必须是
<X>文章链接。识别不到合法文章 URL 时应先反问用户索要任意一篇文章链接,而不是直接尝试mp.weixin.qq.com/s/... - 取消订阅前应先 确认 mpId,避免误删
mp2rss mp list -q <name> - 文章列表无分页字段,依赖 控制单次返回上限(最大 100);分页继续查下一页用
--page-size-p - 错误 JSON 形态:;
{"error":{"message":"...","code":<int>}}优先用 HTTP 状态码(来自上游),否则回退到 CLI exit code(参数 / 鉴权类错误)code - 限流:服务端每个 Feed Key 60 次/分钟。CLI 自动把相邻请求间隔到 ≥ 1.2s 并按 等待重试一次;仍被拒时 envelope 带
Retry-After、message 含预计解锁时间——不要立刻重试,遍历多个 mpId 时串行调用"kind":"rate_limited" - Exit codes:成功;
0通用错误(网络);1参数错误;2鉴权失败 → 引导用户跑3(参考mp2rss auth loginskill);mp2rss-auth资源不存在(mpId 错或文章 URL 已失效);4上游不可用5
- Always add when parsing batch output
-o json - is a number (int64): watch for precision issues when parsing in JavaScript / jq, and use string mode if necessary
mpId - All time fields are Unix timestamps in milliseconds (number)
- Field names consistently use camelCase: /
mpId/mpName/mpAvatarUrl/mpLastArticleAt/articleId/originalUrl/contentMarkdownpublishedAt - Most common mistake when subscribing: when a user says “Subscribe to this Official Account <X>”, must be an
<X>article link. If a valid article URL cannot be recognized, first ask the user for the link to any article rather than trying immediatelymp.weixin.qq.com/s/... - Before unsubscribing, first run to confirm the mpId and avoid removing the wrong account
mp2rss mp list -q <name> - The article list has no pagination fields, so use to control the maximum number of results returned at once (maximum 100); to continue with the next page, use
--page-size-p - Error JSON shape: ;
{"error":{"message":"...","code":<int>}}should preferentially use the HTTP status code (from upstream), otherwise fall back to the CLI exit code (argument / authentication errors)code - Rate limiting: the server allows 60 requests per minute for each Feed Key. The CLI automatically spaces adjacent requests to ≥ 1.2s and waits and retries once according to ; if the request is still rejected, the envelope includes
Retry-After, and the message contains the estimated unlock time—do not retry immediately; make calls sequentially when iterating over multiple mpIds"kind":"rate_limited" - Exit codes: success;
0generic error (network);1argument error;2authentication failure → guide the user to run3(see themp2rss auth loginskill);mp2rss-authresource not found (incorrect mpId or expired article URL);4upstream unavailable5