MD

mastergo-design/mastergo-magic-mcp

开发工具官方

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

286 stars 51 forks 质量 83 趋势 39

MasterGo Magic MCP 是一个独立的 MCP(模型上下文协议)服务,旨在连接 MasterGo 设计工具与 AI 模型。

概览

MasterGo Magic MCP 是一个独立的 MCP(模型上下文协议)服务,旨在连接 MasterGo 设计工具与 AI 模型。它使 AI 模型能够直接从 MasterGo 设计文件中检索 DSL 数据。 - 从 MasterGo 设计文件中检索 DSL 数据 - 直接与 npx 运行 - 无需外部依赖,只需Node.js环境 - https://mastergo.com/file/192644601973042 一旦MCP服务器连接完成,你可以在AI聊天中使用以下提示: 用你的实际值替换{domain}、{fileId}和{layerId}。你也可以使用简短链接: 1. 访问https://mastergo.com 2.进入个人设置 3.点击安全设置标签 4.查找个人访问令牌 5.点击生成令牌 :如果工具已连接但返回“无权限”错误,请检查以下条件: 1. : - 需要或更高级别的MasterGo账户 - 个人免费版不支持MCP工具访问

概述(AI 翻译)

MasterGo Magic MCP 是一个独立的 MCP(模型上下文协议)服务,旨在连接 MasterGo 设计工具与 AI 模型。它使 AI 模型能够直接从 MasterGo 设计文件中检索 DSL 数据。

主要特色

  • 从 MasterGo 设计文件中检索 DSL 数据
  • 直接与NPX运行
  • 无需外部依赖,只需Node.js环境

教程

示例提示

一旦MCP服务器连接完成,你可以在AI聊天中使用以下提示:

提取SVG并预览HTML中:

将设计恢复到规范中:

将{domain}、{fileId}和{layerId}替换为你的实际值。你也可以使用短链接:

恢复设计并保存为HTML文件:

你也可以使用简短的链接:

用途

获取MG_MCP_TOKEN

  1. 访问https://mastergo.com
  2. 进入个人设置
  3. 点击安全设置标签
  4. 查找个人访问令牌
  5. 点击生成令牌

许可要求

重要:如果工具已连接但返回“无权限”错误,请检查以下条件:

  1. 账户版本要求:

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

README

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

MasterGo Magic MCP

MasterGo Magic MCP is a standalone MCP (Model Context Protocol) service designed to connect MasterGo design tools with AI models. It enables AI models to directly retrieve DSL data from MasterGo design files.

Key Features

  • Retrieves DSL data from MasterGo design files
  • Runs directly with npx
  • No external dependencies required, only Node.js environment needed

Tutorial

Example Prompts

Once the MCP server is connected, you can use the following prompts in your AI chat:

Extract SVG and preview in HTML:

Extract SVG and preview in HTML: https://{domain}/file/{fileId}?layer_id={layerId}

Restore a design to code:

Restore design: https://{domain}/file/{fileId}?layer_id={layerId}

Replace {domain}, {fileId}, and {layerId} with your actual values. You can also use short links:

Restore design: https://{domain}/goto/{shortLink}

Restore a design and save as an HTML file:

Restore design, save as HTML file: https://{domain}/file/{fileId}?layer_id={layerId}

You can also use short links:

Restore design, save as HTML file: https://{domain}/goto/{shortLink}

Usage

Obtaining MG_MCP_TOKEN

  1. Visit https://mastergo.com
  2. Enter personal settings
  3. Click the Security Settings tab
  4. Find the personal access token
  5. Click to generate the token

Permission Requirements

Important: If the tool is connected but returns a “no permission” error, please check the following conditions:

  1. Account Version Requirement:

    • Requires Team Edition or higher MasterGo account
    • Personal free edition does not support MCP tool access
  2. File Location Requirement:

    • Design files must be placed in Team Projects
    • Files in draft box cannot be accessed via MCP tools

Command Line Options

npx @mastergo/magic-mcp --token=YOUR_TOKEN [--url=API_URL] [--rule=RULE_NAME] [--proxy=PROXY_URL] [--format=FORMAT] [--header "Key: Value"] [--debug] [--no-rule] [--no-prefix]

Parameters:

  • --token=YOUR_TOKEN (required): MasterGo API token for authentication
  • --url=API_URL (optional): API base URL, defaults to http://localhost:3000
  • --rule=RULE_NAME (optional): Add design rules to apply, can be used multiple times
  • --proxy=PROXY_URL (optional): HTTP/HTTPS proxy URL (e.g., http://127.0.0.1:7890), also supports HTTPS_PROXY / HTTP_PROXY environment variables
在 GitHub 查看完整 README

安装

npx -y @mastergo/magic-mcp --token=<YOUR_TOKEN> --url=https://mastergo.com
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mastergo-magic-mcp": { "command": "npx", "args": [ "-y", "@mastergo/magic-mcp", "--token=<YOUR_TOKEN>", "--url=https://mastergo.com" ], "env": {} } } }