@mastergo/magic-mcp 0.1.9-alpha.0 → 0.2.0

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
@@ -14,6 +14,40 @@ MasterGo Magic MCP is a standalone MCP (Model Context Protocol) service designed
14
14
 
15
15
  - [https://mastergo.com/file/192644601973042](https://mastergo.com/file/192644601973042)
16
16
 
17
+ ## Example Prompts
18
+
19
+ Once the MCP server is connected, you can use the following prompts in your AI chat:
20
+
21
+ **Extract SVG and preview in HTML:**
22
+
23
+ ```
24
+ Extract SVG and preview in HTML: https://{domain}/file/{fileId}?layer_id={layerId}
25
+ ```
26
+
27
+ **Restore a design to code:**
28
+
29
+ ```
30
+ Restore design: https://{domain}/file/{fileId}?layer_id={layerId}
31
+ ```
32
+
33
+ Replace `{domain}`, `{fileId}`, and `{layerId}` with your actual values. You can also use short links:
34
+
35
+ ```
36
+ Restore design: https://{domain}/goto/{shortLink}
37
+ ```
38
+
39
+ **Restore a design and save as an HTML file:**
40
+
41
+ ```
42
+ Restore design, save as HTML file: https://{domain}/file/{fileId}?layer_id={layerId}
43
+ ```
44
+
45
+ You can also use short links:
46
+
47
+ ```
48
+ Restore design, save as HTML file: https://{domain}/goto/{shortLink}
49
+ ```
50
+
17
51
  ## Usage
18
52
 
19
53
  ### Obtaining MG_MCP_TOKEN
@@ -115,7 +149,7 @@ You can configure the MCP server using either command line arguments or environm
115
149
  "args": [
116
150
  "-y",
117
151
  "@mastergo/magic-mcp",
118
- "--token=<MG_MCP_TOKEN>",
152
+ "--token=<YOUR_TOKEN>",
119
153
  "--url=https://mastergo.com"
120
154
  ],
121
155
  "env": {}
@@ -141,6 +175,24 @@ You can configure the MCP server using either command line arguments or environm
141
175
  }
142
176
  ```
143
177
 
178
+ **Option 3: Using SSE (Streamable HTTP)**
179
+
180
+ No local installation required. The MCP server runs remotely and is accessed via SSE:
181
+
182
+ ```json
183
+ {
184
+ "mcpServers": {
185
+ "mastergo-magic-mcp": {
186
+ "type": "http",
187
+ "url": "https://mastergo.com/mcp/xf/sse",
188
+ "headers": {
189
+ "x-mg-useraccesstoken": "<YOUR_TOKEN>"
190
+ }
191
+ }
192
+ }
193
+ }
194
+ ```
195
+
144
196
  ### cline Usage
145
197
 
146
198
  **Option 1: Using command line arguments**
@@ -153,7 +205,7 @@ You can configure the MCP server using either command line arguments or environm
153
205
  "args": [
154
206
  "-y",
155
207
  "@mastergo/magic-mcp",
156
- "--token=<MG_MCP_TOKEN>",
208
+ "--token=<YOUR_TOKEN>",
157
209
  "--url=https://mastergo.com"
158
210
  ],
159
211
  "env": {}
@@ -179,6 +231,31 @@ You can configure the MCP server using either command line arguments or environm
179
231
  }
180
232
  ```
181
233
 
234
+ ### Open Code Usage
235
+
236
+ Open Code uses a `mcp` configuration block with `type: "local"` and `command` array:
237
+
238
+ ```json
239
+ {
240
+ "mcp": {
241
+ "mastergo-magic-mcp": {
242
+ "type": "local",
243
+ "command": [
244
+ "npx",
245
+ "-y",
246
+ "@mastergo/magic-mcp",
247
+ "--token=<YOUR_TOKEN>",
248
+ "--url=https://mastergo.com"
249
+ ],
250
+ "environment": {
251
+ "NPM_CONFIG_REGISTRY": "https://registry.npmjs.org/"
252
+ },
253
+ "enabled": true
254
+ }
255
+ }
256
+ }
257
+ ```
258
+
182
259
  ## Project Structure
183
260
 
184
261
  ### src Directory
package/README.zh-CN.md CHANGED
@@ -14,6 +14,40 @@ MasterGo Magic MCP 是一个独立的 MCP(Model Context Protocol)服务,
14
14
 
