Home / MCP / MasterGo Magic MCP Server

MasterGo Magic MCP Server

Standalone MCP service that retrieves DSL data and metadata from MasterGo design files for AI models.

typescript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "mastergo_mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@mastergo/magic-mcp",
                "--token",
                "<MG_MCP_TOKEN>",
                "--url",
                "https://mastergo.com"
            ],
            "env": {
                "MG_MCP_TOKEN": "<YOUR_TOKEN>",
                "MASTERGO_API_TOKEN": "mg_xxxxxx",
                "API_BASE_URL": "https://mastergo.com"
            }
        }
    }
}

MasterGo Magic MCP is a standalone MCP service that connects MasterGo design tools with AI models. It enables AI models to directly retrieve DSL data from MasterGo design files, empowering automated workflows and smarter design tooling.

How to use

You run the MasterGo Magic MCP as a local MCP server and connect your MCP client to it. The server exposes a simple, standard interface that lets your client fetch DSL data, component metadata, and workflow guidance from MasterGo designs. Use it to supply AI models with up-to-date design data and structured component guidance during your development and design tasks.

How to install

Prerequisites: you need Node.js and npm installed on your system. You do not need any external dependencies beyond a Node.js environment.

# Install Node.js from https://nodejs.org and verify
node -v
npm -v

Install and run MasterGo Magic MCP using npx with your token and target API URL. You can pass the token and URL as command line arguments or set them via environment variables.

npx @mastergo/magic-mcp --token=YOUR_TOKEN --url=https://mastergo.com --debug

If you prefer to use environment variables, set MG_MCP_TOKEN (or MASTERGO_API_TOKEN) and API_BASE_URL, then run the MCP without repeating credentials in the command line.

export MG_MCP_TOKEN=YOUR_TOKEN
export API_BASE_URL=https://mastergo.com
npx @mastergo/magic-mcp --debug

Additional configuration notes

You can optionally add design rules to apply with the --rule option and enable or disable default rules with --no-rule. The --url parameter defaults to the MasterGo API base URL if you omit it.

For local development and testing, you may provide a token and URL in a configuration file or environment to ensure consistent startup across environments.

Configuration samples

# Command line usage example
npx @mastergo/magic-mcp --token=<MG_MCP_TOKEN> --url=https://mastergo.com --rule=lint --debug
# Environment-based usage example
export MG_MCP_TOKEN=<YOUR_TOKEN>
export API_BASE_URL=https://mastergo.com
npx @mastergo/magic-mcp --debug

Troubleshooting and tips

If you encounter authentication errors, verify that your token is correct and has the required permissions. Ensure the API base URL is reachable from your environment. Check the --debug flag for detailed error information and consult the logs emitted by the MCP service.

Security considerations

Keep your tokens secret and rotate them periodically. Do not hard-code tokens into source files or commit them to version control. Prefer environment variables or secure vaults in automated environments.

Notes

The MasterGo Magic MCP is designed to run in a Node.js environment and to operate without external dependencies beyond Node. It fetches data directly from MasterGo design files to supply AI models with DSL data and component information.

Available tools

base-tool.ts

Base class for all MCP tools providing common functionality and interfaces.

get-dsl.ts

Tool for retrieving DSL data from MasterGo design files.

get-component-link.ts

Tool for retrieving component documentation from links.

get-meta.ts

Tool for retrieving metadata information.

get-component-workflow.ts

Tool providing structured component development workflow for Vue and React components, generating workflow files and component specifications.