mastergo magic mcp

Local 2025-08-31 23:26:07 0

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.


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

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

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

Command Line Options

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

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
  • --debug (optional): Enable debug mode for detailed error information

You can also use space-separated format for parameters:

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

cursor Usage

Cursor Mcp usage guide reference: 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 Usage

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

License

ISC

[
  {
    "description": "n"Use this tool to retrieve the DSL (Domain Specific Language) data from MasterGo design files and the rules you must follow when generating code.nThis tool is useful when you need to analyze the structure of a design, understand component hierarchy, or extract design properties.nYou must provide a fileId and layerId to identify the specific design element.nThis tool returns the raw DSL data in JSON format that you can then parse and analyze.nThis tool also returns the rules you must follow when generating code.nThe DSL data can also be used to transform and generate code for different frameworks."n",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "fileId": {
          "description": "MasterGo design file ID (format: file/<fileId> in MasterGo URL)",
          "type": "string"
        },
        "layerId": {
          "description": "Layer ID of the specific component or element to retrieve (format: ?layer_id=<layerId> / file=<fileId> in MasterGo URL)",
          "type": "string"
        }
      },
      "required": [
        "fileId",
        "layerId"
      ],
      "type": "object"
    },
    "name": "mcp__getDsl"
  },
  {
    "description": "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.",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "url": {
          "description": "Component documentation link URL, from the componentDocumentLinks property, please ensure the URL is valid",
          "type": "string"
        }
      },
      "required": [
        "url"
      ],
      "type": "object"
    },
    "name": "mcp__getComponentLink"
  }
]