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 | 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 | 校验载荷并预览请求,但不发送。 |
输入 schema
{
"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 }。
注解
destructive
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
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 Canvas 项目 ID(对项目级资源为必填)。 |
dryRun | boolean | false | 预览将要删除的内容,不发起 HTTP 请求。 |
dry-run | boolean | false | 预览将要删除的内容,不发起 HTTP 请求。 |
confirm | boolean | false | 删除级联资源(workspace)时必须设为 true。 |
输入 schema
{
"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>。用于修改可变字段(“更新优先级描述”“编辑上下文”“更新工作区文件”“修补技能”“暂停 webhook”“编辑屏幕”)。返回 { resource, item, updateMask };当 Canvas 以异步方式应用编辑时(设计系统),返回 { resource, id, status: “pending”, session, requested, message },调用方应稍后重新读取该资源;使用 dryRun 时,返回精确的请求预览。
注解
destructive
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
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 | 预览请求,不修改资源。 |
输入 schema
{
"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。
注解
readOnly
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
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 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",
"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 轮询)。
注解
destructive
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
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 | 校验参数并预览范围,但不启动生成任务。 |
输入 schema
{
"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 中指定的工具。
注解
readOnly
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
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 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",
"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 Canvas 网页 URL。对应 stitch url <resource> <id>。当用户想要链接(“在 Stitch 中打开”“获取画布 URL”“链接到屏幕”)时使用,而不是猜测 stitch.google.com 的 URL。返回 { resource, id, url, verified: false }。
注解
readOnly
参数
| 字段 | 类型 | 必需 | 描述 |
|---|---|---|---|
resource | string | true | 要为哪种 Stitch Canvas 资源构造 URL(project 或 screen)。允许的取值:project、screen。 |
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 无关联。