cws-mcp
](https://www.npmjs.com/package/cws-mcp)
](https://lobehub.com/mcp/mikusnuz-cws-mcp)
用于Chrome Web Store扩展管理的MCP服务器。直接从Claude Code或任何MCP客户端上传、发布和管理Chrome扩展程序。
何时使用
需要时使用此MCP:
- “上传我的Chrome扩展程序的新版本” --构建ZIP并使用
upload将其作为草稿推送的工具 - “将我的扩展程序发布到Chrome网上应用商店” --使用
publish提交审核并上线 - “检查我的分机的审核状态” --使用
status查看审阅状态、版本和部署百分比 - 更新我的扩展的元数据(描述、截图) --使用
update-metadata-ui更改店铺列表详细信息 - “取消待处理的提交” --使用
cancel撤回正在审查的呈件 - “为我的扩展设置分阶段推出” --使用
publish然后分阶段推出deploy-percentage加速
工具
| 工具 | 说明 |
|---|---|
upload | 将ZIP文件上传到Chrome网上商店(更新现有商品草稿) |
publish | 发布扩展,可选择分阶段推出、发布类型和跳过审阅 |
status | 获取当前状态,包括审查状态、部署百分比和版本 |
cancel | 取消待处理的提交 |
deploy-percentage | 设置分阶段推出百分比(0-100,必须超过当前目标) |
get | 阅读草案/已发布的列表元数据(v1.1 API,2026年10月弃用) |
update-metadata | 通过v1.1 API更新列表元数据(2026年10月弃用) |
update-metadata-ui | 通过仪表板UI自动化(Playwright)更新列表元数据 |
API覆盖范围
此MCP服务器包括 所有Chrome Web Store API v2端点:
| v2端点 | MCP工具 |
|---|---|
media.upload | upload |
publishers.items.publish | publish |
publishers.items.fetchStatus | status |
publishers.items.cancelSubmission | cancel |
publishers.items.setPublishedDeployPercentage | deploy-percentage |
此外,v1.1 API端点可用于元数据操作(get, update-metadata),具有仪表板UI自动化功能(update-metadata-ui)作为推荐的替代方案,因为v1已被弃用。
设置
1.创建OAuth2凭据
- 首选 谷歌云控制台
- 创建项目(或选择现有项目)
- 启用 Chrome Web Store API
- 创建OAuth2凭据(桌面应用程序类型)
- 注意你的 客户端ID 和 客户端密钥
2.获取刷新令牌
# Open in browser to get authorization code
open "https://accounts.google.com/o/oauth2/auth?response_type=code&scope=https://www.googleapis.com/auth/chromewebstore&client_id=YOUR_CLIENT_ID&redirect_uri=urn:ietf:wg:oauth:2.0:oob"
# Exchange code for refresh token
curl -X POST https://oauth2.googleapis.com/token \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "code=YOUR_AUTH_CODE" \
-d "grant_type=authorization_code" \
-d "redirect_uri=urn:ietf:wg:oauth:2.0:oob"3.配置MCP
添加到您的Claude Code MCP设置中(~/.claude/settings.local.json):
{
"mcpServers": {
"cws-mcp": {
"command": "node",
"args": ["/path/to/cws-mcp/dist/index.js"],
"env": {
"CWS_CLIENT_ID": "xxxxx.apps.googleusercontent.com",
"CWS_CLIENT_SECRET": "GOCSPX-xxxxx",
"CWS_REFRESH_TOKEN": "1//xxxxx",
"CWS_PUBLISHER_ID": "me",
"CWS_ITEM_ID": "your-extension-id"
}
}
}
}或者通过npm全局安装:
{
"mcpServers": {
"cws-mcp": {
"command": "npx",
"args": ["-y", "cws-mcp"],
"env": { ... }
}
}
}环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
CWS_CLIENT_ID | 是 | 谷歌OAuth2客户端ID |
CWS_CLIENT_SECRET | 是 | 谷歌OAuth2客户端密码 |
CWS_REFRESH_TOKEN | 是 | OAuth2刷新令牌 |
CWS_PUBLISHER_ID | 否 | 发布者ID(默认值: me) |
CWS_ITEM_ID | 否 | 默认扩展项ID |
CWS_DASHBOARD_PROFILE_DIR | 否 | UI自动化的浏览器配置文件路径(默认: ~/.cws-mcp-profile) |
使用示例
检查分机状态
Use the cws-mcp status tool上传和发布
1. Use cws-mcp upload with zipPath="/path/to/extension.zip"
2. Use cws-mcp publish分阶段推出发布
Use cws-mcp publish with:
- publishType="STAGED_PUBLISH"
- deployPercentage=10发布时跳过评论
Use cws-mcp publish with skipReview=true在不发布的情况下更新列表标题/描述
Use cws-mcp update-metadata with:
- title="Pexus"
- summary="Official wallet for Plumise"
- description="..."
- category="productivity"
- defaultLocale="en"更新高级元数据字段
Use cws-mcp update-metadata with metadata={
"homepageUrl": "https://plumise.com",
"supportUrl": "https://plug.plumise.com/docs"
}当API元数据更新没有反映
Use cws-mcp update-metadata-ui with:
- title
- summary
- description
- category
- homepageUrl
- supportUrl笔记:
- 此工具自动化了Chrome Web Store仪表板UI。
- 第一次跑步
headless=false如果需要登录。 - 浏览器配置文件路径默认为
~/.cws-mcp-profile(用覆盖CWS_DASHBOARD_PROFILE_DIR).
分阶段推出
1. Use cws-mcp publish
2. Use cws-mcp deploy-percentage with percentage=10
3. Use cws-mcp deploy-percentage with percentage=50
4. Use cws-mcp deploy-percentage with percentage=100注: deploy-percentage 仅适用于拥有10000+七天活跃用户的扩展。新的百分比必须始终高于当前的目标。
V1 API弃用
这 get 和 update-metadata 工具使用Chrome Web Store v1.1 API 已弃用,将于2026年10月15日后删除。v2 API不提供元数据读/写端点,因此这些工具仍然可用作网桥。使用 update-metadata-ui (Playwright仪表板自动化)作为长期替代方案。
许可证
麻省理工学院
