@mastergo/magic-mcp 0.0.4-beta.9 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,21 +1,19 @@
1
1
  # MasterGo Magic MCP
2
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mastergo-design/mastergo-magic-mcp)
2
3
 
3
4
  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.
4
5
 
5
6
  ## Key Features
6
-
7
7
  - Retrieves DSL data from MasterGo design files
8
8
  - Runs directly with npx
9
9
  - No external dependencies required, only Node.js environment needed
10
10
 
11
11
  ## Tutorial
12
-
13
12
  - https://mastergo.com/file/155675508499265?page_id=158:0002
14
13
 
15
14
  ## Usage
16
15
 
17
16
  ### Obtaining MG_MCP_TOKEN
18
-
19
17
  1. Visit https://mastergo.com
20
18
  2. Enter personal settings
21
19
  3. Click the Security Settings tab
@@ -23,26 +21,30 @@ MasterGo Magic MCP is a standalone MCP (Model Context Protocol) service designed
23
21
  5. Click to generate the token
24
22
 
25
23
  ### Command Line Options
26
-
27
24
  ```
28
25
  npx @mastergo/magic-mcp --token=YOUR_TOKEN [--url=API_URL] [--rule=RULE_NAME] [--debug]
29
26
  ```
30
27
 
31
28
  #### Parameters:
32
-
33
29
  - `--token=YOUR_TOKEN` (required): MasterGo API token for authentication
34
30
  - `--url=API_URL` (optional): API base URL, defaults to http://localhost:3000
35
31
  - `--rule=RULE_NAME` (optional): Add design rules to apply, can be used multiple times
36
32
  - `--debug` (optional): Enable debug mode for detailed error information
37
33
 
38
34
  You can also use space-separated format for parameters:
39
-
40
35
  ```
41
36
  npx @mastergo/magic-mcp --token YOUR_TOKEN --url API_URL --rule RULE_NAME --debug
42
37
  ```
43
38
 
44
- ### LINGMA Usage
39
+ ### Installing via Smithery
40
+
41
+ To install MasterGo Magic for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@mastergo-design/mastergo-magic-mcp):
42
+
43
+ ```bash
44
+ npx -y @smithery/cli install @mastergo-design/mastergo-magic-mcp --client claude
45
+ ```
45
46
 
47
+ ### LINGMA Usage
46
48
  Search for LINGMA in the VSCode extension marketplace and install it.
47
49
 
48
50
  <img src="https://github.com/mastergo-design/mastergo-magic-mcp/blob/main/images/image-20250507174245589.png" alt="image-20250507174245589" style="zoom:25%;" />
@@ -64,7 +66,6 @@ Finally, switch the chat mode to agent mode in the chat interface.
64
66
  <img src="https://github.com/mastergo-design/mastergo-magic-mcp/blob/main/images/image-20250507175107044.png" alt="image-20250507175107044" style="zoom:25%;" />
65
67
 
66
68
  ### cursor Usage
67
-
68
69
  Cursor Mcp usage guide reference: https://docs.cursor.com/context/model-context-protocol#using-mcp-tools-in-agent
69
70
 
70
71
  ```json
@@ -85,7 +86,6 @@ Cursor Mcp usage guide reference: https://docs.cursor.com/context/model-context-
85
86
  ```
86
87
 
87
88
  ### cline Usage
88
-
89
89
  ```json
90
90
  {
91
91
  "mcpServers": {
@@ -104,9 +104,7 @@ Cursor Mcp usage guide reference: https://docs.cursor.com/context/model-context-
104
104
  ```
105
105
 
106
106
  ## Project Structure
107
-
108
107
  ### src Directory
109
-
110
108
  The `src` directory contains the core implementation of the MasterGo Magic MCP service:
111
109
 
112
110
  - `index.ts`: Entry point of the application that initializes the MCP server and registers all tools
@@ -114,7 +112,6 @@ The `src` directory contains the core implementation of the MasterGo Magic MCP s
114
112
  - `types.d.ts`: TypeScript type definitions for the project
115
113
 
116
114
  #### src/tools
117
-
118
115
  Contains implementations of MCP tools:
119
116
 
120
117
  - `base-tool.ts`: Base class for all MCP tools
@@ -124,14 +121,12 @@ Contains implementations of MCP tools:
124
121
  - `get-component-workflow.ts`: Tool providing structured component development workflow for Vue and React components, generating workflow files and component specifications
125
122
 
126
123
  #### src/markdown
127
-
128
124
  Contains markdown files with additional documentation:
129
125
 
130
126
  - `meta.md`: Documentation about metadata structure and usage
131
127
  - `component-workflow.md`: Component development workflow documentation guiding structured component development process
132
128
 
133
129
  ## Local Development
134
-
135
130
  1. Run `yarn` and `yarn build` to install dependencies and build the code
136
131
  2. Find the absolute path of `bin/cli.js`
137
132
  3. Add local MCP configuration with your token
@@ -148,7 +143,6 @@ Contains markdown files with additional documentation:
148
143
  "env": {}
149
144
  },
150
145
  ```
151
-
152
146
  4. Restart your editor to ensure the local MCP is enabled
153
147
 
154
148
  After successful execution, you can debug based on the local running results. You can build your own MCP service based on your modifications.
@@ -156,5 +150,4 @@ After successful execution, you can debug based on the local running results. Yo
156
150
  We welcome your code contributions and look forward to building MasterGo's MCP service together.
157
151
 
158
152
  ## License
159
-
160
153
  ISC
package/README.zh-CN.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # MasterGo Magic MCP
2
2
 
3
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mastergo-design/mastergo-magic-mcp)
4
+
3
5
  MasterGo Magic MCP 是一个独立的 MCP(Model Context Protocol)服务,旨在连接 MasterGo 设计工具与 AI 模型。它使 AI 模型能够直接从 MasterGo 设计文件中获取 DSL 数据。
4
6
 
5
7
  ## 主要特性
package/bin/cli.js CHANGED
@@ -36,7 +36,7 @@ for (let i = 0; i < args.length; i++) {
36
36
  }
37
37
 
38
38
  // Check required arguments
39
- if (!token) {
39
+ if (!token && !process.env.MASTERGO_API_TOKEN) {
40
40
  console.error("Error: Missing MasterGo API Token");
41
41
  console.error(
42
42
  "Usage: npx mastergo-magic-mcp --token=YOUR_TOKEN [--url=API_URL] [--rule=RULE_NAME]"
@@ -47,8 +47,8 @@ if (!token) {
47
47
 
48
48
  // Set environment variables
49
49
  const env = {
50
- ...process.env,
51
50
  MASTERGO_API_TOKEN: token,
51
+ ...process.env,
52
52
  API_BASE_URL: baseUrl,
53
53
  DEBUG: debug ? "true" : "false",
54
54
  // Add RULES environment variable as stringified array