15
15
  - [https://mastergo.com/file/192644601973042](https://mastergo.com/file/192644601973042)
16
16
 
17
+ ## 示例提示词
18
+
19
+ MCP 服务连接成功后,可以在 AI 对话中使用以下提示词:
20
+
21
+ **提取 SVG,放到 html 中预览:**
22
+
23
+ ```
24
+ 提取 SVG,放到 html 中预览:https://{domain}/file/{fileId}?layer_id={layerId}
25
+ ```
26
+
27
+ **还原设计稿为代码:**
28
+
29
+ ```
30
+ 还原设计稿:https://{domain}/file/{fileId}?layer_id={layerId}
31
+ ```
32
+
33
+ 将 `{domain}`、`{fileId}`、`{layerId}` 替换为实际值。也可以使用短链接:
34
+
35
+ ```
36
+ 还原设计稿:https://{domain}/goto/{shortLink}
37
+ ```
38
+
39
+ **还原设计稿并保存为 HTML 文件:**
40
+
41
+ ```
42
+ 还原设计稿,保存为 html 文件:https://{domain}/file/{fileId}?layer_id={layerId}
43
+ ```
44
+
45
+ 也可以使用短链接:
46
+
47
+ ```
48
+ 还原设计稿,保存为 html 文件:https://{domain}/goto/{shortLink}
49
+ ```
50
+
17
51
  ## 使用方法
18
52
 
19
53
  ### 获取 MG_MCP_TOKEN
@@ -114,7 +148,7 @@ Cursor Mcp 使用指南参考:https://docs.cursor.com/context/model-context-pr
114
148
  "args": [
115
149
  "-y",
116
150
  "@mastergo/magic-mcp",
117
- "--token=<MG_MCP_TOKEN>",
151
+ "--token=<YOUR_TOKEN>",
118
152
  "--url=https://mastergo.com"
119
153
  ],
120
154
  "env": {}
@@ -140,6 +174,24 @@ Cursor Mcp 使用指南参考:https://docs.cursor.com/context/model-context-pr
140
174
  }
141
175
  ```
142
176
 
177
+ **方式三:使用 SSE(Streamable HTTP)**
178
+
179
+ 无需本地安装,MCP 服务在远端运行,通过 SSE 访问:
180
+
181
+ ```json
182
+ {
183
+ "mcpServers": {
184
+ "mastergo-magic-mcp": {
185
+ "type": "http",
186
+ "url": "https://mastergo.com/mcp/xf/sse",
187
+ "headers": {
188
+ "x-mg-useraccesstoken": "<YOUR_TOKEN>"
189
+ }
190
+ }
191
+ }
192
+ }
193
+ ```
194
+
143
195
  ### cline 使用方法
144
196
 
145
197
  **方式一:使用命令行参数**
@@ -152,7 +204,7 @@ Cursor Mcp 使用指南参考:https://docs.cursor.com/context/model-context-pr
152
204
  "args": [
153
205
  "-y",
154
206
  "@mastergo/magic-mcp",
155
- "--token=<MG_MCP_TOKEN>",
207
+ "--token=<YOUR_TOKEN>",
156
208
  "--url=https://mastergo.com"
157
209
  ],
158
210
  "env": {}
@@ -178,6 +230,31 @@ Cursor Mcp 使用指南参考:https://docs.cursor.com/context/model-context-pr
178
230
  }
179
231
  ```
180
232
 
233
+ ### Open Code 使用方法
234
+
235
+ Open Code 使用 `mcp` 配置块,通过 `type: "local"` 和 `command` 数组来配置:
236
+
237
+ ```json
238
+ {
239
+ "mcp": {
240
+ "mastergo-magic-mcp": {
241
+ "type": "local",
242
+ "command": [
243
+ "npx",
244
+ "-y",
245
+ "@mastergo/magic-mcp",
246
+ "--token=<YOUR_TOKEN>",
247
+ "--url=https://mastergo.com"
248
+ ],
249
+ "environment": {
250
+ "NPM_CONFIG_REGISTRY": "https://registry.npmjs.org/"
251
+ },
252
+ "enabled": true
253
+ }
254
+ }
255
+ }
256
+ ```
257
+
181
258
  ## 项目结构
182
259
 
183
260
  ### src 目录