Skip to main content
Glama

📄 wecom-doc-mcp

Let AI read your Enterprise WeChat docs — in real time.

MCP Node TypeScript License

English · 中文


🤔 Why

Enterprise WeChat documents sit behind SSO. AI assistants can't access them.

This MCP server bridges the gap: provide your browser cookie once, and the server handles authenticated fetching + HTML-to-Markdown conversion on every request.

💬 "帮我看下这个文档: https://doc.weixin.qq.com/doc/w3_xxx"
         │
         ▼
   ┌─────────────┐     🍪      ┌──────────────┐     📝     ┌──────────┐
   │ Claude Code  │ ──Cookie──▶ │  MCP Server   │ ──HTML──▶ │ Markdown │
   └─────────────┘             └──────────────┘            └──────────┘

Related MCP server: feishu-reader

🛠️ Tools

Tool

Description

📖 fetch_wecom_doc

Fetch a document by URL → return Markdown

🍪 set_wecom_cookie

Save cookie locally (chmod 600)

✅ check_wecom_auth

Verify if saved cookie is still valid

🚀 Quick Start

Step 1 — Install

git clone https://github.com/Tiansiyu-tj/wecom-doc-mcp.git
cd wecom-doc-mcp
npm install

Step 2 — Register with Claude Code

Add to ~/.mcp.json:

{
  "mcpServers": {
    "wecom-doc": {
      "command": "npx",
      "args": ["tsx", "/path/to/wecom-doc-mcp/src/index.ts"]
    }
  }
}
1. 🌐  Open doc.weixin.qq.com → log in
2. 🔧  F12 → Network tab
3. 📋  Click any request → copy the Cookie header value

Step 4 — Use It

You:    帮我设置企业微信 Cookie: <paste>
Claude: ✅ Cookie 已保存

You:    帮我看下这个文档: https://doc.weixin.qq.com/doc/w3_xxx
Claude: # 文档标题
        这是文档的内容...

📐 Architecture

                          wecom-doc-mcp
                    ┌─────────────────────┐
                    │                     │
  fetch_wecom_doc ──┤  📡 /dop-api/opendoc│
        │           │  Call WeChat's       │
        │           │  internal API for    │──── 📝 Markdown
        │           │  document JSON data  │
        │           │                     │
        │           │  🧹 cleanDocText    │
        │           │  Strip HYPERLINK     │
        │           │  markup → clean text │
        │           │                     │
        │           │  📄 Fallback:       │
        │           │  cheerio + turndown  │
        │           └─────────────────────┘
        │
  set_wecom_cookie ─── 💾 ~/.claude/wecom-doc-mcp/.env (mode 600)
        │
  check_wecom_auth ─── 🏥 GET doc.weixin.qq.com → 200?

Two modes, your choice:

Mode

How

When

💾 Persistent

set_wecom_cookie → saved to ~/.claude/wecom-doc-mcp/.env

Set once, use forever (until expiry)

⚡ Per-request

Pass cookie param to fetch_wecom_doc

Override on the fly

🔒 Cookie file lives outside the project directory — never committed, never shared, chmod 600.

📑 Supported Document Types

Type

URL Pattern

Status

📝 Documents

/doc/

✅ Verified

📊 Spreadsheets

/sheet/

🔧 Untested

🎞️ Slides

/slide/

🔧 Untested

🧠 Mind Maps

/mind/

✅ Verified

🔀 Flowcharts

/flowchart/

🔧 Untested

📋 Smart Sheets

/smartsheet/

🔧 Untested

📦 Tech Stack

Dependency

Purpose

@modelcontextprotocol/sdk

MCP protocol implementation

cheerio

HTML parsing

turndown

HTML → Markdown conversion

tsx

TypeScript runtime

📄 License

MIT


Available Tools

3 tools
check_wecom_authA

检查当前保存的 Cookie 是否仍然有效

Inputs: no named parameters.

fetch_wecom_docA

抓取企业微信文档内容并转为 Markdown。支持文档、表格、幻灯片等类型。

Inputs: url (required), cookie.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a distinct purpose: fetching document content, saving authentication credentials, and verifying authentication validity. No overlap or ambiguity between them.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case: fetch_wecom_doc, set_wecom_cookie, check_wecom_auth.

    Tool Count5/5

    With 3 tools, the server is well-scoped for its purpose of fetching WeCom documents with authentication management. Each tool earns its place.

    Completeness4/5

    The set covers authentication setup, validation, and document fetching. A minor gap is the lack of a tool to list or search documents, but the core workflow is complete for fetching known documents.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables reading and extracting content from WeChat public account articles using browser automation, allowing AI models to analyze and summarize WeChat articles through natural language requests.
      463
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides retrieval of WeChat Work and Feishu developer documentation, enabling AI assistants to query API references without switching browsers.
      20 npm
      19
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to manage Yuque (语雀) documents via MCP protocol, with cookie-based login that does not require a super membership.
      17 npm
      4
      MIT