# WeChat Mini-Programs MCP

> WeChat Mini-Programs / 微信小程序 connects your AI client directly to China's dominant mini-app ecosystem. Manage complex operations like session authentication, retrieving verified user phone numbers, and sending structured messages through natural conversation. It lets you automate tasks that used to require navigating the entire WeChat MP portal.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** mini-apps, user-session-management, subscriber-engagement, mobile-ecosystem, verification

## Description

This MCP turns your agent into a real-time assistant for WeChat Mini-Programs. Instead of manually logging into multiple developer consoles, you talk to it. Your AI client handles complex session management—exchanging login codes for OpenIDs and session keys instantly. Need user data? You can retrieve verified phone numbers or audit subscriber profiles without lifting a finger. It even generates unlimited QR codes for targeted campaigns and performs content security checks on images and text. Because it unifies these actions, you get accurate results from one place, making everything from user onboarding to notification blasts straightforward.

## Tools

### code_to_session
Exchanges a login code for necessary user session keys.

### generate_standard_qrcode
Creates a standard QR code for basic user acquisition purposes.

### generate_unlimited_qrcode
Generates specialized, unlimited QR codes that can include specific scene parameters.

### get_account_status
Checks the general connectivity status of the WeChat account used for the MCP.

### get_daily_summary
Retrieves a trend summary of daily performance metrics.

### get_phone_number
Fetches a user's verified phone number associated with their account.

### get_visit_page_trend
Retrieves data showing how users are visiting specific pages within the mini-program.

### image_security_check
Analyzes an image to detect any sensitive or non-compliant content.

### message_security_check
Scans provided text to check for sensitive keywords or policy violations.

### send_subscribe_message
Sends a structured, official subscription message to the user's WeChat account.

## Prompt Examples

**Prompt:** 
```
Exchange login code '0138...' for a user session.
```

**Response:** 
```
I've successfully exchanged the code. The user's OpenID is `o88210934...`. The session key has been retrieved and stored securely. Would you like to check this user's profile or verified phone number?
```

**Prompt:** 
```
Send a subscribe message to 'o992018...' with template ID 'TEMP_8821'.
```

**Response:** 
```
I've sent the structured subscribe message. The message ID is `88210934`. The user will receive the notification on their WeChat app immediately. Should I check the page-level visit trends for your mini-program?
```

**Prompt:** 
```
Generate an unlimited QR code for scene 'referral_8821' on page 'pages/index/index'.
```

**Response:** 
```
I've generated the unlimited QR code for you. The binary data is ready for processing. This code will automatically pass the 'referral_8821' scene parameter to your mini-program when scanned. Would you like me to check the security of this page path?
```

## Capabilities

### Authenticate User Sessions
Your agent exchanges login codes for OpenIDs and session keys, establishing secure connections with the WeChat ecosystem.

### Retrieve Contact Information
You pull verified user phone numbers and audit subscriber profiles using secure API calls.

### Manage Messaging Campaigns
The agent sends structured subscription messages, allowing you to manage delivery status for your mini-program users.

### Generate Promotional Codes
You instantly create unlimited scene-based and standard QR codes for user acquisition campaigns.

### Check Content Compliance
The MCP audits both images and text, ensuring all your content meets platform security requirements.

## Use Cases

### Onboarding a new batch of users
A developer needs to validate 50 user accounts. Instead of writing a loop, they ask their agent: 'Get the session key and verified phone number for these five codes.' The agent uses `code_to_session` and `get_phone_number` sequentially, returning all necessary data in one list.

### Launching a referral campaign
The marketing team needs 100 unique tracking QR codes. They prompt the agent: 'Generate an unlimited QR code for the referral scene on the index page.' The tool creates batch-ready, trackable codes instantly.

### Running a content compliance audit
A product manager submits new ad copy and images. They ask their agent to 'Audit this text and image for WeChat policies.' The MCP runs `message_security_check` and `image_security_check`, flagging risks before publication.

### Re-engaging dormant users
The operations team wants to push a new feature update. They ask the agent to 'Send a structured subscribe message to all premium subscribers.' The MCP uses `send_subscribe_message` to guarantee delivery and track status.

## Benefits

- Stop clicking through multiple developer consoles. Your agent handles session authentication—exchanging login codes for OpenIDs and keys—all from one chat prompt.
- Instantly pull critical user details like verified phone numbers using the `get_phone_number` tool, allowing you to target messaging without manual lookups.
- Manage your entire marketing funnel by generating unlimited QR codes. This feature lets you embed specific scene parameters into every code for tracking.
- Ensure compliance before launch. Use the `image_security_check` or `message_security_check` tools to audit content instantly, preventing policy violations.
- Get deep operational insights by checking visit trends with `get_visit_page_trend`, understanding exactly where your users are spending time in the mini-program.

## How It Works

The bottom line is, you tell your AI what needs doing—like getting user data—and it executes the necessary WeChat API calls behind the scenes.

1. Subscribe to this MCP and provide your WeChat AppID and AppSecret keys.
2. Connect the service to your AI client like Claude or Cursor within Vinkius, authorizing access.
3. Instruct your agent in natural language to perform tasks, such as exchanging a login code for a session key or generating a QR code.

## Frequently Asked Questions

**How do I use the WeChat Mini-Programs MCP to get a user session key?**
You use the `code_to_session` tool. Just give your agent the login code, and it exchanges that code for the necessary OpenIDs and session keys.

**What is the difference between generating standard and unlimited QR codes?**
The `generate_unlimited_qrcode` tool allows you to embed specific scene parameters into every code. This gives you granular tracking data when users scan it, which basic codes lack.

**Can I audit content using the WeChat Mini-Programs MCP?**
Yes. You use either `message_security_check` for text or `image_security_check` for images to ensure your content meets platform compliance standards before publishing.

**Does the WeChat Mini-Programs MCP help with user engagement?**
Absolutely. You can use `send_subscribe_message` to send structured notifications and manage delivery status, keeping your users engaged within the mini-program environment.