# Kuaishou Mini-Game MCP

> Kuaishou Mini-Game MCP handles the entire backend logic for your casual games. Use this to manage user accounts, save game progress in cloud storage, track scores on leaderboards, and monitor retention metrics—all through natural conversation with your AI client. It’s built to keep your mini-game running smoothly.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** mini-games, cloud-storage, leaderboards, monetization, user-authentication, game-backend

## Description

This connector lets you treat your entire game backend like a simple set of tools. Instead of jumping between separate dashboards or calling specific APIs in code, you talk to your agent and it handles the complexity. You can manage everything from user sign-in and cloud data storage to calculating player rankings and checking content compliance. When an AI client connects this MCP via Vinkius, it gets a single pane of glass for game management. Need to track if a new feature is working? Call the analytics tool. Did a user submit text that might violate policy? Run the moderation check. It’s all about moving from complex workflows to simple commands.

## Tools

### check_content
Checks user-generated text against platform policies for violations.

### code2session
Exchanges a temporary login code for the full Kuaishou user session token.

### get_analytics
Retrieves key game metrics like Daily Active Users and retention rates.

### get_game_config
Fetches the current remote configuration settings for features or balancing parameters.

### get_leaderboard
Retrieves player rankings and scores from the game's leaderboards.

### get_user_info
Gets detailed profile information for a specific Kuaishou user account.

### get_user_storage
Retrieves saved game data, like progress or settings, from the cloud storage.

### report_event
Sends a custom event to track specific actions within the game environment.

### set_user_storage
Saves or updates user-specific data, such as high scores or preferences.

### submit_score
Sends a numeric score to a specific leaderboard for ranking calculation.

## Prompt Examples

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

**Response:** 
```
✅ Login code exchanged! User openid: ks_user_123. Session established.
```

**Prompt:** 
```
Save game data: level 10, score 3000 for user ks_user_123.
```

**Response:** 
```
✅ Game data saved! Level 10, score 3000 stored in cloud storage.
```

**Prompt:** 
```
Show me the top 10 players on the 'main' leaderboard.
```

**Response:** 
```
🏆 Top 10 Leaderboard: 1) PlayerA - 9850, 2) PlayerB - 8720, 3) PlayerC - 7650...
```

## Capabilities

### Authenticate Users
Exchanges temporary login codes for permanent, session-specific tokens.

### Save Game State
Writes and reads specific user data fields to the game's cloud storage.

### Manage Leaderboards
Retrieves player rankings or submits a new score for competition tracking.

### Analyze Player Behavior
Gets aggregate data points like Daily Active Users and overall retention rates.

### Check Content Compliance
Scans user-generated text to ensure it meets platform policy standards.

### Apply Game Config Changes
Fetches the latest remote configuration settings for feature flags or balancing tweaks.

## Use Cases

### The new user signs up and plays.
An agent runs `code2session` to verify the login code. It then uses `get_user_info` to pull their profile, saves their initial settings with `set_user_storage`, and finally tracks their first action using `report_event`. The user experience is seamless.

### A major update changes game rules.
Instead of redeploying code everywhere, the dev calls `get_game_config` to pull the latest feature flag settings. This lets them test balance adjustments without downtime.

### The leaderboard needs a manual check.
A moderator asks the agent to run `get_leaderboard`. The agent pulls the top 5 scores, allowing the team to verify if the scoring logic is working correctly before announcing an event.

### Player data must be secured and moderated.
A QA engineer inputs a user-generated message into `check_content` to ensure it doesn't contain banned words, preventing moderation issues in the live game loop.

## Benefits

- Forget logging into multiple dashboards. You can handle user authentication and profile retrieval in one go by using `code2session` followed by `get_user_info`. It keeps your workflow contained.
- Tracking player engagement is simple. Instead of running complex database queries, just ask for data with `get_analytics` to monitor DAU or retention immediately.
- Never lose a user's progress again. You can reliably save and retrieve game state using `set_user_storage` and `get_user_storage`, making persistence effortless.
- Competition management is streamlined. Use `submit_score` to log points, and then run `get_leaderboard` to check the top players—all without writing a single line of boilerplate code.
- Content safety checks are built-in. When users submit text, running `check_content` prevents policy violations from ever hitting your live environment.

## How It Works

The bottom line is that instead of writing code to call multiple APIs, you simply prompt your agent with natural language instructions.

1. First, subscribe to this MCP and input your Kuaishou Mini-Game App ID and Secret.
2. Next, connect it to any AI client. Your agent can now see all the available functions for managing game data.
3. Finally, just ask your agent what you want to do—like 'Get the leaderboard scores' or 'Save progress for user X'—and it executes the necessary calls.

## Frequently Asked Questions

**How do I authenticate a new player using `code2session`?**
You send the temporary login code to `code2session`. The tool returns a session token and the user's unique openid, which you must use for all subsequent calls like fetching profile data.

**Can I track custom actions with `report_event`?**
Yes. Instead of just saving static key-value pairs, `report_event` lets you log specific behaviors—like 'used power-up' or 'failed level 3'—so your analytics are much richer.

**What data is best suited for `set_user_storage`?**
Use it for persistent, structured user settings and achievements. It’s ideal for things that don't change every second, like 'current level' or 'preferred skin'.

**Does `get_leaderboard` handle multiple leaderboards?**
Yes. You specify the leaderboard ID you want to query. This allows you to pull rankings for different game modes (e.g., 'PvP' vs 'Puzzle') using a single command.

**When should I use the `check_content` tool?**
You check content before displaying user-generated text to catch policy violations. This tool runs moderation checks on any text submitted by a player, ensuring that offensive or prohibited material doesn't appear in your game environment.

**What kind of metrics does `get_analytics` provide?**
It provides core operational data including Daily Active Users (DAU) and retention rates. This function pulls together high-level engagement statistics, letting you monitor the overall health and stickiness of your mini-game.

**How do I manage game variables using `get_game_config`?**
You fetch current remote configuration settings to control live features without code deployment. This is useful for toggling feature flags or adjusting game balancing parameters on the fly.

**What specific profile data does `get_user_info` return?**
It returns a comprehensive set of attributes tied to the user's account. You can get more than just an ID; you retrieve details about the player's registered profile information.

**How do I get my Kuaishou Mini-Game credentials?**
Register at the [Kuaishou Open Platform](https://open.kuaishou.com/), create a mini-game application, and find your App ID and App Secret in the application settings.

**What monetization models are supported?**
Kuaishou supports IAA (In-App Advertising) with rewarded videos and interstitial ads, as well as IAP (In-App Purchases). Revenue split is 89% for paid traffic and 30% for organic traffic.

**How does cloud storage work?**
Cloud storage saves user game data as key-value pairs. Each user gets their own storage space. Use set_user_storage to save and get_user_storage to load data. Essential for cross-device game continuity.