md2wechat-mcp
v0.3.1Markdown to WeChat HTML MCP server (Node.js)
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
convert_markdown_to_wechat_html
Convert Markdown to WeChat-friendly HTML. Output mapping: content[0].text is article HTML; meta.cacheHtmlPath is the cached file path for open_wechat_html_in_browser.cacheHtmlPath.
| Parameter | Type | Description |
|---|---|---|
access_token | string | WeChat API access token. When provided, local images referenced as  are automatically uploaded to WeChat CDN and replaced with permanent URLs. |
font_size_preset | string | Font size preset: small | medium | large |
markdown | string | Source markdown text. If both markdown and markdown_path are provided, markdown is used. |
markdown_path | string | Local markdown file path. Use this to avoid sending full content through tokens. |
theme | string | Theme name. Available: default | tech | warm | apple | wechat-native | refined-blue | business-navy | sage-premium | minimal-mono | minimal-bw | academic-paper | news-bold | warm-editorial | ink-wash… |
list_wechat_themes
List available rendering themes.
open_wechat_html_in_browser
Open cached HTML in browser for manual copy workflows. Pass convert_markdown_to_wechat_html result meta.cacheHtmlPath; do not guess temp paths.
| Parameter | Type | Description |
|---|---|---|
cacheHtmlPath * | string | Use convert_markdown_to_wechat_html returned meta.cacheHtmlPath directly |
wechat_get_access_token
Get WeChat API access_token. Reads AppID and AppSecret from environment variables WECHAT_APPID and WECHAT_APPSECRET. The token is valid for 7200 seconds.
wechat_draft_add
Add a new draft to WeChat Official Account draft box. articles[].content must be HTML from convert_markdown_to_wechat_html content[0].text.
| Parameter | Type | Description |
|---|---|---|
access_token * | string | WeChat API access token from wechat_get_access_token |
articles * | array | Array of articles to include in the draft (usually 1) |
wechat_markdown_to_draft
One-shot tool: convert markdown to WeChat HTML and create draft. Cover is handled automatically (title=封面 preferred, else first local JPG/JPEG).
| Parameter | Type | Description |
|---|---|---|
access_token * | string | WeChat API access token from wechat_get_access_token |
article_title | string | Draft article title. Fallback: first markdown H1, then markdown file name. |
author | string | Author name |
content_source_url | string | Original article URL |
digest | string | Article summary |
font_size_preset | string | Font size preset: small | medium | large |
markdown | string | Source markdown text. If both markdown and markdown_path are provided, markdown is used. |
markdown_path | string | Local markdown file path |
need_open_comment | Enable comments: 1=yes, 0=no | |
only_fans_can_comment | Only followers can comment: 1=yes, 0=no | |
theme | string | Theme name. Available: default | tech | warm | apple | wechat-native | refined-blue | business-navy | sage-premium | minimal-mono | minimal-bw | academic-paper | news-bold | warm-editorial | ink-wash… |
thumb_media_id | string | Optional explicit thumb media id override. |
wechat_draft_update
Update an existing draft in WeChat Official Account draft box by media_id. The leading <h1> in article.content is removed automatically; local <img src> paths are auto-uploaded and replaced with WeChat URLs.
| Parameter | Type | Description |
|---|---|---|
access_token * | string | WeChat API access token from wechat_get_access_token |
article * | object | Updated article content |
media_id * | string | Draft media_id returned from wechat_draft_add |
base_dir | string | Base directory for resolving relative local image paths in article.content (defaults to current working directory). |
index | integer | 0-based index of article to update within the draft |
wechat_upload_image
Upload a local JPG/PNG image (max 1MB) to WeChat for use in article content. Returns a permanent image URL. Does not count toward the 100,000 material limit.
| Parameter | Type | Description |
|---|---|---|
access_token * | string | WeChat API access token from wechat_get_access_token |
file_path * | string | Absolute local path to the image file (JPG or PNG, max 1MB) |
wechat_add_material
Upload permanent material to WeChat material library (image/voice/video/thumb). Returns media_id and image url when type=image.
| Parameter | Type | Description |
|---|---|---|
access_token * | string | WeChat API access token from wechat_get_access_token |
file_path * | string | Absolute local file path |
type * | string | Permanent material type |
introduction | string | Video introduction. Required when type=video |
title | string | Video title. Required when type=video |
wechat_draft_batchget
Query draft list from WeChat Official Account draft box with pagination.
| Parameter | Type | Description |
|---|---|---|
access_token * | string | WeChat API access token from wechat_get_access_token |
count | integer | Number of drafts to return (1-20) |
no_content | 1 = exclude article content field to reduce response size, 0 = include (default) | |
offset | integer | Starting offset (0 = first item) |
wechat_draft_delete
Delete a draft from WeChat Official Account draft box by media_id. This action is irreversible.
| Parameter | Type | Description |
|---|---|---|
access_token * | string | WeChat API access token from wechat_get_access_token |
media_id * | string | Draft media_id to delete |