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>。用於執行原子性建立(「add context」、「create loop」、「connect tool provider」、「create skill」、「generate screen」)。傳回 { resource, item, created };使用 dryRun 時,會傳回確切的請求預覽。
註解
破壞性
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
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 | 驗證承載內容並預覽請求,而不實際傳送。 |
輸入結構定義
{
"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 }。
註解
破壞性
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
resource | "projects" | "project" | "workspaces" |
id | string | true | 要刪除的資源 ID。 |
workspace | string | false | 工作區 ID 覆寫。未設定預設工作區時,工作區範圍的資源必須提供。 |
project | string | false | Stitch 畫布專案 ID(專案範圍的資源必填)。 |
dryRun | boolean | false | 預覽將刪除的內容,且不發出 HTTP 請求。 |
dry-run | boolean | false | 預覽將刪除的內容,且不發出 HTTP 請求。 |
confirm | boolean | false | 刪除串聯或破壞性資源(workspace、project、context)時必須設為 true。 |
輸入結構定義
{
"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>。用於修改可變更欄位(「update loop description」、「edit context」、「update workspace file」、「patch skill」、「pause webhook」、「edit screen」)。傳回 { resource, item, updateMask };當畫布以非同步方式套用編輯時(設計系統),會傳回 { resource, id, status: ‘pending’, session, requested, message },呼叫端應稍後重新讀取該資源;使用 dryRun 時,會傳回確切的請求預覽。
註解
破壞性
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
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 | 預覽請求,而不修改資源。 |
輸入結構定義
{
"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,以檢視完整詳細資料。
註解
唯讀
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
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 畫布專案 ID(專案範圍的資源必填)。 |
limit | integer | false | 要傳回的項目數量上限(預設 50)。 |
pageSize | integer | false | 向 API 要求的每頁項目數(預設為 limit)。 |
pageToken | string | false | 從先前結果的 nextPageToken 繼續。畫布資源不支援。 |
filter | string | false | AIP-160 篩選運算式。 |
include | array | false | 要併入每個項目的相關集合。 |
輸入結構定義
{
"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 輪詢)。
註解
破壞性
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
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 畫布專案 ID(螢幕與變體產生時必填,除非已設定 newProject)。 |
newProject | object | false | 為產生的螢幕建立新的 Stitch 畫布專案(布林值或專案標題)。 |
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 或 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 | 驗證引數並預覽範圍,而不啟動產生工作。 |
輸入結構定義
{
"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 中所指名的工具。
註解
唯讀
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
resource | "projects" | "project" | "screens" |
id | string | false | 要擷取的資源 ID。除了「status」以外,所有資源都必須提供;「status」則必須省略 id。 |
workspace | string | false | 工作區 ID 覆寫。未設定預設工作區時,工作區範圍的資源必須提供。 |
project | string | false | Stitch 畫布專案 ID(專案範圍的資源必填)。 |
輸入結構定義
{
"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 畫布網頁 URL。對應 stitch url <resource> <id>。當使用者要求連結(「open in Stitch」、「get canvas URL」、「link to screen」)時使用,而不要猜測 stitch.google.com 的 URL。傳回 { resource, id, url, verified: false }。
註解
唯讀
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
resource | "project" | "screen" | true |
id | string | true | 專案或螢幕的 ID(接受單純 ID 或完整資源名稱,例如「projects/<p>/screens/<s>」)。 |
project | string | false | 擁有該螢幕的專案 ID(當 resource=‘screen’ 且「id」不是完整的「projects/<p>/screens/<s>」資源名稱時必填)。 |
輸入結構定義
{
"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 無關聯。