Google Play开发者API MCP服务器
模型上下文协议(MCP)服务器,用于通过Android发布商API v3管理Google Play应用程序部署和应用内产品。
特性
应用程序部署
- 内部部署:上传AAB并部署到内部测试轨道
- 部署跟踪:上传AAB并部署到任何支持的轨道
- promote_track_release:在曲目之间推广现有的上传版本,而无需重新上传AAB
应用内产品
- create_inapp_product:创建或更新单个应用内产品
- batch_create_inapp-products:一次创建多个产品
- activate_inapp_产品:激活草稿产品
- batch_activate_inapp_产品:激活多个产品
- 停用_不适用_产品:停用活性产品
- list_inapp_产品:列出所有一次性产品
- 创建_订阅_产品:创建或更新订阅产品
- list_订阅:列出所有订阅产品
应用信息
- 获取app_info:获取应用程序跟踪和版本信息
需求
- Python 3.10+
- 使用Google Play开发者API访问的Google云服务帐户
- 在Google Play控制台中注册的应用程序
安装与使用
您可以直接使用此MCP服务器 npx 无需手动安装。
快速入门(npx)
# Configure your API key
npx google-play-mcp init-key
# For Korean instructions (한국어 안내)
npx google-play-mcp init-key --lang ko
# Start the server
npx google-play-mcp start安装(全局)
如果你更喜欢全局安装(从npm):
npm install -g google-play-mcp安装(本地开发)
要从克隆的存储库安装,请执行以下操作:
npm install -g .然后你可以运行:
google-play-mcp init-key
google-play-mcp start配置(反重力和克劳德桌面)
要使用此MCP服务器,请将以下配置添加到您的MCP客户端(例如。, claude_desktop_config.json 或反重力设置):
{
"mcpServers": {
"google-play": {
"command": "google-play-mcp",
"args": ["start"],
"env": {
"GOOGLE_PLAY_KEY_FILE": "/absolute/path/to/your-key.json",
"GOOGLE_PLAY_PACKAGE_NAME": "com.yourcompany.yourapp"
}
}
}
}注: 如果你还没跑init-key或者没有.env文件中,您可以直接在配置中传递环境变量,如上所示。如果你有.env如果文件位于工作目录中,服务器将自动加载它。
配置(Codex)
如果您的工作空间布局为:
/Users//Foreign-Language-Battle/
└─ google-play-mcp/您可以从克隆的存储库目录运行此MCP服务器。
- 创建
.env里面google-play-mcp:
cd /Users//Foreign-Language-Battle/google-play-mcp
cp .env.example .env
# edit .env and set:
# GOOGLE_PLAY_KEY_FILE=/absolute/path/to/service-account.json
# GOOGLE_PLAY_PACKAGE_NAME=com.yourcompany.yourapp- 安装依赖项:
cd /Users//Foreign-Language-Battle/google-play-mcp
pip install -r requirements.txt- 在Codex配置中添加MCP服务器条目(示例):
{
"mcpServers": {
"google-play": {
"command": "python3",
"args": ["server.py"],
"cwd": "/Users//Foreign-Language-Battle/google-play-mcp",
"env": {
"GOOGLE_PLAY_KEY_FILE": "/absolute/path/to/service-account.json",
"GOOGLE_PLAY_PACKAGE_NAME": "com.yourcompany.yourapp"
}
}
}
}- 重新启动Codex(或重新加载MCP服务器),然后调用以下工具
get_app_info, create_inapp_product,以及 create_subscription_product.
- 登录到npm:
npm login- 发布包:
npm publish配置
这 npm run init-key 脚本将自动创建 .env 使用您的配置文件:
GOOGLE_PLAY_KEY_FILE=/absolute/path/to/your-key.json
GOOGLE_PLAY_PACKAGE_NAME=com.yourcompany.yourapp用法
要手动启动服务器,请执行以下操作:
npm start使用Claude Desktop
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"google-play": {
"command": "npm",
"args": ["start"],
"cwd": "/absolute/path/to/google-play-mcp"
}
}
}工具示例
部署到内部测试
Deploy app-release.aab to internal testing with Korean and English release notes促进内部发布到生产
Promote the existing internal track release to production without uploading a new AAB.
Set Korean release notes to 버그 핫픽스 and English release notes to Bug hotfix.创建应用内产品
Create an in-app product:
- SKU: gems_100
- Korean: 보석 100개 / 보석 100개를 획득합니다
- English: 100 Gems / Get 100 gems
- Price: $0.99 USD批量创建产品
[
{"sku": "gems_12", "title_ko": "보석 12개", "title_en": "12 Gems",
"description_ko": "보석 12개 획득", "description_en": "Get 12 gems", "price_usd": 0.99},
{"sku": "gems_66", "title_ko": "보석 66개", "title_en": "66 Gems",
"description_ko": "보석 66개 획득", "description_en": "Get 66 gems", "price_usd": 4.99}
]激活产品
["gems_12", "gems_66", "gems_136"]创建订阅产品
Create a subscription product:
- Product ID: malto_plus_monthly
- Base Plan ID: monthly
- Korean: 말투 플러스 월간 / 매일 보석을 지급하는 월간 구독
- English: Malto Plus Monthly / Monthly subscription with daily gem rewards
- Price: $4.99 USD
- Billing Period: P1M重要说明
应用内产品的先决条件
在创建应用内产品之前,您的应用必须具备:
com.android.vending.BILLING许可在AndroidManifest.xml- 播放计费库6.0.1+(Flutter:
in_app_purchase包装) - 将这些捆绑包上传到Google Play
应用程序草稿
从未发布的应用程序只能使用 status: "draft" 用于部署。 首次发布时,您必须通过Google Play Console手动发布。
API迁移
此服务器使用新 monetization.onetimeproducts API而不是不推荐使用的 inappproducts API返回403个错误。
价格转换
美元价格会自动转换为170多种地区货币,使用 谷歌的 convertRegionPrices API
轨迹
| 轨道 | 描述 |
|---|---|
internal | 内部测试(最多100名测试人员) |
alpha | 封闭式测试 |
beta | 开放式测试 |
production | 生产发布 |
许可证
MIT许可证
