WeCom Document Assistant: Reading and Writing doc.weixin.qq.com via MCP

Preface

When team collaborative documents are hosted on WeCom (Enterprise WeChat) online docs, the common practice is to manually open the link, copy tables or paragraphs, and paste them back into the conversation for AI to analyze or rewrite. These links reside at doc.weixin.qq.com. Since there is no official Agent-facing read/write API, automation often stops at “screenshot + OCR” or semi-manual exports.

Here we introduce the “WeCom Document All-in-One Assistant skill” on SkillHub (located at @user_5f5835e5/wecom-doc-skill, current version 1.0.17). It packages the source code and installation scripts for the WeCom Document MCP service into a Skill. Once installed, it uses Playwright to drive a browser for QR code login and utilizes MCP tools to read, write, and screenshot online documents, eliminating the need to manually git clone the repository.

What is this

In one sentence: A Skill serving as a guide for installing and using the WeCom online document MCP service for AI Agents.

  • Distribution Channel: A SkillHub community skill, categorized under office-efficiency, published by user_5f5835e5. The page is marked with requires_api_key=false, meaning it does not rely on additional API Keys.
  • Problem Solved: Allows Agents within MCP-compatible clients (such as Cursor, CodeBuddy, Windsurf, and Claude Desktop) to process doc.weixin.qq.com links—reading tables, appending to documents, editing tables by cell, and performing read-only extraction or screenshots for slides and mind maps.
  • Implementation: The Skill embeds source/ and scripts/setup.sh. It installs the service to ~/wecom-doc-mcp and registers an MCP Server named wecom-doc (started via node src/index.js).

Core Functions

The following capabilities are derived from the Skill’s bundled SKILL.md and references/tool_reference.md.

Document Types

URL Path Type Read Write
/doc/ Online Document Supported Supports appending plain text to the end
/sheet/ Online Spreadsheet Supported Supports cell writing
/smartsheet/ Smart Sheet Supported Supports cell writing
/slide/ Presentation Text + Screenshot Not Supported
/mindmap/ Mind Map Nodes + Screenshot Not Supported
/flowchart/ Flowchart Text + Screenshot Not Supported

MCP Tools

Tool Function
wecom_doc_login Launches browser for WeCom QR code login
wecom_doc_status Checks if the login session is valid
wecom_doc_fetch Reads document/spreadsheet content; tab can be passed for spreadsheets to specify a worksheet
wecom_doc_screenshot Takes a screenshot of the document page
wecom_doc_write Appends text to the end of a /doc/ document (supports \n)
wecom_doc_write_sheet Writes to specific cells in a spreadsheet; mode is append or overwrite

Runtime Environment Requirements (Skill Metadata): Node.js 18+, Desktop Environment required for the first QR code scan; supports macOS and Linux; Playwright Chromium is automatically installed by the installation script.

Installation and Activation

1. Install the Skill on SkillHub

First, prepare the skillhub CLI according to the SkillHub Installation Instructions (you can execute the official installation script if it is not installed). When installing the skill, use --dir to point to the current Agent’s skills directory (e.g., for Cursor, it is ~/.cursor/skills/):

skillhub install @user_5f5835e5/wecom-doc-skill --dir ~/.cursor/skills/

Alternatively, on the SkillHub skill page, send the prompt to the AI: “Please install @user_5f5835e5/wecom-doc-skill according to https://skillhub.cn/install/skillhub.md.”

Once installed, the Agent will load the decision workflow defined in the Skill’s SKILL.md.

2. Install the MCP Service (First-time Use of WeCom Document Capabilities)

The Skill requires the Agent to check if ~/wecom-doc-mcp is installed before the user uses document features:

test -f ~/wecom-doc-mcp/package.json && echo "Installed" || echo "Not Installed"

If not installed, execute the bundled script within the Skill directory (the path depends on your local extraction location):

bash scripts/setup.sh

The script will: copy the built-in source/ to ~/wecom-doc-mcp → npm install → npx playwright install chromium → detect local AI tools and write MCP configuration. The default installation directory can be overridden via bash setup.sh [install_dir].

After successful installation, you must restart the AI client (fully exit and reopen), otherwise the MCP tools may not be available.

3. MCP Configuration (Manual Backup)

If automatic configuration fails, you can add the following to the corresponding tool’s MCP configuration (change args to the absolute path of index.js on your machine):

"wecom-doc": {
    "command": "node",
    "args": ["/Users/yourname/wecom-doc-mcp/src/index.js"],
    "timeout": 180000
}

Configuration file locations provided in the Skill documentation include:

AI Tool Configuration Path
Cursor ~/.cursor/mcp.json
CodeBuddy ~/.codebuddy/mcp.json
Claude Desktop ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
Windsurf ~/.codeium/windsurf/mcp_config.json
VS Code (Copilot) Project-level .vscode/mcp.json

If the above directories are not detected, setup.sh defaults to writing to CodeBuddy’s mcp.json.

4. Login

After restarting and initiating a WeCom document-related request, the Agent should first call wecom_doc_status; if not logged in, call wecom_doc_login and scan the QR code with WeCom in the popped-up browser. Cookie validity is approximately several days; if expired, repeat the same login process. Backup command for terminal:

cd ~/wecom-doc-mcp && npm run login

Typical Usage

The following examples are consistent with the official tool reference to facilitate reproduction in conversations.

Read the Entire Spreadsheet

The user provides https://doc.weixin.qq.com/sheet/e3_xxx. The Agent calls wecom_doc_fetch with the full url; the returned sheetList contains the list of worksheets, and sheets contains the data.

Read a Specific Worksheet

First, call wecom_doc_fetch without tab to get the tab IDs for each sheet in sheetList, then read the specific sheet (e.g., “Project Schedule”) with the tab parameter.

Append Paragraph to End of Document

Call wecom_doc_write for /doc/ links, passing url and content (plain text only; rich text or middle insertion is not supported).

Write to Spreadsheet Cell

wecom_doc_write_sheet(url=..., cell="A5", content="Done", mode="overwrite")

Batch Append a Row

First, use wecom_doc_fetch to confirm the row number N of the last row, then perform wecom_doc_write_sheet cell by cell for A{N+1}, B{N+1}, etc., using overwrite for mode; verify by fetching again after completion.

Screenshot of Presentation

Call wecom_doc_screenshot for /slide/ and similar links; output_path is optional.

When a tool returns “Not logged in or login expired,” call wecom_doc_login first, then retry the original operation after successful login.

Use Cases and Notes

Who is it for

  • Teams that collaborate daily in WeCom documents and online spreadsheets and want Cursor / CodeBuddy etc. Agents to directly read tables, write cells, and append meeting minutes.
  • Developers willing to run Node + Playwright locally and accept the first-time QR code login.

Limitations and Notes

  • Relies on browser automation; table writing is a cell-by-cell operation, so large-scale writes will be slow; type_delay / line_delay can adjust the input rhythm.
  • doc writing is limited to appending to the end; slide / mindmap / flowchart are read-only.
  • Document permissions are still controlled by the WeCom side; if the page does not finish loading, the table may appear empty, requiring a retry or permission check.
  • The SkillHub page provides the maintainer’s WeChat tbj18234127547 for private problem discussions; the Skill’s MIT-licensed source code author is marked as baojiantang, and the upstream repository is git.woa.com/baojiantang/wecom-doc-mcp (installing this Skill does not force access to this repository).

SkillHub Statistics (based on the skill page and crawl data): Rating 100000, Downloads approx. 21735, Installations 72.

Conclusion

The “WeCom Document All-in-One Assistant” consolidates “Installing MCP + QR Code Login + Reading/Writing doc.weixin.qq.com” into a single Skill workflow: first install @user_5f5835e5/wecom-doc-skill, then run setup.sh, restart the client, and simply drop links in natural language to let the Agent call MCP tools.

  • SkillHub Skill Page: https://www.skillhub.cn/skills/user_5f5835e5/wecom-doc-skill
  • API Coordinate Page: https://api.skillhub.cn/user_5f5835e5/wecom-doc-skill
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye