DA

dekdee/adobe-xd-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

21 stars 20 forks 质量 53 趋势 10

Adobe XD MCP

概览

一个模型上下文协议(MCP)服务器,使 Claude 能够与 Adobe XD 文件交互,提取设计信息,并从你的设计中生成 React 组件。 - : 从 XD 文件中提取包括美术板、组件和资源在内的全面信息 - : 将 XD 设计转换为带有多种样式选项的 React 组件 - : 提取多种格式(CSS、JSON、Tailwind)的色彩调色板 - : 支持有样式组件、Tailwind CSS 和 CSS 模块 - : 生成类型安全的 React 组件 - Node.js(v16及以上)- npm或纱线 - Claude桌面应用程序 将服务器添加到您的Claude桌面配置中: 编辑:~/Library/Application Support/Claude/claude_desktop_config.json 编辑:%APPDATA%\Claude\claude_desktop_config.json : 将 /absolute/path/to/adobe-xd-mcp 替换为你安装目录的实际路径。 配置并重启 Claude Desktop 后,您可以使用以下命令:

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,使 Claude 能够与 Adobe XD 文件交互,提取设计信息,并从你的设计中生成 React 组件。

特色

  • 文档分析:从XD文件中提取包括美术板、组件和资源在内的全面信息
  • React 组件生成:将 XD 设计转换为具有多种样式选项的 React 组件
  • 颜色提取:提取各种格式(CSS、JSON、Tailwind)的调色板
  • 多样式系统:支持样式组件、Tailwind CSS 和 CSS 模块
  • TypeScript 支持:生成类型安全 React 组件

先修条件

  • Node.js(v16或更高)
  • NPM或纱线
  • Claude桌面应用程序

安装

  1. 克隆仓库:

  2. 安装依赖:

  3. 搭建服务器:

配置

将服务器添加到您的Claude桌面配置中:

macOS

编辑:~/Library/Application Support/Claude/claude_desktop_config.json

Windows

编辑:%APPDATA%\Claude\claude_desktop_config.json

添加以下配置:

注意:将/absolute/path/to/adobe-xd-mcp替换为通往安装目录的实际路径。

用途

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Adobe XD MCP Server

A Model Context Protocol (MCP) server that enables Claude to interact with Adobe XD files, extract design information, and generate React components from your designs.

Features

  • Document Analysis: Extract comprehensive information from XD files including artboards, components, and assets
  • React Component Generation: Convert XD designs to React components with multiple styling options
  • Color Extraction: Extract color palettes in various formats (CSS, JSON, Tailwind)
  • Multiple Style Systems: Support for styled-components, Tailwind CSS, and CSS modules
  • TypeScript Support: Generate type-safe React components

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • Claude Desktop application

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/adobe-xd-mcp.git
cd adobe-xd-mcp
  1. Install dependencies:
npm install
  1. Build the server:
npm run build

Configuration

Add the server to your Claude Desktop configuration:

macOS

Edit: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows

Edit: %APPDATA%\Claude\claude_desktop_config.json

Add the following configuration:

{
  "mcpServers": {
    "adobe-xd": {
      "command": "node",
      "args": ["/absolute/path/to/adobe-xd-mcp/dist/index.js"]
    }
  }
}

Note: Replace /absolute/path/to/adobe-xd-mcp with the actual path to your installation directory.

Usage

After configuring and restarting Claude Desktop, you can use the following commands:

Get XD Document Information

Ask Claude to analyze your XD file:

"Get information about the XD file at /path/to/your/design.xd"

This returns:

  • Document name and dimensions
  • List of artboards with sizes
  • Components and their element counts

Generate React Components

Convert XD designs to React components:

"Generate a React component from the LoginScreen artboard in /path/to/design.xd"

Options:

  • artboardName: Specific artboard to convert (optional)
  • componentName: Custom component name (optional)
  • outputDir: Output directory (optional, defaults to ./generated)
  • styleSystem: Choose from “styled-components”, “tailwind”, or “css-modules”
  • typescript: Generate TypeScript components (true/false)

Extract Colors

Extract color palettes from your designs:

"Extract colors from /path/to/design.xd and save as CSS variables"

Options:

  • format: Output format - “css”, “json”, or “tailwind”
  • outputFile: Save to file instead of displaying output

Examples

Example 1: Generate a TypeScript React component with Tailwind

"Generate a React component from the Header artboard in design.xd using TypeScript and Tailwind CSS"

Example 2: Extract colors as Tailwind config

"Extract colors from design.xd in Tailwind format and save to colors.js"

Example 3: Get overview of all components

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "adobe-xd": { "command": "node", "args": ["/absolute/path/to/adobe-xd-mcp/dist/index.js"] } } }