dsh-stitch-mcp: Direct Integration with Google Stitch MCP in DeepSeek Harness

前言

在 DeepSeek Harness(DSH)里做 UI 设计或界面生成时,如果只能手动打开 Google Stitch 网页、复制结果再贴回对话,助手就无法在项目、屏幕和设计系统之间连贯操作。常见做法是自建 MCP 客户端、手写 HTTP 头或本地再起一层代理进程,配置分散,也不利于和 Harness 里的其他工具并列使用。

下面介绍社区插件 dsh-stitch-mcp(维护者 oooplz,分类:联网工具)。它把 Google Stitch 注册为 Harness 原生的 mcp__stitch__* 工具,通过 Streamable HTTP 直连 Google 文档中的远程 MCP 端点,并在插件面板里配置 API Key 或 OAuth,可选仅针对 Stitch 出站流量的代理。无本地 helper 进程、无额外监听端口;网络由 Harness 进程发起。

这是什么

dsh-stitch-mcp 是 DSH 的 web profile 插件,仓库:oooplz/dsh-stitch-mcp。目录页:SkillHub 插件页。

Stitch 本身是远程 MCP 端点。插件按 Google 对 MCP 客户端的说明,用 HTTP 传输并在请求头里携带凭据,形态与官方示例一致:

{ "servers": { "stitch": {
  "type": "http",
  "url": "https://stitch.googleapis.com/mcp",
  "headers": { "X-Goog-Api-Key": "AQ...." } } } }

Host 侧解析凭据后写入 ~/.dsh/dsh-runtimes/stitch-mcp/config.json,MCP 行在组装 headers 时同步读取;因此在面板里保存凭据会触发该条目重载,无需重启 Harness 即可生效。

核心功能

远端暴露 16 个工具,在 Harness 中注册为 mcp__stitch__*,用途如下(与 README 工具表一致):

工具 用途
list_projects / get_project / create_project / delete_project 项目
list_screens / get_screen / download_file 屏幕及其文件
generate_screen_from_text / edit_screens / generate_variants 生成与编辑 UI
list_design_systems / create_design_system / create_design_system_from_design_md / update_design_system / apply_design_system 设计系统
upload_design_md 上传 DESIGN.md

助手安装并配置凭据后,可在对话中列出、创建、编辑 Stitch 项目、界面与设计系统,并与 Harness 里其他 MCP 能力并列使用。

凭据与连通性:

  • 面板 Settings → Plugins → Google Stitch:API Key 页对应 X-Goog-Api-Key;OAuth 页对应 Authorization: Bearer <access token>,可选 X-Goog-User-Project 绑定项目。
  • 密钥在 stitch.withgoogle.com/settings → API key → Create key 创建;完整密钥仅展示一次。OAuth 可使用例如 gcloud auth print-access-token 的输出。
  • 凭据经 Host 的 credentials 服务写入(面板为只写展示:仅显示是否已配置)。
  • Use a proxy 开关:开启后仅 本插件 对 stitch.googleapis.com 的请求走 http://<ip>:<port>,Harness 内模型 API、网页搜索及其他 MCP 保持原路由;数秒内于运行中生效,不写入 ~/.dsh/.env。默认直连,能访问 Google 则无需额外配置。
  • 健康与故障信息见 ~/.dsh/dsh-runtimes/stitch-mcp/status.json(含 endpoint、credential、proxy、route、reachable、tools 或 error)。

插件包当前在资料中可见版本为 0.6.2(以 npm 包 package.json 为准);0.6.0 以下需手动安装 Google stitch CLI,新机器上易出现 server is disconnected。许可证:MIT。

安装与启用

在 Harness 使用 web profile 时,安装命令以 README 为准(请保留 @latest:Harness 有 minimumReleaseAge,省略后缀可能装到较旧版本):

dsh plugin --profile web add dsh-stitch-mcp@latest

若启动 Harness 时使用的不是 web,将 --profile web 换成你的 profile 名称。

安装完成后:

  1. 打开 Settings → Plugins → Google Stitch,粘贴 API Key 或 OAuth token,Save。
  2. 若无法直连 stitch.googleapis.com,在卡片打开 Use a proxy 并填写代理地址;仍失败时查看 status.json 中的 error / proxyError(README 故障表有对照说明)。
  3. 在对话中让助手调用 mcp__stitch__* 工具(例如 list_projects、generate_screen_from_text 等)。

典型用法

README 未给出固定对话脚本,可复现的路径是:安装插件 → 面板保存凭据 → 在会话中描述目标,由助手选择对应 Stitch 工具。例如:

  • 先 list_projects / get_project 确认项目上下文;
  • 用 generate_screen_from_text 或 edit_screens 生成或改界面;
  • 用 list_design_systems、create_design_system_from_design_md、apply_design_system 维护并套用设计系统;
  • 需要本地文件时用 download_file,或 upload_design_md 上传 DESIGN.md。

若工具列表已出现但调用返回 “Request is missing required authentication credential”,说明握手阶段不需要密钥、但调用尚未保存凭据——在卡片粘贴 Key 后保存即可。

适用场景与注意

适合谁:已在 DSH 中开发智能体、需要把 Google Stitch 的项目 / 屏幕 / 设计系统能力接进对话,且希望配置集中在 Harness 插件面板、而不是自搭 MCP 转发或本地 CLI 的用户。

务必注意:

  • 插件以当前 DSH 进程权限运行,会向 https://stitch.googleapis.com/mcp 发起 HTTPS 请求;安装前请自行查看 GitHub 源码 与 MIT 许可证,确认符合你的安全与合规要求。
  • 社区目录 SkillHub 为独立站点,与 DeepSeek / 幻方无官方从属关系;DSH 生态遵循「一切皆插件」,本介绍描述的是社区维护的联网工具插件,而非官方应用商店条目。
  • 出现 server is disconnected 时,多为进程完全无法连上 Stitch 端点;按 README 给进程配置可达 Google 的代理或网络策略,必要时重启 Harness。MCP 行多次重试放弃后,保存凭据可重载条目,重启 Harness 也会重新拉起客户端。

结尾

dsh-stitch-mcp 把 Google Stitch 以原生 MCP 工具形式接入 DeepSeek Harness:直连官方端点、面板管理 API Key / OAuth、可选仅作用于 Stitch 的代理,并暴露完整的 16 项项目与设计能力。需要细节、故障表与目录结构说明时,以仓库 README 为准。

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye