Sketch logo

Sketch

Community
mater1996

sketch-mcp-server

Publishermater1996
Repositorysketch-mcp-server
LanguageTypeScript
Forks
7
Stars
19
Available tools
17
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Sketch exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 17 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    19 stars and 7 forks from the linked repository.

Sketch MCP Server

English | 中文

A Sketch file processing server based on Model Context Protocol (MCP), designed for AI tools to intelligently analyze Sketch design files and generate code.

✨ Core Features

  • 🎨 Sketch File Analysis: Comprehensive parsing of Sketch files, extracting nodes, styles, hierarchies, and complete information
  • 🚀 Smart Token Optimization: Up to 90% token consumption reduction, significantly lowering AI call costs
  • 🔍 Intelligent Query System: 16 professional tools for efficient discovery and analysis of design elements
  • 🎯 Symbol Component Support: Complete Symbol Master and Instance processing capabilities
  • 🖼️ Visual Rendering: Render design nodes as SVG/PNG images for AI analysis
  • 📊 Detailed Statistical Analysis: Comprehensive statistics for documents and nodes
  • 🔧 CLI Tool Support: Support for direct npx calls without installation

📦 Installation

Global Installation (Recommended)

bash
npm install -g sketch-mcp-server

Using npx (No Installation Required)

bash
npx sketch-mcp-server

Local Project Installation

bash
npm install sketch-mcp-server

🚀 Quick Start

Command Line Launch

bash
# Start MCP server (stdio mode)
sketch-mcp-server

# Or use npx
npx sketch-mcp-server

AI Tool Integration

This server is designed for the following AI development environments:

  • Trae AI: As an MCP server for Sketch file analysis
  • Cursor: Configure as MCP tool for design-to-code workflow
  • Claude Desktop: For Sketch file processing and analysis

Trae AI Configuration Example

Add MCP server configuration in Trae AI:

json
{
  "mcpServers": {
    "sketch-mcp-server": {
      "command": "npx",
      "args": ["sketch-mcp-server"]
    }
  }
}

🛠️ Tool List

📁 File Loading Tools

Tool NameDescription
loadSketchByPathLoad Sketch file from file system
loadSketchByConfigLoad Sketch data from configuration object

📊 Document Structure Tools

Tool NameDescriptionOptimization Features
getDocumentStructureGet complete document hierarchy🚀 Supports field filtering and summary mode
getPageStructureGet single page structure-
listPagesList all page basic information-

🎯 Node Query Tools

Tool NameDescriptionToken Optimization
getNodesSummarySmart Node Summary🔥 80-90% Token Reduction
listNodesList nodes (with filtering support)-
listNodesByPageList nodes by page-
findNodesByNameSearch nodes by name-

🔍 Detailed Information Tools

Tool NameDescription
getNodeInfoGet detailed information for single node
getMultipleNodeInfoBatch get node information (up to 100)
getNodePositionGet node position information

🔄 Symbol Component Tools

Tool NameDescription
getSymbolMastersGet all Symbol Masters
getSymbolInstancesGet all Symbol Instances
getSymbolMasterBySymbolIDFind Master by Symbol ID
getSymbolInstanceStylesGet instance styles (including override styles)

🎨 Visualization Tools

Tool NameDescription
renderNodeAsBase64Render node as image (SVG/PNG)

💡 Token Optimization Strategy

Data Volume Comparison

Tool/ModeToken ReductionUse Case
getNodesSummary80-90%Initial analysis, understanding overall structure
getDocumentStructure (summary mode)70-85%Quick document structure overview
getDocumentStructure (field filtering)30-50%Structural analysis
Full mode0%Detailed design requirements

Recommended Workflow

  1. 🔍 Quick Analysis: Use getNodesSummary to understand overall design structure
  2. 📋 Structure Analysis: Use field-filtered getDocumentStructure to get hierarchical relationships
  3. 🎯 Detailed Information: Get detailed information for specific nodes as needed
  4. 👁️ Visual Verification: Render key components to confirm effects

📝 Usage Examples

Basic Workflow

javascript
// 1. Load Sketch file
{
  "name": "loadSketchByPath",
  "arguments": {
    "path": "/path/to/design.sketch"
  }
}

// 2. Get smart summary (save 80-90% tokens)
{
  "name": "getNodesSummary",
  "arguments": {
    "groupBy": "type",
    "includeStats": true,
    "maxSamples": 5
  }
}

