sketch-to-html-mcp
Parses Sketch design files (from js.design) into CSS-aligned, LLM-friendly JSON, enabling AI agents to generate high-fidelity HTML/Vue/React code, with layout inference, resource export (WebP/PNG/SVG), and design token extraction.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sketch-to-html-mcpExtract the layer tree and design tokens from the sketch, then generate Vue code"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
sketch-to-html-mcp
一个基于 Model Context Protocol (MCP) 的 server,用于解析 .sketch 设计稿(从 js.design 导出)为 CSS-aligned 的、对 LLM 友好的 JSON,让 AI 编码 agent 能高保真地生成 HTML/Vue/React 等代码。
功能特性
基于命名约定的过滤:通过
#WEB#/#NATIVE#/#NOTE#前缀标记图层,原生界面自动跳过,注释与目标图层关联CSS-aligned 输出:Sketch 字段映射为 CSS 属性名(
backgroundColor、flexDirection、boxShadow等),贴合 LLM 训练数据布局推断:自动将自由布局转换为 flexbox,无法推断时回退为绝对定位
资源导出:位图导出为 WebP/PNG(
@3x文件名规范),矢量图标导出为 SVG设计 token 提取:提取颜色和文字样式,给出 SCSS 变量建议
Related MCP server: @designjs/mcp-server
快速开始
npm install
npm run build在 opencode.json 中注册:
{
"mcp": {
"sketch-to-html": {
"type": "local",
"command": ["node", "D:/fjc/code/work/AI/tools/mcp-servers/sketch-to-html/dist/index.cjs"],
"env": {
"DEFAULT_IMAGE_SCALE": "3",
"DEFAULT_IMAGE_FORMAT": "webp"
}
}
}
}环境变量
变量 | 作用 | 默认值 |
| 图片导出倍率 |
|
| 图片导出格式(webp/png) |
|
提供的工具
工具 | 作用 |
| 列出画板,报告包含 |
| 核心工具:返回 CSS-aligned 图层树 JSON + |
| 导出位图图层为 webp/png 到指定目录(默认 3 倍图) |
| 导出矢量图层为 SVG |
| 提取颜色/字体 design tokens,生成 SCSS 变量建议 |
使用流程
1. list_artboards → 发现 #WEB# 入口
2. get_design_tokens → 得到颜色/字体变量
3. get_layer_tree → 得到 CSS-aligned 图层树 + 注释
4. 对 image 图层调 export_image → 图片导出到 public/images/
5. AI 综合数据 + 项目规范 → 生成代码使用注意
export_image/export_svg的outputDir:先询问用户目标目录;用户未回答时默认public/images/fileName:由 AI 自行生成有意义的名称(避免与现有文件重名),不确定时询问用户。默认从图层名生成的文件名会剥掉非 ASCII 字符,中文图层名会退化成无意义的名字
图层命名规范
完整规范见 docs/naming-convention.md。快速一览:
前缀 | 含义 |
| UI 内容 — 转换为代码 |
| 原生界面 — 跳过 |
| 注释文本 — 关联到 |
嵌套图层:子图层标记优先级高于祖先图层。
项目记忆
实现细节、设计决策、开发进度见 PROJECT_MEMORY.md。
状态
核心功能已实现并通过测试(125 个测试全部通过),当前处于 AI 实际生成代码的集成验证阶段。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceMCP server to provide Sketch layout information to AI coding agents like CursorLast updated3472MIT
- Alicense-qualityAmaintenanceMCP server that enables AI coding agents to read and write to a local-first HTML/CSS design canvas, bridging visual design and code generation.Last updatedMIT

Sketch MCPofficial
FlicenseBqualityCmaintenanceAn official MCP server that allows AI clients to interact with Sketch designs, enabling exploration, iteration, asset export, and more.Last updated2- Alicense-qualityDmaintenanceMCP server that bridges design and code by generating UI components, layouts, and themes from text prompts using v0.dev, with features like code refactoring and accessibility auditing.Last updated331MIT
Related MCP Connectors
MCP server for generating rough-draft project plans from natural-language prompts.
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for Flux AI image generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/strayark/mcp-sketch-to-html'
If you have feedback or need assistance with the MCP directory API, please join our Discord server