首页
学习
活动
专区
圈层
工具
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
首页
学习
活动
专区
圈层
工具
MCP广场
MCP广场 >详情页
mastergo-magic-mcp云托管模式2025-06-165分享
github
MasterGo Magic MCP是一个独立的MCP(模型上下文协议)服务,旨在将MasterGo设计工具与AI模型连接起来。它使AI模型能够直接从MasterGo设计文件中检索DSL数据。
By mastergo-design
2025-06-165
github
详情内容

MasterGo Magic MCP

Ask DeepWiki

MasterGo Magic MCP 是一款独立的 MCP(模型上下文协议)服务,用于连接 MasterGo 设计工具和 AI 模型。它允许 AI 模型直接从 MasterGo 设计文件中检索 DSL 数据。

主要功能

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

教程

  • https://mastergo.com/file/155675508499265?page_id=158:0002

使用方法

获取 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

LINGMA 使用方法

在 VSCode 扩展市场搜索 LINGMA 并安装。

image-20250507174245589

登录后,在聊天框点击[MCP tools]。

image-20250507174511910

点击顶部的[MCP Square]进入MCP市场,找到MasterGo设计协作工具并安装。

image-20250507174840456

安装完成后,返回[MCP Servers],编辑我们的MCP服务,将其替换为您的MasterGo token。

image-20250507175005364

最后,在聊天界面将聊天模式切换到agent模式。

image-20250507175107044

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": {}
    }
  }
}

项目结构

src 目录

src 目录包含 MasterGo Magic MCP 服务的核心实现:

  • index.ts:应用程序的入口点,初始化 MCP 服务器并注册所有工具
  • http-util.ts:用于处理 MasterGo API 的 HTTP 请求的工具函数
  • types.d.ts:项目的 TypeScript 类型定义

src/tools

包含 MCP 工具的实现:

  • base-tool.ts:所有 MCP 工具的基类
  • get-dsl.ts:从 MasterGo 设计文件中检索 DSL(领域特定语言)数据的工具
  • get-component-link.ts:从链接中检索组件文档的工具
  • get-meta.ts:用于检索元数据信息的工具
  • get-component-workflow.ts:为 Vue 和 React 组件提供结构化组件开发工作流程的工具,生成工作流程文件和组件规范

src/markdown

包含附加文档的 Markdown 文件:

  • meta.md:关于元数据结构和用法的文档
  • component-workflow.md:组件开发工作流程文档,指导结构化组件开发流程

本地开发

  1. 运行 yarnyarn build 来安装依赖项并构建代码
  2. 找到 bin/cli.js 的绝对路径
  3. 使用你的 token 添加本地 MCP 配置
"mastergo-mcp-local": {
  "command": "node",
  "args": [
    "absolute/path/to/bin/cli.js",
    "--token=mg_xxxxxx",
    "--url=https://mastergo.com",
    "--debug"
  ],
  "env": {}
},
  1. 重启编辑器以确保本地 MCP 已启用

执行成功后,您可以基于本地运行结果进行调试。您可以根据您的修改构建您自己的 MCP 服务。

我们欢迎您的代码贡献,并期待与您一起构建 MasterGo 的 MCP 服务。

许可证

ISC

通过SSE URL连接服务
Server已在腾讯云托管,可在连接后免费调用和在线进行工具测试~
工具测试
已支持Server下的5个工具,可选择工具进行在线测试
mcp__getComponentGenerator
Users need to actively call this tool to get the component development workflow. When Generator is mentioned, please actively call this tool. This tool provides a structured workflow for component development following best practices. You must provide an absolute rootPath of workspace to save workflow files.
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.
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__getMeta
Use this tool when the user intends to build a complete website or needs to obtain high-level site configuration information. You must provide a fileld and layerld to identify the specific design element. This tool returns the rules and results of the site and page. The rules is a markdown file, you must follow the rules and use the results to analyze the site and page.
version_0.0.4-beta.11
the current version is 0.0.4-beta.11
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档