// 3. Get detailed information for specific nodes
{
  "name": "getMultipleNodeInfo",
  "arguments": {
    "nodeIds": ["button-id", "text-id"]
  }
}

// 4. Render node as image
{
  "name": "renderNodeAsBase64",
  "arguments": {
    "nodeId": "button-id",
    "format": "svg"
  }
}

Advanced Optimization Examples

javascript
// Use field filtering to reduce data volume
{
  "name": "getDocumentStructure",
  "arguments": {
    "fields": ["id", "name", "type", "children"],
    "maxDepth": 3,
    "summaryMode": false
  }
}

// Smart summary grouped by style
{
  "name": "getNodesSummary",
  "arguments": {
    "groupBy": "style",
    "includeStats": true,
    "maxSamples": 3
  }
}

🎯 Tool Selection Guide

Use CaseRecommended ToolToken EfficiencyDescription
Understanding overall structuregetNodesSummary⭐⭐⭐⭐⭐Most efficient overview method
Analyzing page hierarchygetDocumentStructure (filtered)⭐⭐⭐⭐Structured hierarchical information
Finding specific nodesfindNodesByName⭐⭐⭐Precise search
Getting detailed informationgetMultipleNodeInfo⭐⭐Batch retrieval
Handling Symbol componentsgetSymbolMasters⭐⭐⭐Component-based design
Visual confirmationrenderNodeAsBase64⭐⭐Intuitive effect viewing

🔧 Development Guide

Environment Requirements

  • Node.js >= 16.0.0
  • npm or yarn

Local Development

bash
# Clone project
git clone https://github.com/mater1996/sketch-mcp-server.git
cd sketch-mcp-server

# Install dependencies
npm install

# Build project
npm run build

# Run tests
npm test

# Start development server
npm run start:mcp

Available Scripts

bash
npm run build          # Build TypeScript to JavaScript
npm run test           # Run test suite
npm run test:coverage  # Run tests and generate coverage report
npm run start          # Start HTTP server
npm run start:mcp      # Start MCP stdio server
npm run release        # Release new version
npm run release:dry    # Simulate release process

📚 API Reference

For detailed API documentation, please refer to Tool Usage Guide.

Development Standards

  • Write code in TypeScript
  • Follow existing code style
  • Add tests for new features
  • Update relevant documentation

📄 License

MIT License

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📞 Support

If you encounter any issues or have questions, please:

  1. Check the documentation
  2. Search existing issues
  3. Create a new issue if needed

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "sketch-mcp-server": {
      "command": "npx",
      "args": [
        "sketch-mcp-server"
      ]
    }
  }
}

Available Tools

  • getNodePosition

    Get the position of a node by its ID

  • getNodeInfo

    Get detailed information about a node by its ID

  • findNodesByName

    Find nodes by name pattern

  • listPages

    List all pages in the Sketch document

  • listNodes

    List nodes with optional filtering

  • listNodesByPage

    List nodes within a specific page

  • loadSketchByPath

    Load a Sketch file from a file path

  • loadSketchByConfig

    Load a Sketch configuration object

  • getMultipleNodeInfo

    Get detailed information for multiple nodes by their IDs in a single call

  • getPageStructure

    Get complete hierarchical structure of a page with all node information

  • getDocumentStructure

    Get complete document structure with all pages and their hierarchies

  • getSymbolMasters

    Get all Symbol Masters in the Sketch document

  • getSymbolInstances

    Get all Symbol Instances in the Sketch document

  • getSymbolMasterBySymbolID

    Get Symbol Master by its Symbol ID

  • getSymbolInstanceStyles

    Get styles from Symbol Instance including overrides applied to Symbol Master

  • getNodesSummary

    Get summary of nodes with statistics and grouping to reduce token usage

  • renderNodeAsBase64

    Render a node as Base64 encoded image (SVG format) for AI to visualize the actual appearance

Use Sketch MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Sketch is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Sketch as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Sketch MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "sketch": {
      "command": "npx",
      "args": [
        "-y",
        "sketch-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Sketch MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Sketch MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Sketch to help me with this task?
Sketch
Sure. I read it.
Here is what I found using Sketch.

Frequently asked questions

What is the Sketch MCP server used for?

Sketch is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Sketch MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Sketch with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Sketch MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Sketch connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Sketch MCP to TypingMind?

Sketch runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Sketch MCP provide in TypingMind?

Sketch exposes 17 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Sketch MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Sketch requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