mp2rss-mp

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

mp2rss-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
    二进制已安装(参考
    mp2rss-auth
    的 Prerequisites)
  • 已登录:
    mp2rss auth status
    显示
    loggedIn: true
    (首次使用先跑
    mp2rss auth login
    )
  • The
    mp2rss
    binary is installed (see the Prerequisites of
    mp2rss-auth
    )
  • You are logged in:
    mp2rss auth status
    displays
    loggedIn: true
    (on first use, run
    mp2rss auth login
    )

Commands

Commands

List subscriptions

List subscriptions

mp2rss mp list [-q <keyword>] [-p <page>] [--page-size <n>] [-o json]
FlagDefaultDescription
-q, --query
—按公众号名模糊搜索
-p, --page
1页码
--page-size
20每页条数(最大 50)
-o, --output
table
table
/
json
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]
FlagDefaultDescription
-q, --query
—Fuzzy-search by Official Account name
-p, --page
1Page number
--page-size
20Number of items per page (maximum 50)
-o, --output
table
table
/
json
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>
的语法糖,flag 集与输出与
list
一致。
bash
mp2rss mp search 财经
mp2rss mp search 财经 -o json

mp2rss mp search <keyword> [-p <page>] [--page-size <n>] [-o json]
This is syntactic sugar for
mp2rss mp list -q <keyword>
, with the same flags and output as
list
.
bash
mp2rss mp search 财经
mp2rss mp search 财经 -o json

Subscribe a WeChat MP

Subscribe to a WeChat Official Account

mp2rss mp subscribe <article-url> [-o json]
⚠️ 传入的是文章 URL(
https://mp.weixin.qq.com/s/...
),不是公众号名、不是二维码、也不是公众号主页链接。从公众号任意一篇文章里复制链接即可,Mp2rss 会从该文章解析出所属公众号并把整个公众号订阅到你的 Feed。
bash
mp2rss mp subscribe https://mp.weixin.qq.com/s/abcDEFghIJKlmnop
mp2rss mp subscribe https://mp.weixin.qq.com/s/abc -o json
JSON shape:
json
{
  "ok": true,
  "articleUrl": "https://mp.weixin.qq.com/s/..."
}

mp2rss mp subscribe <article-url> [-o json]
⚠️ Pass an article URL (
https://mp.weixin.qq.com/s/...
), 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.
bash
mp2rss mp subscribe https://mp.weixin.qq.com/s/abcDEFghIJKlmnop
mp2rss mp subscribe https://mp.weixin.qq.com/s/abc -o json
JSON shape:
json
{
  "ok": true,
  "articleUrl": "https://mp.weixin.qq.com/s/..."
}

Unsubscribe

Unsubscribe

mp2rss mp remove <mpId> [-y] [-o json]
按 mpId 取消订阅。
-y
跳过交互式确认(适合脚本调用)。
bash
mp2rss mp remove 123456
mp2rss mp remove 123456 -y
mp2rss mp remove 123456 -y -o json
JSON shape:
json
{
  "ok": true,
  "mpId": 123456
}
mpId 从
mp2rss mp list -o json
的
items[].mpId
获取。

mp2rss mp remove <mpId> [-y] [-o json]
Unsubscribe by mpId.
-y
skips the interactive confirmation (suitable for scripted calls).
bash
mp2rss mp remove 123456
mp2rss mp remove 123456 -y
mp2rss mp remove 123456 -y -o json
JSON shape:
json
{
  "ok": true,
  "mpId": 123456
}
Obtain the mpId from
items[].mpId
in
mp2rss mp list -o json
.

List articles of a MP

List articles of an Official Account

mp2rss mp articles <mpId> [-p <page>] [--page-size <n>] [-o json]
按公众号 mpId 查历史文章。
FlagDefaultDescription
-p, --page
1页码
--page-size
100每页条数(最大 100)
-o, --output
table
table
/
json
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
    }
  ]
}
⚠️ 文章列表没有分页字段(无
total
/
page
/
pageSize
);
items
为空即视为本页结束。

mp2rss mp articles <mpId> [-p <page>] [--page-size <n>] [-o json]
Query historical articles for an Official Account by mpId.
FlagDefaultDescription
-p, --page
1Page number
--page-size
100Number of items per page (maximum 100)
-o, --output
table
table
/
json
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
total
/
page
/
pageSize
); an empty
items
is treated as the end of the current page.

Agent Usage Notes

Agent Usage Notes

  • 解析批量输出统一加
    -o json
  • mpId
    是数字(int64)
    :JavaScript / jq 解析时注意精度,必要时用字符串模式读取
  • 时间字段均为 unix 毫秒数(number)
  • 字段命名统一 camelCase:
    mpId
    /
    mpName
    /
    mpAvatarUrl
    /
    mpLastArticleAt
    /
    articleId
    /
    originalUrl
    /
    contentMarkdown
    /
    publishedAt
  • 订阅参数最常犯的错:用户说「订阅这个公众号 <X>」时,
    <X>
    必须是
    mp.weixin.qq.com/s/...
    文章链接。识别不到合法文章 URL 时应先反问用户索要任意一篇文章链接,而不是直接尝试
  • 取消订阅前应先
    mp2rss mp list -q <name>
    确认 mpId,避免误删
  • 文章列表无分页字段,依赖
    --page-size
    控制单次返回上限(最大 100);分页继续查下一页用
    -p
  • 错误 JSON 形态:
    {"error":{"message":"...","code":<int>}}
    ;
    code
    优先用 HTTP 状态码(来自上游),否则回退到 CLI exit code(参数 / 鉴权类错误)
  • 限流:服务端每个 Feed Key 60 次/分钟。CLI 自动把相邻请求间隔到 ≥ 1.2s 并按
    Retry-After
    等待重试一次;仍被拒时 envelope 带
    "kind":"rate_limited"
    、message 含预计解锁时间——不要立刻重试,遍历多个 mpId 时串行调用
  • Exit codes:
    0
    成功;
    1
    通用错误(网络);
    2
    参数错误;
    3
    鉴权失败 → 引导用户跑
    mp2rss auth login
    (参考
    mp2rss-auth
    skill);
    4
    资源不存在(mpId 错或文章 URL 已失效);
    5
    上游不可用
  • Always add
    -o json
    when parsing batch output
  • mpId
    is a number (int64)
    : watch for precision issues when parsing in JavaScript / jq, and use string mode if necessary
  • All time fields are Unix timestamps in milliseconds (number)
  • Field names consistently use camelCase:
    mpId
    /
    mpName
    /
    mpAvatarUrl
    /
    mpLastArticleAt
    /
    articleId
    /
    originalUrl
    /
    contentMarkdown
    /
    publishedAt
  • Most common mistake when subscribing: when a user says “Subscribe to this Official Account <X>”,
    <X>
    must be an
    mp.weixin.qq.com/s/...
    article link. If a valid article URL cannot be recognized, first ask the user for the link to any article rather than trying immediately
  • Before unsubscribing, first run
    mp2rss mp list -q <name>
    to confirm the mpId and avoid removing the wrong account
  • The article list has no pagination fields, so use
    --page-size
    to control the maximum number of results returned at once (maximum 100); to continue with the next page, use
    -p
  • Error JSON shape:
    {"error":{"message":"...","code":<int>}}
    ;
    code
    should preferentially use the HTTP status code (from upstream), otherwise fall back to the CLI exit code (argument / authentication errors)
  • 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
    Retry-After
    ; if the request is still rejected, the envelope includes
    "kind":"rate_limited"
    , and the message contains the estimated unlock time—do not retry immediately; make calls sequentially when iterating over multiple mpIds
  • Exit codes:
    0
    success;
    1
    generic error (network);
    2
    argument error;
    3
    authentication failure → guide the user to run
    mp2rss auth login
    (see the
    mp2rss-auth
    skill);
    4
    resource not found (incorrect mpId or expired article URL);
    5
    upstream unavailable