M

MasterGo设计协作工具

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

developer-tools

2.5w 查看 · 2026-07-07 更新

简介

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

简介

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

MasterGo Magic MCP

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

核心功能

  • 从 MasterGo 设计文件中检索 DSL 数据
  • 可通过 npx 直接运行
  • 不需要外部依赖,只需 Node.js 环境

教程

使用方法

获取 MG_MCP_TOKEN

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

命令行选项

npx @mastergo/magic-mcp --token=YOUR_TOKEN [--url=API_URL] [--rule=RULE_NAME] [--debug]

参数:

  • --token=YOUR_TOKEN (必需):用于身份验证的 MasterGo API 令牌
  • --url=API_URL (可选):API 基础 URL,默认为 http://localhost:3000
  • --rule=RULE_NAME (可选):添加要应用的设计规则,可以多次使用
  • --debug (可选):启用调试模式以获取详细错误信息

您还可以使用空格分隔格式来指定参数:

npx @mastergo/magic-mcp --token YOUR_TOKEN --url API_URL --rule RULE_NAME --debug

cursor 使用方法

Cursor Mcp 使用指南参考:https://docs.cursor.com/context/model-context-protocol#using-mcp-tools-in-agent

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

cline 使用方法

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

许可证

ISC

工具列表

  • mcp__getDsl: "Use this tool to retrieve the DSL (Domain Specific Language) data from MasterGo design files and the rules you must follow when generating code. This tool is useful when you need to analyze the structure of a design, understand component hierarchy, or extract design properties. You must provide a fileId and layerId to identify the specific design element. This tool returns the raw DSL data in JSON format that you can then parse and analyze. This tool also returns the rules you must follow when generating code. The DSL data can also be used to transform and generate code for different frameworks."

  • mcp__getComponentLink: When the data returned by mcp__getDsl contains a non-empty componentDocumentLinks array, this tool is used to sequentially retrieve URLs from the componentDocumentLinks array and then obtain component documentation data. The returned document data is used for you to generate frontend code based on components.

服务配置

[{'mcpServers': {'@master/mastergo-magic-mcp': {'args': ['-y', '@mastergo/magic-mcp', '--token=MG_MCP_TOKEN', '--url=https://mastergo.com'], 'command': 'npx', 'env': {}}}}]

来源