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 priority」、「connect tool provider」、「create skill」、「generate screen」)。傳回 { resource, item, created };使用 dryRun 時,會傳回確切的請求預覽。
註解
破壞性
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
resource | string | true | 要建立的資源型別(project、screen、design-system、workspace、context、skill、priority、webhook、connection)。允許的值:project、screen、design-system、workspace、context、skill、priority、webhook、connection。 |
body | object | true | 資源承載內容。必填欄位:project={}、screen={prompt}、design-system={designSystem}、workspace={displayName}、context={data, description}、skill={content, id}、priority={objective}、webhook={eventTypes, url}、connection={providerId}。執行「stitch create <resource> --schema」以取得完整合約。 |
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",
"priority",
"webhook",
"connection"
],
"description": "Resource type to create (project, screen, design-system, workspace, context, skill, priority, webhook, connection)."
},
"body": {
"type": "object",
"description": "Resource payload. Required fields: project={}, screen={prompt}, design-system={designSystem}, workspace={displayName}, context={data, description}, skill={content, id}, priority={objective}, webhook={eventTypes, url}, connection={providerId}. Run 'stitch create <resource> --schema' for the full contract."
},
"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 移除一個資源(workspace、context、priority、webhook)。對應 stitch delete <resource> <id>。傳回 { resource, id, deleted }。
註解
破壞性
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
resource | string | true | 要刪除的資源型別(workspace、context、priority、webhook)。允許的值:workspaces、workspace、contexts、context、priorities、priority、webhooks、webhook。 |
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 | 刪除串聯資源(工作區)時必須設為 true。 |
輸入結構定義
{
"type": "object",
"properties": {
"resource": {
"type": "string",
"enum": [
"workspaces",
"workspace",
"contexts",
"context",
"priorities",
"priority",
"webhooks",
"webhook"
],
"description": "Resource type to delete (workspace, context, priority, 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 resource (workspace)."
}
},
"required": [
"resource",
"id"
]
}
對應的 CLI 指令
stitch delete --schema
stitch_edit
對一個資源套用部分更新。對應 stitch edit <resource> <id>。用於修改可變更欄位(「update priority description」、「edit context」、「update workspace file」、「patch skill」、「pause webhook」、「edit screen」)。傳回 { resource, item, updateMask };當畫布以非同步方式套用編輯時(設計系統),會傳回 { resource, id, status: ‘pending’, session, requested, message },呼叫端應稍後重新讀取該資源;使用 dryRun 時,會傳回確切的請求預覽。
註解
破壞性
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
resource | string | true | 要編輯的資源型別(screen、design-system、workspace、context、file、skill、priority、webhook)。允許的值:screen、design-system、workspace、context、file、skill、priority、webhook。 |
id | string | true | 要編輯的資源 ID。螢幕亦接受 projects/<p>/screens/<s> 或 Stitch 畫布 URL;將採用其中指名的專案。 |
patch | object | true | 要更新的欄位。執行「stitch edit <resource> --schema」以取得可編輯的欄位。 |
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",
"priority",
"webhook"
],
"description": "Resource type to edit (screen, design-system, workspace, context, file, skill, priority, 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. Run 'stitch edit <resource> --schema' for the editable fields."
},
"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、priorities、webhooks、insights、solutions、connections、organizations)。對應 stitch find <resource>。傳回 { resource, items, returnedCount, isTruncated, nextPageToken }。接著對特定 id 呼叫 stitch_get,以檢視完整詳細資料。
註解
唯讀
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
resource | string | true | 要列出的資源型別(projects、screens、design-systems、workspaces、contexts、files、skills、priorities、webhooks、insights、solutions、connections、organizations)。允許的值:projects、project、screens、screen、design-systems、design-system、workspaces、workspace、contexts、context、files、file、skills、skill、priorities、priority、webhooks、webhook、insights、insight、solutions、solution、connections、connection、toolProvider、toolProviders、tool-provider、tool-providers、organizations、organization。 |
criteria | object | false | 資源特定的篩選條件(例如 { id: ‘i-1’ })。 |
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",
"priorities",
"priority",
"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, priorities, webhooks, insights, solutions, connections, organizations)."
},
"criteria": {
"type": "object",
"description": "Resource-specific filter criteria (e.g. { id: 'i-1' })."
},
"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
觸發後端產生工作(insights、solutions)。對應 stitch generate <resource>。傳回 { resource, workspace, started, complete }(complete 為 false,因為產生程序以非同步方式執行;請以 stitch_find 輪詢)。
註解
破壞性
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
resource | string | true | 要產生的資源型別(insights、solutions)。允許的值:insights、insight、solutions、solution。 |
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 覆寫。未設定預設工作區時必填。 |
dryRun | boolean | false | 驗證引數並預覽範圍,而不啟動產生工作。 |
dry-run | boolean | false | 驗證引數並預覽範圍,而不啟動產生工作。 |
輸入結構定義
{
"type": "object",
"properties": {
"resource": {
"type": "string",
"enum": [
"insights",
"insight",
"solutions",
"solution"
],
"description": "Resource type to generate (insights, solutions)."
},
"priorities": {
"type": "array",
"description": "Priority 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."
},
"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、priority、webhook、insight、solution、connection、organization)。對應 stitch get <resource> <id>。傳回 { resource, item, availableActions? }。接著使用 availableActions 中所指名的工具。
註解
唯讀
參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
resource | string | true | 要擷取的資源型別(project、screen、design-system、status、workspace、context、file、skill、priority、webhook、insight、solution、connection、organization)。允許的值:projects、project、screens、screen、design-systems、design-system、status、workspaces、workspace、contexts、context、files、file、skills、skill、priorities、priority、webhooks、webhook、insights、insight、solutions、solution、connections、connection、toolProvider、toolProviders、tool-provider、tool-providers、organizations、organization。 |
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",
"priorities",
"priority",
"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, priority, 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 | string | true | 要為其建構 URL 的 Stitch 畫布資源型別(project 或 screen)。允許的值:project、screen。 |
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 無關聯。