mcp-sketch
mcp-sketch
Inglés | Chino
Herramienta local que ofrece servicios MCP y CLI para analizar archivos zip HTML exportados desde Sketch-Meaxure y extraer información de la estructura del diseño.
SKILL
Se recomienda descargar el
skillsketch-html y personalizar su propia versión para analizar archivos zip exportados desdeSketch-Meaxure.También se puede descargar utilizando la herramienta
skills.
npx skills@latest add YamadaAoi/mcp-sketch -s sketch-htmlRelated MCP server: codesign-mcp
Declaración
Para no confundir a la
IA, esta herramienta filtra algunas capas sin sentido, pero no se excluye la posibilidad de que se filtren algunas capas válidas.Se recomienda comunicarse con el diseñador
UI; para efectos complejos, intente realizar cortes (slices); para efectos simples, establezca un radio (radius) para enfatizar, aunque sea1.
Funcionalidades
Analizar archivos zip HTML exportados desde Sketch y extraer la estructura del diseño.
Soporte para filtrar por página y mesa de trabajo (artboard).
Soporte para analizar áreas rectangulares específicas.
Salida de la estructura del diseño en JSON e imágenes de vista previa para referencia de la IA.
Proporciona dos formas de uso: servicio MCP y CLI.
Modo de uso
Método 1: Uso directo mediante CLI
Utilizar en combinación con npx:
npx -y mcp-sketch analyze -p /path/to/export.zipOpciones de comando
Opción | Abreviatura | Descripción |
|
| Ruta del archivo zip HTML de Sketch (obligatorio) |
| ID de la página | |
| Nombre de la página | |
| ID de la mesa de trabajo | |
| Nombre de la mesa de trabajo | |
|
| Especificar el área rectangular de análisis, formato: |
| Ruta de almacenamiento de los cortes, por defecto | |
| Si se debe guardar el resultado del análisis en un archivo local, por defecto |
Ejemplo de CLI
Si los parámetros contienen espacios, deben encerrarse entre comillas
# 分析 zip 中第一个页面第一个画板
npx -y mcp-sketch analyze -p "/path/to/export .zip"
# 分析指定页面
npx -y mcp-sketch analyze -p /path/to/export.zip --pn 首页
# 分析指定页面指定画板
npx -y mcp-sketch analyze -p /path/to/export.zip --pn 首页 --an 用户管理
# 分析指定区域
npx -y mcp-sketch analyze -p /path/to/export.zip --pn 首页 --an 用户管理 -r "[0,0,1920,64]"Método 2: Servicio MCP
Es obligatorio establecer la variable de entorno MCP_MODE=1 para habilitar el servicio MCP, configurado como un servicio MCP local para que las herramientas de IA puedan invocarlo directamente.
opencode:
{
"mcp": {
"mcp-sketch": {
"type": "local",
"command": ["npx", "-y", "mcp-sketch"],
"enabled": true,
"environment": {
"MCP_MODE": "1",
"LOG_LEVEL": "debug"
}
}
}
}Trae:
{
"mcpServers": {
"mcp-sketch": {
"command": "npx",
"args": ["-y", "mcp-sketch"],
"env": {
"MCP_MODE": "1"
}
}
}
}Parámetros MCP
Utilice la herramienta sketch_html_analyze para analizar el archivo zip HTML exportado desde Sketch:
Parámetro | Tipo | Obligatorio | Descripción |
file_path | string | Sí | Ruta del archivo zip HTML de Sketch |
page_id | string | No | ID de la página |
page_name | string | No | Nombre de la página |
artboard_id | string | No | ID de la mesa de trabajo |
artboard_name | string | No | Nombre de la mesa de trabajo |
rect | number[] | No | Especificar el área rectangular de análisis, formato |
assets_path | string | No | Ruta de almacenamiento de los cortes, por defecto |
save_result | boolean | No | Si se debe guardar el resultado del análisis en un archivo local, por defecto |
Ejemplo de invocación MCP
Analizar la primera mesa de trabajo de la primera página del archivo zip HTML de Sketch:
sketch_html_analyze({ file_path: "/path/to/export.zip" })Analizar la primera mesa de trabajo de una página específica:
sketch_html_analyze({ file_path: "/path/to/export.zip", page_name: "首页" })Analizar una mesa de trabajo específica de una página específica:
sketch_html_analyze({ file_path: "/path/to/export.zip", page_name: "首页", artboard_name: "用户管理" })Analizar un área específica de una mesa de trabajo específica en una página específica, por ejemplo, analizar la barra de navegación superior de la mesa de trabajo de gestión de usuarios:
sketch_html_analyze({ file_path: "/path/to/export.zip", page_name: "首页", artboard_name: "用户管理", rect: [0, 0, 1920, 64] })Prioridad de parámetros
page:
page_id>page_name> primera páginaartboard:
artboard_id>artboard_name> primera mesa de trabajorect: Especifica el área rectangular de análisis; la regla de filtrado es que si las coordenadas
x,y,x+width,y+heightdel elemento están dentro del rectángulo, será analizado.
Resultados devueltos
La herramienta devolverá texto: {artboard: {resultado del análisis}, previewPath: "ruta de la vista previa"}
artboardDatos de la mesa de trabajo, incluyendo capas, estilos, imágenes, etc.
previewPathUtiliza
sharpcomooptionalDependenciespara el procesamiento de imágenes.Si la instalación falla (caso extremo, ya que
sharpdepende delibvips), se devolverá la imagen original completa de la mesa de trabajo.Si la instalación es exitosa, se ajustará el tamaño, se recortará el área
rect(si se especifica) y se comprimirá en formatowebppara su devolución.Solo procesa la vista previa, no reemplaza el procesamiento de cortes de
sketch.
Ubicación de los archivos de salida
Los cortes analizados se guardan por defecto en el directorio
src/assets/sketch/(se puede personalizar medianteassets_path).El contenido del diseño analizado se guarda por defecto en un archivo JSON local (para revisión humana), la carpeta de almacenamiento tiene el mismo nombre y nivel que el archivo zip.
Sugerencias de uso
Utilice modelos que soporten multimodalidad, capaces de leer la vista previa para corregir la estructura del diseño.
El volumen de datos analizados para la IA no debe exceder los
50KBpara mejorar la precisión del análisis de la IA (el archivo JSON almacenado localmente está formateado, el que se pasa a la IA es un formato compacto).Se recomienda utilizar el parámetro
rectpara analizar áreas específicas dentro de la mesa de trabajo, permitiendo un desarrollo modular y mejorando la granularidad.
Guía
Available Tools
1 toolsketch_html_analyzesketch_html_analyzeC
Analyze sketch html files and return the design structure of corresponding pages or drawing boards
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | sketch html zip file path(required) | |
| page_id | No | page id (optional) | |
| page_name | No | page name (optional) | |
| artboard_id | No | artboard id (optional) | |
| artboard_name | No | artboard name (optional) | |
| rect | No | rect [x, y, width, height] (optional) | |
| assets_path | No | assets path (optional), default src/assets/sketch | |
| saveResult | No | save analysis result (optional), default true |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure but fails to specify critical traits: it doesn't clarify that the tool likely extracts/reads zip files (implied by 'sketch html zip file path'), doesn't explain what the saveResult parameter actually saves or where, and doesn't disclose whether this is a read-only operation or has side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no redundant words. It is appropriately front-loaded with the verb 'Analyze'. However, the density means it sacrifices clarity on parameter relationships and behavioral details that would require additional sentences.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For an 8-parameter tool handling file processing with multiple optional filters (page, artboard, rect) and persistence options (saveResult), the description is inadequate. With no output schema provided, the description should explain the return format and structure, but it omits this entirely, leaving the agent uncertain about what data structure it will receive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, establishing a baseline of 3. The description adds marginal semantic value by referencing 'pages or drawing boards' which contextualizes the page_id and artboard_id parameters, but doesn't explain the rect parameter's purpose (cropping vs selection) or the assets_path behavior.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the action ('Analyze') and resource ('sketch html files'), and mentions the return value ('design structure'). However, 'design structure' remains somewhat vague—it doesn't specify whether this returns layer hierarchies, CSS properties, or component trees, which would help the agent understand the utility of the output.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions 'pages or drawing boards' which implicitly maps to the page_id/artboard_id parameters, but provides no explicit guidance on when to use this tool versus alternatives, or how to use the filtering options (e.g., whether page_id and page_name are mutually exclusive or complementary).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.4- First observed
sketch_html_analyze
TDQS
Scored across 1 tool
With only one tool in the set, there is no possibility of confusion or overlap with other tools within this server.
The single tool uses clear snake_case with a descriptive verb suffix, but with only one data point, a broader naming pattern cannot be established.
A single analysis tool is too few for the apparent scope implied by the server name 'mcp-sketch', suggesting a severely limited integration surface.
The server only supports analyzing HTML exports, lacking any functionality for creating, editing, or exporting native Sketch files, representing significant gaps for design workflow automation.
Maintenance
Related MCP Connectors
HTML-to-PDF MCP server — render pixel-faithful PDFs from HTML.
MCP server for web extraction and rendering via AceDataCloud WebExtrator
MCP server for visual regression testing: triage a PR's UI diffs from your coding agent.
MCP server to assist with JxBrowser development.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceMCP server to provide Sketch layout information to AI coding agents like Cursor4 npm72MIT
- AlicenseAqualityBmaintenanceLocal MCP server for Tencent CoDesign sharing links, exposing artboards, layer specs, preview images, and exported slices to support design-to-code workflows.851 npm14MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for ingesting UI screenshots, Figma MCP node JSON, or hybrid Figma-plus-screenshot sources into a cross-platform design-to-code artifact pipeline.119 npmMIT
- AlicenseNot gradedqualityBmaintenanceMCP server for the MiroMiro design-extraction API. It extracts real design data from live websites—including brand colors, fonts, tokens, SVGs, images, and component code—so AI agents can build from actual values.95 npmMIT