WeChat Local

v1.0.0Communicationstable

WeChat/微信 local chat history MCP server for macOS agents. Read messages, contacts, media, favorites, transfers, red packets, Moments and full-text search from local WeChat 4.x data.

agentsai-agentschat-historyclaude-codecodex
Share:
28
Stars
0
Downloads
0
Weekly
0/5

What is WeChat Local?

WeChat Local is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to wechat/微信 local chat history mcp server for macos agents. read messages, contacts, media, favorites, transfers, red packets, moments and full-text search from local wechat 4.x data.

WeChat/微信 local chat history MCP server for macOS agents. Read messages, contacts, media, favorites, transfers, red packets, Moments and full-text search from local WeChat 4.x data.

This server falls under the Communication category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • WeChat/微信 local chat history MCP server for macOS agents. Re

Use Cases

Read local WeChat message history, contacts, and media on macOS.
Search and retrieve Moments posts from local WeChat data.
Access Red Packets and transfer information for local analysis.
r266-tech

Maintainer

LicenseMIT
Languagego
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx wechat-local

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use WeChat Local

WeChat Local MCP Server provides read-only access to your local WeChat (微信) 4.x chat history on macOS and Windows, exposing messages, contacts, group info, media files, Moments (friend feeds), red packets, transfers, and favorites directly to AI agents. It uses a CLI binary that decrypts and reads the local WeChat SQLite database without modifying any data or sending messages. Developers and power users can use it to search, export, and analyze their own WeChat history without relying on WeChat's limited export features.

Prerequisites

  • macOS arm64 with WeChat 4.x installed and logged in, or Windows amd64 with WeChat/Weixin 4.x
  • WeChat must be running with at least one chat opened so the database key can be read
  • On macOS 15+, add the wechat-cli binary to Full Disk Access in System Settings to reduce privacy prompts
  • An MCP-compatible client such as Claude Desktop or Claude Code
  • The wechat-cli binary installed via the provided install script
1

Install the wechat-cli binary

Run the official install script for your platform. On macOS it installs to ~/.local/bin/; on Windows to %LOCALAPPDATA%\Microsoft\WindowsApps\.

# macOS
curl -fsSL https://raw.githubusercontent.com/r266-tech/wechat-cli/main/scripts/install-release.sh | zsh

# Windows PowerShell
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/r266-tech/wechat-cli/main/scripts/install-release.ps1 | iex"
2

Bootstrap key extraction

Run the bootstrap command while WeChat is open to extract and cache the database decryption key. This must be done once before the MCP server can function.

~/.local/share/wechat-cli/wxkey bootstrap
3

Verify the CLI works

Test that the binary can read your WeChat sessions. You should see a list of recent chats in JSON.

~/.local/bin/wechat-cli sessions --limit 5 --pretty
4

Add the MCP server to your client config

Configure Claude Desktop or another MCP client to launch the wechat-local MCP server using npx. The server wraps the wechat-cli binary and exposes its capabilities over the MCP protocol.

{
  "mcpServers": {
    "wechat-local": {
      "command": "npx",
      "args": ["wechat-local"],
      "env": {
        "WECHAT_CLI_STRICT_READ_ONLY": "1"
      }
    }
  }
}
5

Optional: configure environment variables

Set optional environment variables to control behavior. WECHAT_CLI_STRICT_READ_ONLY enforces read-only mode; WECHAT_CLI_DB_ROOT overrides the database location on Windows; WECHAT_CLI_KEY_SCAN_TIMEOUT adjusts key discovery timeout for slow machines.

# Example: point to a custom DB root on Windows
set WECHAT_CLI_DB_ROOT=C:\Users\You\Documents\WeChat Files\wxid_xxx\db_storage
6

Restart your MCP client and test

Restart Claude Desktop (or your chosen client) after editing the config. Ask Claude to list your recent WeChat sessions or search your chat history to confirm the server is connected.

WeChat Local Examples

Client configuration

Add this block to your claude_desktop_config.json to enable the WeChat Local MCP server with strict read-only mode.

{
  "mcpServers": {
    "wechat-local": {
      "command": "npx",
      "args": ["wechat-local"],
      "env": {
        "WECHAT_CLI_STRICT_READ_ONLY": "1"
      }
    }
  }
}

Prompts to try

Example prompts to use once the server is connected in your MCP client.

- "Show me my 10 most recent WeChat conversations"
- "Search my WeChat history for messages about the project deadline"
- "List all media files shared in my WeChat group 'Family'"
- "Show me my WeChat Moments feed from last week"
- "Find all red packet records from this year"

Troubleshooting WeChat Local

Key extraction fails or returns no key

Make sure WeChat is running and you have at least one chat open before running 'wxkey bootstrap'. On macOS 15+, add the wechat-cli binary to Full Disk Access in System Settings > Privacy & Security.

Database not found on Windows

Set the WECHAT_CLI_DB_ROOT environment variable to point to your WeChat account folder containing the db_storage directory, e.g. C:\Users\You\Documents\WeChat Files\wxid_xxx\.

Key scan times out on a slow machine

Set WECHAT_CLI_KEY_SCAN_TIMEOUT=5m (or a higher duration) to give the key scanner more time to probe PBKDF parameters.

Frequently Asked Questions about WeChat Local

What is WeChat Local?

WeChat Local is a Model Context Protocol (MCP) server that wechat/微信 local chat history mcp server for macos agents. read messages, contacts, media, favorites, transfers, red packets, moments and full-text search from local wechat 4.x data. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install WeChat Local?

Follow the installation instructions on the WeChat Local GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with WeChat Local?

WeChat Local works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is WeChat Local free to use?

Yes, WeChat Local is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Communication MCP Servers

Explore all communication servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "wechat-local": { "command": "npx", "args": ["-y", "wechat-local"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use WeChat Local?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides