Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
WXMP_CDP_URLNoAttach to an already-running Chrome (http://127.0.0.1:9222) instead of launching.
WXMP_OUT_DIRNoScreenshots: login QR, composer, publish evidence, the admin scan page../out
WXMP_SLOW_MONoMilliseconds of delay per Playwright action, for watching a run.0
WXMP_HEADLESSNo1 runs without a window. Not recommended: scanning needs one.0
WXMP_LOG_LEVELNoLogging level; logs go to stderr, never stdout.WARNING
WXMP_HTTP_TOKENNoBearer token for the HTTP transport.
WXMP_TIMEOUT_MSNoDefault action timeout.30000
WXMP_VIEWPORT_HNoWindow height.900
WXMP_VIEWPORT_WNoWindow width.1280
WXMP_PROFILE_DIRNoPlaywright profile holding the login. Secret../.state/profile
WXMP_DEVICE_SCALENoDevice pixel ratio; 2 doubles screenshot resolution.1
WXMP_LOGIN_TIMEOUTNoDefault mp_account_login wait.180
WXMP_BROWSER_CHANNELNoInstalled browser to drive (msedge, chrome). Empty ⇒ bundled Chromium, which needs playwright install chromium.msedge
WXMP_MAX_IMAGE_BYTESNoPer-image size cap.10485760

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

WeChat Official Account (公众号) back-office automation for 贴图 / image messages and 图文 / articles. Call mp_status first: the browser profile keeps the login session, and mp_status reports whether a human needs to scan a QR code with mp_account_login. mp_publish_material is the single entry point for new material: pass kind=tietu or kind=article, a title, a cover image, the body (article bodies may embed a local image with a line that holds only ) and action=draft to keep it or action=publish to submit it straight from the editor. mp_create_tietu stays for multi-image 贴图 galleries. Publishing is never finished by the server alone and always needs confirm=true: after the 发表 dialog the console shows a 扫码 page that the admin must scan with WeChat, the item then lands in 发表记录 about two minutes later, so the tools poll that list and only report verified=true for a NEW msgid. mp_publish_draft and mp_delete_draft are irreversible and also require confirm=true; mp_list_published reads 发表记录 (proof), mp_list_drafts reads 草稿箱. Argument limits are enforced, not advisory: a title is 1-64 characters (one CJK ideograph counts as one) and an empty or longer one is refused with -32602; content (the body, or the 贴图 description) is refused above 50000 characters rather than clipped; a 贴图 description is clipped to 1000 characters and reports desc_clipped=true; an article digest is clipped to 120 and its author to 64; every picture must be an absolute path to an existing png/jpg/jpeg/gif/webp file of at most 10 MB, a 贴图 gallery holds at most 20 pictures including its cover, and a 图文 needs a cover because the console has no local cover upload. Read each tool's description before calling: it lists its own field limits, defaults and reply flags. Login is manual by design: the server only screenshots the QR code and polls the redirect. It never reads cookies, tokens or credentials out of the browser profile.

【中文】公众号后台自动化,面向贴图 / 图片消息和图文 / 文章。先调 mp_status:登录态保存在浏览器 profile 里,mp_status 会说明是否还需要人调 mp_account_login 扫码。mp_publish_material 是新建素材的统一入口:传 kind=tietu 或 kind=article、标题、封面图、正文(图文正文里可以放一整行 来插入本地图片),action=draft 存草稿,action=publish 直接从编辑器发表。多图贴图集仍可用 mp_create_tietu。发表从来不是服务端单独完成的,而且一定需要 confirm=true:发表弹窗之后控制台会出现扫码页,必须由管理员用微信扫,约 2 分钟后内容才落到发表记录;所以这些工具会轮询那张表,只有出现新 msgid 才报 verified=true。mp_publish_draft 和 mp_delete_draft 不可撤销,同样需要 confirm=true;mp_list_published 读发表记录(证据),mp_list_drafts 读草稿箱。参数限制是硬性的,不是建议:标题 1–64 个字符(一个汉字算一个),空标题或超长直接返回 -32602;content(正文或贴图描述)超过 50000 字符直接拒绝,不截断;贴图描述超过 1000 字会被截断并回 desc_clipped=true;图文摘要超过 120 字截断、作者超过 64 字截断;每张图必须是存在的绝对路径、格式为 png/jpg/jpeg/gif/webp、单张不超过 10 MB;贴图图集最多 20 张(含封面);图文必须给封面,因为后台没有本地封面入口。调用前先读对应工具的描述,每个工具自己的字段限制、默认值和回包标志都写在里面。登录按设计只能人工:服务端只截图二维码并轮询跳转,从不读取浏览器 profile 里的 cookie、token 或凭据。

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
mp_statusA

Check whether the WeChat Official Account console session is still valid. Opens the console root in the controlled browser and reports login state, the masked session token, the account nickname when it can be read, and the profile directory in use. Call this before any other mp_* tool.

【中文】检查公众号后台的会话是否仍然有效。在受控浏览器里打开后台首页,回报登录状态、打码后的会话 token、能读到时的账号昵称,以及当前使用的 profile 目录。调用其它任何 mp_* 工具之前,先调它。

mp_account_loginA

Start the QR-code login: opens the console, writes a screenshot of the QR code into the out/ directory and waits for a human to scan it with WeChat. Returns as soon as the console redirects with a session token. The login is manual by design — no credential is ever handled by the server. Limits: timeout_s is 15-600 seconds (default 180); when it runs out the call raises LoginRequired and the reply carries the QR path, so call it again rather than retrying blindly. If the profile already holds a session the call returns immediately with already_logged_in=true.

【中文】启动扫码登录:打开后台、把二维码截图存到 out/ 目录,然后等人用微信扫。控制台一旦带着 session token 跳转就立即返回。登录按设计只能人工完成,服务端从不接触任何凭据。限制:timeout_s 取值 15–600 秒(默认 180);超时会抛 LoginRequired,回包里带二维码路径,所以再调一次即可,不要盲目重试。如果 profile 里已有会话,会立刻返回 already_logged_in=true。

mp_list_draftsA

List the drafts in 草稿箱. Returns draft ids (from each card's data-appid), titles, the 更新于 footer and a state hint. item_show_type=8 selects the 贴图 tab and is honoured while that tab holds drafts; when it is empty the console normalises the value to 0 (文章), so both the requested and the landed value are reported. The ids feed mp_publish_draft and mp_delete_draft. Limits: count is 1-20 (default 10) and only the first page is read, so a busy 草稿箱 needs further calls with a smaller count; ids are integers and must be passed as such, never as a title.

【中文】列出草稿箱里的草稿。返回草稿 id(取自每张卡片的 data-appid)、标题、「更新于」页脚和一个状态提示。item_show_type=8 选贴图标签页,只要该标签页有草稿就生效;该标签页为空时控制台会把值规范成 0(文章),所以请求值和实际落地的值都会报出来。这些 id 供 mp_publish_draft 和 mp_delete_draft 使用。限制:count 取值 1–20(默认 10),且只读第一页,草稿多时要再调一次并换小一点的 count;id 是整数,必须按整数传,不能传标题。

mp_publish_draftA

Publish or schedule an existing draft. IRREVERSIBLE and publicly visible: requires confirm=true, and the human must have approved this exact draft id. Opens the draft in the composer, presses 发表, waits for the confirmation dialog (发表贴图无需开启群发通知 / 定时发表) and presses its 发表 button. action=publish submits now, action=schedule turns on 定时发表 and submits for now+schedule_minutes. After submitting, the console shows a 扫码 page that the admin must scan with WeChat; the item then lands in 发表记录 about two minutes later. verified=true only when a NEW msgid appears in that list, so wait_publish_s controls how long the call polls for it. Limits: appmsgid must be the integer id from mp_list_drafts / mp_publish_material, not the title; kind selects which console tab is used; publishing and deleting need confirm=true and are refused with -32602 before anything is opened.

【中文】发布或定时发布一条已有草稿。不可撤销且公开可见:需要 confirm=true,并且必须由人确认过这个具体的 draft id。它会打开草稿编辑器、点发表、等确认弹窗(发表贴图无需开启群发通知 / 定时发表)再点弹窗里的发表按钮。action=publish 立即提交;action=schedule 打开定时发表,提交到 schedule_minutes 分钟之后。提交后控制台会出现扫码页,必须由管理员用微信扫,约 2 分钟后内容才落到发表记录。只有发表记录里出现「新」msgid 时 verified=true,wait_publish_s 控制轮询多久。硬性要求:appmsgid 必须是 mp_list_drafts / mp_publish_material 返回的整数 id,不是标题;kind 决定用哪个后台标签页;发表和删除都需要 confirm=true,否则在打开任何页面之前就返回 -32602。

mp_delete_draftA

Delete a draft from the 草稿箱. IRREVERSIBLE: requires confirm=true. The console asks 确定删除? in a popover and notes that 删除该内容不会删除已发表的内容, so an already published message stays up — this server cannot recall one. Reports whether the id disappeared from the list afterwards. Limits: appmsgid must be the integer id from mp_list_drafts / mp_publish_material, not the title; kind selects which console tab is used; publishing and deleting need confirm=true and are refused with -32602 before anything is opened.

【中文】从草稿箱删除一条草稿。不可撤销:需要 confirm=true。控制台会用气泡问「确定删除?」,并提示「删除该内容不会删除已发表的内容」,所以已经发出去的内容不会因此下线——本服务也无法召回它。会回报该 id 之后是否从列表里消失。硬性要求:appmsgid 必须是 mp_list_drafts / mp_publish_material 返回的整数 id,不是标题;kind 决定用哪个后台标签页;发表和删除都需要 confirm=true,否则在打开任何页面之前就返回 -32602。

server_healthA

Report server version, supported MCP protocol versions, the registered tools and the browser configuration (profile directory, channel, headless mode, console limits). Use it to diagnose a client that cannot reach the console.

【中文】报告服务版本、支持的 MCP 协议版本、已注册的工具,以及浏览器配置(profile 目录、浏览器通道、无头模式、控制台限制)。客户端连不上后台时用它排查。

mp_publish_materialA

Create one piece of material in the WeChat Official Account console from a title, a cover image and a body, then keep it as a draft or publish it straight from the editor. kind=tietu builds a 贴图 (image message): cover plus any extra images become the gallery, content is the description. kind=article builds a 图文 article: cover is the 封面 chosen through the console's image library (the console has no local cover upload), content is the body, and a line that is just or [[img:/path/to.png]] inserts that local image at that point of the body; author and digest fill 作者 and 摘要. action=draft (default) stops at 草稿箱; action=publish submits from the same editor with the console's own 发表 control, needs confirm=true, and then shows the admin 扫码 page that a human must scan with WeChat. verified=true only when a NEW msgid appears in 发表记录 — for action=publish with wait_publish_s>0 only. Limits, enforced before the browser is touched: • title is required, 1-64 characters as the console counts them (one CJK ideograph is one character); an empty or longer title is rejected with error code -32602 instead of being trimmed. • content is refused above 50000 characters with -32602 (the server's own guard, not a console limit); for tietu it is the description and is clipped to 1000 characters — the reply reports desc_clipped=true; for article it is the body, one paragraph per line, and an inline picture needs a whole line of its own. • author is clipped to 64 characters, digest to 120 — both report clipped/requested_chars. • cover and images must each be a local gif/jpeg/jpg/png/webp file given as an absolute path that exists, at most 10 MB each (raise WXMP_MAX_IMAGE_BYTES to allow bigger files). • for tietu the gallery is cover + images and holds at most 20 pictures; kind=article requires cover, and there images are appended to the body after the text. • action=publish also needs confirm=true and wait_publish_s in 0-900. • kind=article with action=publish is implemented but never submitted against the live console, so treat verified=false there as unproven. Reply fields to branch on: appmsgid (null means no draft id was reported), state=draft|published|pending|unknown, verified, cover_ok (article only; true only when the reopened draft showed the cover), and warning (non-empty means a human should look before publishing).

【中文】用标题、封面图和正文在公众号后台做一份素材,然后存草稿或直接从编辑器发表。kind=tietu 做贴图:封面加上额外图片就是图集,content 是描述。kind=article 做图文:封面走后台的图片库(后台没有本地封面入口),content 是正文,某一行只有 或 [[img:/path/to.png]] 时,就在那里插入这张本地图片;author 和 digest 分别填作者和摘要。action=draft(默认)停在草稿箱;action=publish 用后台自己的发表按钮从同一个编辑器直接提交,需要 confirm=true,之后会出现扫码页,必须由人用微信扫。只有发表记录里出现「新」msgid 才 verified=true——仅限 action=publish 且 wait_publish_s>0 的情况。硬性要求(在碰浏览器之前就校验):• title 必填,1–64 个字符,按后台计数口径(一个汉字算一个);空标题或超长直接返回错误码 -32602,不会悄悄截断。• content:服务端硬上限 50000 个字符;tietu 时是描述,超过 1000 字会被截断,回包给 desc_clipped=true;article 时是正文,一行一段,插图必须单独占一行。• author 超过 64 字截断,digest 超过 120 字截断,回包分别给 clipped / requested_chars。• cover 和 images 里的每一项都必须是本地 gif/jpeg/jpg/png/webp 文件,必须写绝对路径且文件存在,单张最多 10 MB(要更大就调 WXMP_MAX_IMAGE_BYTES)。• tietu 的图集 = cover + images,最多 20 张;kind=article 必须给 cover,images 会接在正文文字之后。• action=publish 还需要 confirm=true,wait_publish_s 取值 0–900。• kind=article 配 action=publish 代码写了但没在真机提交过,那里的 verified=false 只代表未证实。回包该看哪些字段:appmsgid(null 表示没拿到草稿 id)、state=draft|published|pending|unknown、verified、cover_ok(仅图文,只有重开草稿看到封面才为 true)、warning(非空表示发表前该让人看一眼)。

mp_list_publishedA

List 发表记录 (already published items) — NOT the 草稿箱. Read-only. Reads /cgi-bin/appmsgpublish?sub=list and returns the counters (total / publish / masssend), plus per-item msgid, title, public content_url, sent_at, the sent_status counters and msg_status. This is the only honest way to confirm a publish: the composer only shows 「该草稿正在发表」 while the item appears here about two minutes after the admin scan. Limits: count is 1-50 (default 20) and one response is one page; msgid is the integer the other publish tools never return — it is what proves a publish, not the draft's appmsgid.

【中文】列出发表记录(已经发出去的内容)——不是草稿箱。只读。读取 /cgi-bin/appmsgpublish?sub=list,返回计数(total / publish / masssend),以及每条的 msgid、标题、公开链接 content_url、发送时间 sent_at、发送状态计数和 msg_status。这是确认「真的发出去了」唯一可靠的方式:编辑器里只会显示「该草稿正在发表」,而内容要等管理员扫码后约 2 分钟才会出现在这里。限制:count 取值 1–50(默认 20),一次响应就是一页;msgid 是整数,别和草稿的 appmsgid 搞混——证明发表的是 msgid。

mp_create_tietuA

Create a 贴图 (image message) in the WeChat Official Account console: upload one or more local PNG/JPEG images, write the title and the description, save it as a DRAFT, and optionally publish or schedule it in the same call. action=draft (default) stops at the draft; action=publish submits it immediately; action=schedule submits it for now+schedule_minutes. Publishing is irreversible and publicly visible, so it needs confirm=true, and the console then shows a 扫码 page the human must scan with WeChat before the message goes out. verified=true only once a new entry appears in 发表记录. Limits, enforced before the browser is touched: • images is required, 1-20 files, each a local gif/jpeg/jpg/png/webp file given as an absolute path that exists, at most 10 MB each (raise WXMP_MAX_IMAGE_BYTES to allow bigger files); the first one becomes the cover. • title is required, 1-64 characters; empty or longer is rejected with -32602. • description is clipped to 1000 characters and the reply reports desc_clipped=true; the console's own counter is returned as desc_counter and is not a 1:1 character count. • action=publish or action=schedule needs confirm=true. • schedule_minutes is 1-10080, but the time picker only offers today, so a large value cannot be honoured — keep it within the same day. Reply fields: appmsgid, state, verified (a NEW msgid in 发表记录), warning.

【中文】在公众号后台创建一条贴图:上传 1–20 张本地 PNG/JPEG 图片、写入标题和描述、存成草稿,并可在同一次调用里直接发布或定时发布。action=draft(默认)停在草稿;action=publish 立即提交;action=schedule 提交到 schedule_minutes 分钟之后。发布不可撤销且公开可见,需要 confirm=true;随后控制台会出现扫码页,必须由管理员用微信扫过,内容才会发出去。只有发表记录里出现新条目,verified 才会是 true。硬性要求(在碰浏览器之前就校验):• images 必填,1–20 个文件,每个都要是本地 gif/jpeg/jpg/png/webp 文件,必须写绝对路径且文件存在,单张最多 10 MB(要更大就调 WXMP_MAX_IMAGE_BYTES);第一张作封面。• title 必填,1–64 个字符;空或超长返回 -32602。• description 超过 1000 字截断,回包给 desc_clipped=true;控制台自己的计数以 desc_counter 返回,它和字数不是 1:1。• action=publish 或 action=schedule 需要 confirm=true。• schedule_minutes 范围 1–10080,但时间选择器只提供今天,所以太大的值无法兑现——请控制在同一天内。回包字段:appmsgid、state、verified(发表记录里出现新 msgid)、warning。

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 9 tools

Disambiguation3/5

Most tools are distinct (status, login, list_drafts, publish_draft, delete_draft, list_published), but mp_create_tietu and mp_publish_material(kind=tietu) largely do the same thing — create an image message draft from a title, description and images — with only subtle differences (extra images, article support). An agent could easily pick the wrong one, and the extremely verbose descriptions add noise rather than cleanly separating them.

Naming Consistency4/5

Nearly all tools follow an mp_ + verb_noun snake_case convention (mp_list_drafts, mp_publish_draft, mp_delete_draft, mp_list_published). Deviations are minor: mp_status uses no verb, mp_account_login is noun-based, and server_health drops the mp_ prefix, but the overall pattern stays readable.

Tool Count4/5

At 9 tools the set is well within a reasonable scope for a WeChat console automation server, and each covers a lifecycle step. The only blemish is that mp_create_tietu is essentially a narrower duplicate of mp_publish_material(kind=tietu), so one tool arguably doesn't earn its separate place.

Completeness4/5

The lifecycle is well covered: session check, QR login, list/create/publish/delete drafts, create material (tietu and article), and verify publishes via 发表记录. The main gap is there is no update/edit-draft tool, so an agent cannot modify an existing draft's content without deleting and recreating it.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues