WeChat Local
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.
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
Maintainer
Works with
Installation
Manual Installation
npx wechat-localConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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"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 bootstrapVerify 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 --prettyAdd 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"
}
}
}
}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_storageRestart 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.
WeChat Local Alternatives — Similar Communication Servers
Looking for alternatives to WeChat Local? Here are other popular communication servers you can use with Claude, Cursor, and VS Code.
Slack
★ 86.1kEnables interaction with Slack workspaces through comprehensive channel management, messaging, user management, file uploads, and Block Kit formatting. Features secure credential storage via macOS Keychain and supports all major Slack operations incl
LibreChat
★ 37.3kEnhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenA
Note Gen
★ 11.9kA cross-platform Markdown AI note-taking software.
DeepChat
★ 5.8k🐬DeepChat - A smart assistant that connects powerful AI to your personal world
WhatsApp MCP
★ 5.7kConnects AI assistants to the official Meta WhatsApp Cloud API for managing conversations and sending various message types through natural language. It provides tools for media management, template messages, and real-time webhook processing without
Apple
★ 3.1kEnables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.
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.
Set Up WeChat Local in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.