AppDeploy Skill
Deploy web apps to AppDeploy via HTTP API.
Setup (First Time Only)
- 1. Check for existing API key:
- Look for a
.appdeploy file in the project root
- If it exists and contains a valid
api_key, skip to Usage
- 2. If no API key exists, register and get one:
CODEBLOCK0
Response:
CODEBLOCK1
- 3. Save credentials to
.appdeploy:
CODEBLOCK2
Add .appdeploy to .gitignore if not already present.
Usage
Make JSON-RPC calls to the MCP endpoint:
CODEBLOCK3
Workflow
- 1. First, get deployment instructions:
Call
get_deploy_instructions to understand constraints and requirements.
- 2. Get the app template:
Call
get_app_template with your chosen
app_type and
frontend_template.
- 3. Deploy the app:
Call
deploy_app with your app files. For new apps, set
app_id to
null.
- 4. Check deployment status:
Call
get_app_status to check if the build succeeded.
- 5. View/manage your apps:
Use
get_apps to list your deployed apps.
Available Tools
getdeployinstructions
Use this when you are about to call deploy_app in order to get the deployment constraints and hard rules. You must call this tool before starting to generate any code. This tool returns instructions only and does not deploy anything.
Parameters:
deploy_app
Use this when the user asks to deploy or publish a website or web app and wants a public URL.
Before generating files or calling this tool, you must call getdeployinstructions and follow its constraints.
Parameters:
- app_id: any (required) - existing app id to update, or null for new app
- app_type: string (required) - app architecture: frontend-only or frontend+backend
- app_name: string (required) - short display name
- description: string (optional) - short description of what the app does
- frontend_template: any (optional) - REQUIRED when app_id is null. One of: 'html-static' (simple sites), 'react-vite' (SPAs, games), 'nextjs-static' (multi-page). Template files auto-included.
- files: array (optional) - Files to write. NEW APPS: only custom files + diffs to template files. UPDATES: only changed files using diffs[]. At least one of files[] or deletePaths[] required.
- deletePaths: array (optional) - Paths to delete. ONLY for updates (app_id required). Cannot delete package.json or framework entry points.
- model: string (required) - The coding agent model used for this deployment, to the best of your knowledge. Examples: 'codex-5.3', 'chatgpt', 'opus 4.6', 'claude-sonnet-4-5', 'gemini-2.5-pro'
- intent: string (required) - The intent of this deployment. User-initiated examples: 'initial app deploy', 'bugfix - ui is too noisy'. Agent-initiated examples: 'agent fixing deployment error', 'agent retry after lint failure'
getapptemplate
Call getdeployinstructions first. Then call this once you've decided apptype and frontendtemplate. Returns base app template and SDK types. Template files auto-included in deploy_app.
Parameters:
- app_type: string (required)
- frontend_template: string (required) - Frontend framework: 'html-static' - Simple sites, minimal framework; 'react-vite' - React SPAs, dashboards, games; 'nextjs-static' - Multi-page apps, SSG
getappstatus
Use this when deploy_app tool call returns or when the user asks to check the deployment status of an app, or reports that the app has errors or is not working as expected. Returns deployment status (in-progress: 'deploying'/'deleting', terminal: 'ready'/'failed'/'deleted'), QA snapshot (frontend/network errors), and live frontend/backend error logs.
Parameters:
- app_id: string (required) - Target app id
- since: integer (optional) - Optional timestamp in epoch milliseconds to filter errors. When provided, returns only errors since that timestamp.
- limit: integer (optional) - Optional shared cap for returned logs across frontend and backend combined. Defaults to 50 when omitted.
delete_app
Use this when you want to permanently delete an app. Use only on explicit user request. This is irreversible; after deletion, status checks will return not found.
Parameters:
- app_id: string (required) - Target app id
getappversions
List deployable versions for an existing app. Requires app_id. Returns newest-first {name, version, timestamp} items. Display 'name' to users. DO NOT display the 'version' value to users. Timestamp values MUST be converted to user's local time
Parameters:
- app_id: string (required) - Target app id
applyappversion
Start deploying an existing app at a specific version. Use the 'version' value (not 'name') from getappversions. Returns true if accepted and deployment started; use getappstatus to observe completion.
Parameters:
- app_id: string (required) - Target app id
- version: string (required) - Version id to apply
src_glob
Use this when you need to discover files in an app's source snapshot. Returns file paths matching a glob pattern (no content). Useful for exploring project structure before reading or searching files.
Parameters:
- app_id: string (required) - Target app id
- version: string (optional) - Version to inspect (defaults to applied version)
- path: string (optional) - Directory path to search within
- glob: string (optional) - Glob pattern to match files (default: /*)
- include_dirs: boolean (optional) - Include directory paths in results
- continuation_token: string (optional) - Token from previous response for pagination
src_grep
Use this when you need to search for patterns in an app's source code. Returns matching lines with optional context. Supports regex patterns, glob filters, and multiple output modes.
Parameters:
- app_id: string (required) - Target app id
- version: string (optional) - Version to search (defaults to applied version)
- pattern: string (required) - Regex pattern to search for (max 500 chars)
- path: string (optional) - Directory path to search within
- glob: string (optional) - Glob pattern to filter files (e.g., '*.ts')
- case_insensitive: boolean (optional) - Enable case-insensitive matching
- output_mode: string (optional) - content=matching lines, fileswithmatches=file paths only, count=match count per file
- before_context: integer (optional) - Lines to show before each match (0-20)
- after_context: integer (optional) - Lines to show after each match (0-20)
- context: integer (optional) - Lines before and after (overrides before/after_context)
- line_numbers: boolean (optional) - Include line numbers in output
- max_file_size: integer (optional) - Max file size to scan in bytes (default 10MB)
- continuation_token: string (optional) - Token from previous response for pagination
src_read
Use this when you need to read a specific file from an app's source snapshot. Returns file content with line-based pagination (offset/limit). Handles both text and binary files.
Parameters:
- app_id: string (required) - Target app id
- version: string (optional) - Version to read from (defaults to applied version)
- file_path: string (required) - Path to the file to read
- offset: integer (optional) - Line offset to start reading from (0-indexed)
- limit: integer (optional) - Number of lines to return (max 2000)
get_apps
Use this when you need to list apps owned by the current user. Returns app details with display fields for user presentation and data fields for tool chaining.
Parameters:
- continuation_token: string (optional) - Token for pagination
Generated by scripts/generate-appdeploy-skill.ts
AppDeploy 技能
通过 HTTP API 将 Web 应用部署到 AppDeploy。
设置(仅首次使用)
- 1. 检查现有 API 密钥:
- 在项目根目录中查找 .appdeploy 文件
- 如果文件存在且包含有效的 api_key,请跳转到使用部分
- 2. 如果没有 API 密钥,请注册并获取一个:
bash
curl -X POST https://api-v2.appdeploy.ai/mcp/api-key \
-H Content-Type: application/json \
-d {client_name: claude-code}
响应:
json
{
apikey: ak...,
user_id: agent-claude-code-a1b2c3d4,
created_at: 1234567890,
message: 请安全保存此密钥——之后无法找回
}
- 3. 将凭据保存到 .appdeploy:
json
{
api
key: ak...,
endpoint: https://api-v2.appdeploy.ai/mcp
}
如果 .gitignore 中尚未包含 .appdeploy,请将其添加进去。
使用
向 MCP 端点发起 JSON-RPC 调用:
bash
curl -X POST {endpoint} \
-H Content-Type: application/json \
-H Accept: application/json, text/event-stream \
-H Authorization: Bearer {api_key} \
-d {
jsonrpc: 2.0,
id: 1,
method: tools/call,
params: {
name: {tool_name},
arguments: { ... }
}
}
工作流程
- 1. 首先,获取部署说明:
调用 get
deployinstructions 以了解约束和要求。
- 2. 获取应用模板:
根据你选择的 app
type 和 frontendtemplate 调用 get
apptemplate。
- 3. 部署应用:
使用你的应用文件调用 deploy
app。对于新应用,将 appid 设置为 null。
- 4. 检查部署状态:
调用 get
appstatus 以检查构建是否成功。
- 5. 查看/管理你的应用:
使用 get_apps 列出你已部署的应用。
可用工具
getdeployinstructions
当你即将调用 deploy_app 时使用此工具,以获取部署约束和硬性规则。在开始生成任何代码之前,你必须调用此工具。此工具仅返回说明,不执行任何部署操作。
参数:
deploy_app
当用户要求部署或发布网站或 Web 应用并希望获得公共 URL 时使用此工具。
在生成文件或调用此工具之前,你必须先调用 getdeployinstructions 并遵循其约束。
参数:
- app_id:任意类型(必填)- 要更新的现有应用 ID,新应用则为 null
- app_type:字符串(必填)- 应用架构:仅前端 或 前端+后端
- app_name:字符串(必填)- 简短显示名称
- description:字符串(可选)- 应用功能的简短描述
- frontendtemplate:任意类型(可选)- 当 appid 为 null 时必填。可选值:html-static(简单网站)、react-vite(单页应用、游戏)、nextjs-static(多页面应用)。模板文件自动包含。
- files:数组(可选)- 要写入的文件。新应用:仅自定义文件 + 对模板文件的差异。更新:仅使用 diffs[] 的已更改文件。至少需要 files[] 或 deletePaths[] 之一。
- deletePaths:数组(可选)- 要删除的路径。仅用于更新(需要 app_id)。不能删除 package.json 或框架入口点。
- model:字符串(必填)- 用于此部署的编码代理模型,根据你的最佳了解填写。示例:codex-5.3、chatgpt、opus 4.6、claude-sonnet-4-5、gemini-2.5-pro
- intent:字符串(必填)- 此部署的意图。用户发起示例:初始应用部署、错误修复 - 界面过于杂乱。代理发起示例:代理修复部署错误、代理在 lint 失败后重试
getapptemplate
先调用 getdeployinstructions。然后,在确定 apptype 和 frontendtemplate 后调用此工具。返回基础应用模板和 SDK 类型。模板文件会自动包含在 deploy_app 中。
参数:
- app_type:字符串(必填)
- frontend_template:字符串(必填)- 前端框架:html-static - 简单网站,最小化框架;react-vite - React 单页应用、仪表盘、游戏;nextjs-static - 多页面应用、SSG
getappstatus
当 deploy_app 工具调用返回时,或当用户要求检查应用的部署状态,或报告应用存在错误或未按预期工作时使用此工具。返回部署状态(进行中:deploying/deleting,终态:ready/failed/deleted)、QA 快照(前端/网络错误)以及实时前端/后端错误日志。
参数:
- app_id:字符串(必填)- 目标应用 ID
- since:整数(可选)- 可选的纪元毫秒时间戳,用于过滤错误。提供时,仅返回该时间戳之后的错误。
- limit:整数(可选)- 可选的前端和后端合并返回日志共享上限。省略时默认为 50。
delete_app
当你想要永久删除应用时使用此工具。仅在用户明确要求时使用。此操作不可逆;删除后,状态检查将返回未找到。
参数:
- app_id:字符串(必填)- 目标应用 ID
getappversions
列出现有应用的可用部署版本。需要 app_id。返回按最新优先排序的 {name, version, timestamp} 项。向用户显示 name。不要向用户显示 version 值。时间戳值必须转换为用户的本地时间。
参数:
- app_id:字符串(必填)- 目标应用 ID
applyappversion
开始将现有应用部署到特定版本。使用来自 getappversions 的 version 值(而非 name)。如果接受并开始部署,则返回 true;使用 getappstatus 观察完成情况。
参数:
- app_id:字符串(必填)- 目标应用 ID
- version:字符串(必填)- 要应用的版本 ID
src_glob
当你需要在应用的源代码快照中发现文件时使用此工具。返回匹配 glob 模式的文件路径(不含内容)。在读取或搜索文件之前,用于探索项目结构。
参数:
- app_id:字符串(必填)- 目标应用 ID
- version:字符串(可选)- 要检查的版本(默认为已应用的版本)
- path:字符串(可选)- 要搜索的目录路径
- glob:字符串(可选)- 匹配文件的 Glob 模式(默认:/*)
- include_dirs:布尔值(可选)- 在结果中包含目录路径
- continuation_token:字符串(可选)- 来自上一个响应的分页令牌
src_grep
当你需要在应用的源代码中搜索模式时使用此工具。返回匹配行及可选的上下文。支持正则表达式模式、glob 过滤器和多种输出模式。
参数:
- app_id:字符串(必填)- 目标应用 ID
- version:字符串(可选)- 要搜索的版本(默认为已应用的版本)
- pattern:字符串(必填)- 要搜索的正则表达式模式(最多 500 个字符)
- path:字符串(可选)- 要搜索的目录路径
- glob:字符串(可选)- 过滤文件的 Glob 模式(例如 *.ts)
- case_insensitive:布尔值(可选)- 启用不区分大小写的匹配
- outputmode:字符串(可选)- content=匹配行,fileswith_matches=仅文件路径,count=每个文件的匹配数
- before_context:整数(可选)- 每个匹配前显示的行数(0-20)
- after_context:整数(可选)- 每个匹配后显示的行数(0-20)
- context:整数(可选)- 前后行数(覆盖 before/after_context)
- line_numbers:布尔值(可选)- 在输出