MCP 工具
Stitch CLI Model Context Protocol 统一工具的参考。
Stitch CLI 内置了一个 MCP 服务器(stitch mcp start / stitch mcp install),它提供 7 个与 CLI 语法一一对应的统一动词工具。
| 工具 | CLI 对应命令 | 只读 |
|---|---|---|
stitch_create | stitch create | false |
stitch_delete | stitch delete | false |
stitch_edit | stitch edit | false |
stitch_find | stitch find | true |
stitch_generate | stitch generate | false |
stitch_get | stitch get | true |
stitch_url | stitch url | true |
工具
stitch_create
创建一个资源。对应 stitch create <resource>。用于执行原子化创建(“添加上下文”“创建循环”“连接工具提供方”“创建技能”“生成屏幕”)。返回 { resource, item, created };使用 dryRun 时,返回精确的请求预览。
注解
destructive
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
resource | "project" | "screen" | "design-system" |
body | object | true | 资源载荷。必填字段:project={}、screen={prompt}、design-system={designSystem={displayName, theme={bodyFont, colorMode, customColor, headlineFont, roundness}}}、workspace={displayName}、context={data, description}、skill={content, id}、loop={objective}、webhook={eventTypes, url}、connection={providerId}。 |
workspace | string | false | 工作区 ID 覆盖值。当未配置默认工作区时,对工作区级资源为必填。 |
project | string | false | Stitch 项目 ID(对项目级资源为必填)。 |
dryRun | boolean | false | 校验载荷并预览请求,但不发送。 |
输入 schema
{
"type": "object",
"properties": {
"resource": {
"type": "string",
"enum": [
"project",
"screen",
"design-system",
"workspace",
"context",
"skill",
"loop",
"webhook",
"connection",
"priority",
"priorities"
],
"description": "Resource type to create (project, screen, design-system, workspace, context, skill, loop, webhook, connection)."
},
"body": {
"type": "object",
"description": "Resource payload. Required fields: project={}, screen={prompt}, design-system={designSystem={displayName, theme={bodyFont, colorMode, customColor, headlineFont, roundness}}}, workspace={displayName}, context={data, description}, skill={content, id}, loop={objective}, webhook={eventTypes, url}, connection={providerId}."
},
"workspace": {
"type": "string",
"description": "Workspace ID override. Required for workspace-scoped resources when no default workspace is configured."
},
"project": {
"type": "string",
"description": "Stitch project ID (required for project-scoped resources)."
},
"dryRun": {
"type": "boolean",
"description": "Validate payload and preview the request without sending it."
}
},
"required": [
"resource",
"body"
]
}
对应的 CLI 命令
stitch create --schema
stitch_delete
按 id 移除一个资源(project、workspace、context、loop、webhook)。对应 stitch delete <resource> <id>。返回 { resource, id, deleted }。
注解
destructive
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
resource | "projects" | "project" | "workspaces" |
id | string | true | 要删除的资源 ID。 |
workspace | string | false | 工作区 ID 覆盖值。当未配置默认工作区时,对工作区级资源为必填。 |
project | string | false | Stitch Canvas 项目 ID(对项目级资源为必填)。 |
dryRun | boolean | false | 预览将要删除的内容,不发起 HTTP 请求。 |
dry-run | boolean | false | 预览将要删除的内容,不发起 HTTP 请求。 |
confirm | boolean | false | 删除级联或破坏性资源(workspace、project、context)时必须设为 true。 |
输入 schema
{
"type": "object",
"properties": {
"resource": {
"type": "string",
"enum": [
"projects",
"project",
"workspaces",
"workspace",
"contexts",
"context",
"loops",
"loop",
"priority",
"priorities",
"webhooks",
"webhook"
],
"description": "Resource type to delete (project, workspace, context, loop, webhook)."
},
"id": {
"type": "string",
"description": "ID of the resource to delete."
},
"workspace": {
"type": "string",
"description": "Workspace ID override. Required for workspace-scoped resources when no default workspace is configured."
},
"project": {
"type": "string",
"description": "Stitch Canvas project ID (required for project-scoped resources)."
},
"dryRun": {
"type": "boolean",
"description": "Preview what would be deleted and issue no HTTP request."
},
"dry-run": {
"type": "boolean",
"description": "Preview what would be deleted and issue no HTTP request."
},
"confirm": {
"type": "boolean",
"description": "Must be set to true when deleting a cascading or destructive resource (workspace, project, context)."
}
},
"required": [
"resource",
"id"
]
}
对应的 CLI 命令
stitch delete --schema
stitch_edit
对一个资源应用部分更新。对应 stitch edit <resource> <id>。用于修改可变字段(“更新循环描述”“编辑上下文”“更新工作区文件”“修补技能”“暂停 webhook”“编辑屏幕”)。返回 { resource, item, updateMask };当 Canvas 以异步方式应用编辑时(设计系统),返回 { resource, id, status: “pending”, session, requested, message },调用方应稍后重新读取该资源;使用 dryRun 时,返回精确的请求预览。
注解
destructive
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
resource | "screen" | "design-system" | "workspace" |
id | string | true | 要编辑的资源 ID。对于屏幕,还接受 projects/<p>/screens/<s> 或 Stitch 画布 URL;将使用其中指定的项目。 |
patch | object | true | 要更新的字段。可编辑字段:screen={deviceType, modelId, prompt, designSystem}、design-system={designSystem={displayName, theme={bodyFont, colorMode, colorVariant, customColor, designMd, headlineFont, labelFont, overrideNeutralColor, overridePrimaryColor, overrideSecondaryColor, overrideTertiaryColor, roundness, spacing, typography}}}、workspace={description, displayName, priorityGroups, repositories}、context={annotations, data, dataSource, description, expireTime, schema}、file={content, path}、skill={content, description}、loop={autonomyLevel, description, groupId}、webhook={displayName, eventTypes, secret, sslVerificationEnabled, state}。 |
updateMask | string | false | 要更新的字段路径,以逗号分隔。省略时从 patch 的键推导。 |
workspace | string | false | 工作区 ID 覆盖值。当未配置默认工作区时,对工作区级资源为必填。 |
project | string | false | Stitch 项目 ID(对项目级资源为必填)。 |
dryRun | boolean | false | 预览请求,不修改资源。 |
输入 schema
{
"type": "object",
"properties": {
"resource": {
"type": "string",
"enum": [
"screen",
"design-system",
"workspace",
"context",
"file",
"skill",
"loop",
"webhook",
"priority",
"priorities"
],
"description": "Resource type to edit (screen, design-system, workspace, context, file, skill, loop, webhook)."
},
"id": {
"type": "string",
"description": "ID of the resource to edit. For screens, also accepts projects/<p>/screens/<s> or a Stitch canvas URL; the project it names is used."
},
"patch": {
"type": "object",
"description": "Fields to update. Editable fields: screen={deviceType, modelId, prompt, designSystem}, design-system={designSystem={displayName, theme={bodyFont, colorMode, colorVariant, customColor, designMd, headlineFont, labelFont, overrideNeutralColor, overridePrimaryColor, overrideSecondaryColor, overrideTertiaryColor, roundness, spacing, typography}}}, workspace={description, displayName, priorityGroups, repositories}, context={annotations, data, dataSource, description, expireTime, schema}, file={content, path}, skill={content, description}, loop={autonomyLevel, description, groupId}, webhook={displayName, eventTypes, secret, sslVerificationEnabled, state}."
},
"updateMask": {
"type": "string",
"description": "Comma-separated field paths to update. Derived from patch keys when omitted."
},
"workspace": {
"type": "string",
"description": "Workspace ID override. Required for workspace-scoped resources when no default workspace is configured."
},
"project": {
"type": "string",
"description": "Stitch project ID (required for project-scoped resources)."
},
"dryRun": {
"type": "boolean",
"description": "Preview the request without modifying the resource."
}
},
"required": [
"resource",
"id",
"patch"
]
}
对应的 CLI 命令
stitch edit --schema
stitch_find
列出指定类型的资源(projects、screens、design-systems、workspaces、contexts、files、skills、loops、webhooks、insights、solutions、connections、organizations)。对应 stitch find <resource>。返回 { resource, items, returnedCount, isTruncated, nextPageToken }。如需查看完整详情,可再对具体 id 调用 stitch_get。
注解
readOnly
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
resource | "projects" | "project" | "screens" |
criteria | object | false | 特定于资源的筛选条件(例如 projects={title}、screens={title, deviceType}、design-systems={displayName},或 {id, state})。 |
workspace | string | false | 工作区 ID 覆盖值。当未配置默认工作区时,对工作区级资源为必填。 |
project | string | false | Stitch Canvas 项目 ID(对项目级资源为必填)。 |
limit | integer | false | 返回的最大条目数(默认 50)。 |
pageSize | integer | false | 向 API 请求的每页条目数(默认为 limit)。 |
pageToken | string | false | 从上次结果的 nextPageToken 继续。Canvas 资源不支持。 |
filter | string | false | AIP-160 筛选表达式。 |
include | array | false | 要拉取到每个条目中的关联集合。 |
输入 schema
{
"type": "object",
"properties": {
"resource": {
"type": "string",
"enum": [
"projects",
"project",
"screens",
"screen",
"design-systems",
"design-system",
"workspaces",
"workspace",
"contexts",
"context",
"files",
"file",
"skills",
"skill",
"loops",
"loop",
"priority",
"priorities",
"webhooks",
"webhook",
"insights",
"insight",
"solutions",
"solution",
"connections",
"connection",
"toolProvider",
"toolProviders",
"tool-provider",
"tool-providers",
"organizations",
"organization"
],
"description": "Resource type to list (projects, screens, design-systems, workspaces, contexts, files, skills, loops, webhooks, insights, solutions, connections, organizations)."
},
"criteria": {
"type": "object",
"description": "Resource-specific filter criteria (e.g. projects={title}, screens={title, deviceType}, design-systems={displayName}, or {id, state})."
},
"workspace": {
"type": "string",
"description": "Workspace ID override. Required for workspace-scoped resources when no default workspace is configured."
},
"project": {
"type": "string",
"description": "Stitch Canvas project ID (required for project-scoped resources)."
},
"limit": {
"type": "integer",
"description": "Maximum number of items to return (default 50)."
},
"pageSize": {
"type": "integer",
"description": "Items per page requested from the API (defaults to limit)."
},
"pageToken": {
"type": "string",
"description": "Resume from a previous result's nextPageToken. Not supported for Canvas resources."
},
"filter": {
"type": "string",
"description": "AIP-160 filter expression."
},
"include": {
"type": "array",
"description": "Related collections to pull into each item."
}
},
"required": [
"resource"
]
}
对应的 CLI 命令
stitch find --schema
stitch_generate
触发后端生成任务(screens、variants、insights、solutions)。对应 stitch generate <resource>。返回 { resource, workspace, started, complete }(由于生成以异步方式运行,complete 为 false;可用 stitch_find 轮询)。
注解
destructive
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
resource | "screens" | "screen" | "variants" |
priorities | array | false | 限定生成范围的循环 ID(仅适用于 resource=“insights”;省略则在整个工作区内生成)。 |
insights | array | false | 要为其生成方案的洞察 ID(resource=“solutions” 时为必填;仅适用于 resource=“solutions”)。 |
delayExecution | boolean | false | 重新安排智能体运行,而不是立即启动(仅适用于 resource=“insights”)。 |
replaceExisting | boolean | false | 替换现有的未分配方案,而不是追加到其中(仅适用于 resource=“solutions”)。 |
workspace | string | false | 工作区 ID 覆盖值。未配置默认工作区时为必填。 |
project | string | false | Stitch Canvas 项目 ID(除非设置了 newProject,否则生成屏幕和变体时为必填)。 |
newProject | object | false | 为生成的屏幕创建新的 Stitch Canvas 项目(布尔值或项目标题)。 |
title | string | false | 可选的屏幕或项目标题(用于屏幕生成)。 |
prompt | string | false | 用于屏幕或变体生成的文本提示词。 |
device | string | false | 屏幕或变体生成的设备类型:MOBILE、DESKTOP、TABLET 或 AGNOSTIC。 |
deviceType | string | false | device 的别名:MOBILE、DESKTOP、TABLET 或 AGNOSTIC。 |
model | string | false | 屏幕或变体生成的模型 ID(GEMINI_3_8_FLASH 或 GEMINI_3_5_FLASH_LITE)。 |
modelId | string | false | model 的别名(GEMINI_3_8_FLASH 或 GEMINI_3_5_FLASH_LITE)。 |
screen | object | false | 用于生成变体的源屏幕 ID(一个或多个)。 |
selectedScreenIds | array | false | screen 的别名:用于生成变体的源屏幕 ID。 |
count | integer | false | 要生成的变体数量(1-5)。 |
variantCount | integer | false | count 的别名:要生成的变体数量(1-5)。 |
creativeRange | string | false | 变体的创意范围:REFINE、EXPLORE 或 REIMAGINE。 |
aspects | array | false | 变体的目标方面(例如 LAYOUT、COLOR_SCHEME、TEXT_FONT)。 |
variantOptions | object | false | 嵌套的变体选项({ variantCount, creativeRange, aspects })。 |
dryRun | boolean | false | 校验参数并预览范围,但不启动生成任务。 |
dry-run | boolean | false | 校验参数并预览范围,但不启动生成任务。 |
输入 schema
{
"type": "object",
"properties": {
"resource": {
"type": "string",
"enum": [
"screens",
"screen",
"variants",
"variant",
"insights",
"insight",
"solutions",
"solution"
],
"description": "Resource type to generate (screens, variants, insights, solutions)."
},
"priorities": {
"type": "array",
"description": "Loop IDs to scope generation to (applies to resource='insights' only; omit to generate across the entire workspace)."
},
"insights": {
"type": "array",
"description": "Insight IDs to generate solutions for (required when resource='solutions'; applies to resource='solutions' only)."
},
"delayExecution": {
"type": "boolean",
"description": "Reschedule the agent run rather than starting immediately (applies to resource='insights' only)."
},
"replaceExisting": {
"type": "boolean",
"description": "Replace existing unassigned solutions instead of adding to them (applies to resource='solutions' only)."
},
"workspace": {
"type": "string",
"description": "Workspace ID override. Required when no default workspace is configured."
},
"project": {
"type": "string",
"description": "Stitch Canvas project ID (required for screen and variant generation unless newProject is set)."
},
"newProject": {
"type": "object",
"description": "Create a new Stitch Canvas project for the generated screen (boolean or project title)."
},
"title": {
"type": "string",
"description": "Optional screen or project title (for screen generation)."
},
"prompt": {
"type": "string",
"description": "Text prompt for screen or variant generation."
},
"device": {
"type": "string",
"description": "Device type for screen or variant generation: MOBILE, DESKTOP, TABLET, or AGNOSTIC."
},
"deviceType": {
"type": "string",
"description": "Alias for device: MOBILE, DESKTOP, TABLET, or AGNOSTIC."
},
"model": {
"type": "string",
"description": "Model ID for screen or variant generation (GEMINI_3_8_FLASH or GEMINI_3_5_FLASH_LITE)."
},
"modelId": {
"type": "string",
"description": "Alias for model (GEMINI_3_8_FLASH or GEMINI_3_5_FLASH_LITE)."
},
"screen": {
"type": "object",
"description": "Source screen ID or IDs for variant generation."
},
"selectedScreenIds": {
"type": "array",
"description": "Alias for screen: source screen IDs for variant generation."
},
"count": {
"type": "integer",
"description": "Number of variants to generate (1-5)."
},
"variantCount": {
"type": "integer",
"description": "Alias for count: number of variants to generate (1-5)."
},
"creativeRange": {
"type": "string",
"description": "Creative range for variants: REFINE, EXPLORE, or REIMAGINE."
},
"aspects": {
"type": "array",
"description": "Target aspects for variants (e.g. LAYOUT, COLOR_SCHEME, TEXT_FONT)."
},
"variantOptions": {
"type": "object",
"description": "Nested variant options ({ variantCount, creativeRange, aspects })."
},
"dryRun": {
"type": "boolean",
"description": "Validate arguments and preview scope without starting a generation job."
},
"dry-run": {
"type": "boolean",
"description": "Validate arguments and preview scope without starting a generation job."
}
},
"required": [
"resource"
]
}
对应的 CLI 命令
stitch generate --schema
stitch_get
按 id 获取一个资源(project、screen、design-system、status、workspace、context、file、skill、loop、webhook、insight、solution、connection、organization)。对应 stitch get <resource> <id>。返回 { resource, item, availableActions? }。后续请调用 availableActions 中指定的工具。
注解
readOnly
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
resource | "projects" | "project" | "screens" |
id | string | false | 要获取的资源 ID。除 “status” 外的所有资源均为必填;对于 “status”,必须省略 id。 |
workspace | string | false | 工作区 ID 覆盖值。当未配置默认工作区时,对工作区级资源为必填。 |
project | string | false | Stitch Canvas 项目 ID(对项目级资源为必填)。 |
输入 schema
{
"type": "object",
"properties": {
"resource": {
"type": "string",
"enum": [
"projects",
"project",
"screens",
"screen",
"design-systems",
"design-system",
"status",
"workspaces",
"workspace",
"contexts",
"context",
"files",
"file",
"skills",
"skill",
"loops",
"loop",
"priority",
"priorities",
"webhooks",
"webhook",
"insights",
"insight",
"solutions",
"solution",
"connections",
"connection",
"toolProvider",
"toolProviders",
"tool-provider",
"tool-providers",
"organizations",
"organization"
],
"description": "Resource type to fetch (project, screen, design-system, status, workspace, context, file, skill, loop, webhook, insight, solution, connection, organization)."
},
"id": {
"type": "string",
"description": "ID of the resource to fetch. Required for every resource except 'status', where id must be omitted."
},
"workspace": {
"type": "string",
"description": "Workspace ID override. Required for workspace-scoped resources when no default workspace is configured."
},
"project": {
"type": "string",
"description": "Stitch Canvas project ID (required for project-scoped resources)."
}
},
"required": [
"resource"
]
}
对应的 CLI 命令
stitch get --schema
stitch_url
在不产生任何网络 I/O 的情况下,返回项目或屏幕的规范 Stitch Canvas 网页 URL。对应 stitch url <resource> <id>。当用户想要链接(“在 Stitch 中打开”“获取画布 URL”“链接到屏幕”)时使用,而不是猜测 stitch.google.com 的 URL。返回 { resource, id, url, verified: false }。
注解
readOnly
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
resource | "project" | "screen" | true |
id | string | true | 项目或屏幕的 ID(接受裸 ID 或完整资源名称,如 “projects/<p>/screens/<s>”)。 |
project | string | false | 拥有该屏幕的项目 ID(当 resource=“screen” 且 “id” 不是完整的 “projects/<p>/screens/<s>” 资源名称时为必填)。 |
输入 schema
{
"type": "object",
"properties": {
"resource": {
"type": "string",
"enum": [
"project",
"screen"
],
"description": "Stitch Canvas resource type to construct a URL for (project or screen)."
},
"id": {
"type": "string",
"description": "ID of the project or screen (accepts a bare ID or a full resource name like 'projects/<p>/screens/<s>')."
},
"project": {
"type": "string",
"description": "Project ID that owns the screen (required when resource='screen' and 'id' is not a full 'projects/<p>/screens/<s>' resource name)."
}
},
"required": [
"resource",
"id"
]
}
对应的 CLI 命令
stitch url --schema
原文: https://stitch.withgoogle.com/docs/cli/reference/mcp-tools/
本页翻译自 Google Stitch 官方文档,原文版权归 Google LLC 所有。本站为独立第三方翻译,与 Google 无关联。