md2wechat-mcp

v0.3.1
md2wechat-mcp Checked 1 day ago Published 1 month ago

Markdown 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.

ParameterTypeDescription
access_tokenstringWeChat API access token. When provided, local images referenced as ![alt](./path) are automatically uploaded to WeChat CDN and replaced with permanent URLs.
font_size_presetstringFont size preset: small | medium | large
markdownstringSource markdown text. If both markdown and markdown_path are provided, markdown is used.
markdown_pathstringLocal markdown file path. Use this to avoid sending full content through tokens.
themestringTheme 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.

ParameterTypeDescription
cacheHtmlPath *stringUse 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.

ParameterTypeDescription
access_token *stringWeChat API access token from wechat_get_access_token
articles *arrayArray 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).

ParameterTypeDescription
access_token *stringWeChat API access token from wechat_get_access_token
article_titlestringDraft article title. Fallback: first markdown H1, then markdown file name.
authorstringAuthor name
content_source_urlstringOriginal article URL
digeststringArticle summary
font_size_presetstringFont size preset: small | medium | large
markdownstringSource markdown text. If both markdown and markdown_path are provided, markdown is used.
markdown_pathstringLocal markdown file path
need_open_commentEnable comments: 1=yes, 0=no
only_fans_can_commentOnly followers can comment: 1=yes, 0=no
themestringTheme 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_idstringOptional 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.

ParameterTypeDescription
access_token *stringWeChat API access token from wechat_get_access_token
article *objectUpdated article content
media_id *stringDraft media_id returned from wechat_draft_add
base_dirstringBase directory for resolving relative local image paths in article.content (defaults to current working directory).
indexinteger0-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.

ParameterTypeDescription
access_token *stringWeChat API access token from wechat_get_access_token
file_path *stringAbsolute 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.

ParameterTypeDescription
access_token *stringWeChat API access token from wechat_get_access_token
file_path *stringAbsolute local file path
type *stringPermanent material type
introductionstringVideo introduction. Required when type=video
titlestringVideo title. Required when type=video

wechat_draft_batchget

Query draft list from WeChat Official Account draft box with pagination.

ParameterTypeDescription
access_token *stringWeChat API access token from wechat_get_access_token
countintegerNumber of drafts to return (1-20)
no_content1 = exclude article content field to reduce response size, 0 = include (default)
offsetintegerStarting offset (0 = first item)

wechat_draft_delete

Delete a draft from WeChat Official Account draft box by media_id. This action is irreversible.

ParameterTypeDescription
access_token *stringWeChat API access token from wechat_get_access_token
media_id *stringDraft media_id to delete