schemeog-mcp 3.8.0 → 3.9.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.
Files changed (3) hide show
  1. package/index.js +21 -19
  2. package/package.json +1 -1
  3. package/README.md +0 -368
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * SchemeOG MCP Server v3.8.0
4
+ * SchemeOG MCP Server v3.8.1
5
5
  *
6
6
  * MCP сервер для работы со схемами, проектами и тегами в SchemeOG Cloud.
7
7
  *
@@ -37,7 +37,8 @@ import {
37
37
  CallToolRequestSchema,
38
38
  ListToolsRequestSchema,
39
39
  } from "@modelcontextprotocol/sdk/types.js";
40
- import { readFileSync } from "fs";
40
+ import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
41
+ import { dirname } from "path";
41
42
 
42
43
  // Конфигурация
43
44
  const API_BASE_URL = process.env.SCHEMEOG_API_URL || "https://diagrams.love";
@@ -216,8 +217,16 @@ function generateId() {
216
217
 
217
218
  /**
218
219
  * Допустимые именованные цвета для элементов
220
+ * Включает:
221
+ * - Fill colors (light_*): используются для заливки карточек
222
+ * - Border colors (blue, green, etc.): используются для цвета обводки в app.js
219
223
  */
220
- const VALID_COLORS = ["white", "light_blue", "light_green", "light_yellow", "light_orange", "light_red", "light_purple", "light_gray", "light_pink", "light_teal"];
224
+ const VALID_COLORS = [
225
+ // Fill colors (background)
226
+ "white", "light_blue", "light_green", "light_yellow", "light_orange", "light_red", "light_purple", "light_gray", "light_pink", "light_teal",
227
+ // Border colors (stroke) - совместимость с app.js CARD_COLORS
228
+ "default", "blue", "green", "orange", "purple", "red", "teal", "yellow", "gray", "black"
229
+ ];
221
230
 
222
231
  /**
223
232
  * Маппинг HEX цветов к именованным (ближайшее соответствие)
@@ -541,8 +550,7 @@ Use this command to see what schemas the user has.`,
541
550
  "id": "unique_id",
542
551
  "type": "card", // card или condition
543
552
  "title": "Название", // заголовок
544
- "color": "light_blue", // ТОЛЬКО: white, light_blue, light_green, light_yellow, light_orange, light_red, light_purple, light_gray, light_pink, light_teal
545
- "borderColor": "blue", // default, blue, green, orange, purple, red, teal, yellow, gray, black
553
+ "color": "blue", // Цвет: default, blue, green, orange, purple, red, teal, yellow, gray, black, white, light_blue, light_green, light_yellow, light_orange, light_red, light_purple, light_gray, light_pink, light_teal
546
554
  "description": "Текст", // описание
547
555
  "tags": ["тег1"], // массив тегов
548
556
  "connections": [{"to": "target_id", "label": "подпись"}] // исходящие связи
@@ -612,8 +620,7 @@ Element format:
612
620
  "id": "unique_id", // unique ID
613
621
  "type": "card", // card, condition (diamond), or ascii (ASCII diagram card)
614
622
  "title": "Title", // card title
615
- "color": "light_blue", // background: white, light_blue, light_green, light_yellow, light_orange, light_red, light_purple, light_gray, light_pink, light_teal
616
- "borderColor": "blue", // border: default, blue, green, orange, purple, red, teal, yellow, gray, black
623
+ "color": "blue", // Color: default, blue, green, orange, purple, red, teal, yellow, gray, black, white, light_blue, light_green, light_yellow, light_orange, light_red, light_purple, light_gray, light_pink, light_teal
617
624
  "tags": ["tag1"], // tag names array (optional)
618
625
  "description": "Desc", // detailed description (optional)
619
626
  "asciiContent": "...", // ASCII diagram content (REQUIRED for type: "ascii")
@@ -629,7 +636,7 @@ Example:
629
636
  "type": "ascii",
630
637
  "title": "Request Flow",
631
638
  "asciiContent": "┌─────────┐ ┌─────────┐\\n│ Request │────▶│ Process │\\n└─────────┘ └─────────┘",
632
- "borderColor": "purple"
639
+ "color": "purple"
633
640
  }
634
641
 
635
642
  СВЯЗИ (inline формат — внутри элемента):
@@ -684,8 +691,7 @@ Example:
684
691
  id: { type: "string" },
685
692
  type: { type: "string", enum: ["card", "condition"] },
686
693
  title: { type: "string" },
687
- color: { type: "string", enum: ["white", "light_blue", "light_green", "light_yellow", "light_orange", "light_red", "light_purple", "light_gray", "light_pink", "light_teal"] },
688
- borderColor: { type: "string", enum: ["default", "blue", "green", "orange", "purple", "red", "teal", "yellow", "gray", "black"] },
694
+ color: { type: "string", enum: ["default", "blue", "green", "orange", "purple", "red", "teal", "yellow", "gray", "black", "white", "light_blue", "light_green", "light_yellow", "light_orange", "light_red", "light_purple", "light_gray", "light_pink", "light_teal"] },
689
695
  tags: { type: "array", items: { type: "string" } },
690
696
  description: { type: "string" },
691
697
  },
@@ -741,8 +747,7 @@ Claude обрезает большие параметры, но file_path чит
741
747
  "id": "unique_id",
742
748
  "type": "card", // card или condition
743
749
  "title": "Название",
744
- "color": "light_blue", // white, light_blue, light_green, light_yellow, light_orange, light_red, light_purple, light_gray, light_pink, light_teal
745
- "borderColor": "blue", // default, blue, green, orange, purple, red, teal, yellow, gray, black
750
+ "color": "blue", // Цвет: default, blue, green, orange, purple, red, teal, yellow, gray, black, white, light_blue, light_green, light_yellow, light_orange, light_red, light_purple, light_gray, light_pink, light_teal
746
751
  "tags": ["тег1"],
747
752
  "description": "Описание",
748
753
  "connections": [{"to": "target_id", "label": "подпись"}] // ИСХОДЯЩИЕ СВЯЗИ внутри элемента
@@ -2333,18 +2338,15 @@ export_schema_to_json(
2333
2338
 
2334
2339
  // Если указан file_path — сохраняем в файл
2335
2340
  if (file_path) {
2336
- const fs = require('fs');
2337
- const path = require('path');
2338
-
2339
2341
  // Создаём директорию если не существует
2340
- const dir = path.dirname(file_path);
2341
- if (!fs.existsSync(dir)) {
2342
- fs.mkdirSync(dir, { recursive: true });
2342
+ const dir = dirname(file_path);
2343
+ if (!existsSync(dir)) {
2344
+ mkdirSync(dir, { recursive: true });
2343
2345
  }
2344
2346
 
2345
2347
  // Сохраняем JSON в файл
2346
2348
  const jsonContent = JSON.stringify(exportData, null, 2);
2347
- fs.writeFileSync(file_path, jsonContent, 'utf8');
2349
+ writeFileSync(file_path, jsonContent, 'utf8');
2348
2350
 
2349
2351
  const fileSizeKB = Math.round(jsonContent.length / 1024);
2350
2352
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "schemeog-mcp",
3
- "version": "3.8.0",
3
+ "version": "3.9.0",
4
4
  "description": "MCP Server for Diagrams.love - Create and manage visual diagrams and flowcharts with AI assistance",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/README.md DELETED
@@ -1,368 +0,0 @@
1
- # SchemeOG MCP Server v2.9
2
-
3
- MCP server for [SchemeOG Cloud](https://scheme.smartlaunchhub.com) — create diagrams and flowcharts with AI.
4
-
5
- ## Features
6
-
7
- - **17 commands** for schemas, projects, tags, and import/export
8
- - **Auto-refresh**: Browser automatically reloads when MCP updates schema
9
- - **Smart positioning**: Existing elements keep their positions, new elements get auto-layout
10
- - **No coordinate conflicts**: MCP ignores x/y to prevent overlapping cards
11
-
12
- ## 17 Commands
13
-
14
- ### Schemas (6 commands)
15
-
16
- | Command | Description |
17
- |---------|-------------|
18
- | `list_schemas` | List all schemas |
19
- | `get_schema` | Get schema by ID |
20
- | `get_schema_by_url` | Get schema by URL (canvas or shared link) |
21
- | `create_schema` | Create new schema |
22
- | `replace_schema` | Replace schema content |
23
- | `delete_schema` | Delete schema |
24
-
25
- ### Import/Export (2 commands)
26
-
27
- | Command | Description |
28
- |---------|-------------|
29
- | `import_schema_from_json` | Import schema from JSON (multiple formats supported) |
30
- | `export_schema_to_json` | Export schema to JSON file |
31
-
32
- ### Projects (5 commands)
33
-
34
- | Command | Description |
35
- |---------|-------------|
36
- | `list_projects` | List projects (folders) |
37
- | `create_project` | Create project |
38
- | `update_project` | Update project |
39
- | `delete_project` | Delete project |
40
- | `move_schema_to_project` | Move schema to project |
41
-
42
- ### Tags (4 commands)
43
-
44
- | Command | Description |
45
- |---------|-------------|
46
- | `list_tags` | List schema tags |
47
- | `add_tag` | Add tag to schema |
48
- | `remove_tag` | Remove tag from schema |
49
- | `tag_element` | Assign/remove tag from element |
50
-
51
- ## Installation
52
-
53
- ### Via npx (recommended)
54
-
55
- ```bash
56
- npx schemeog-mcp
57
- ```
58
-
59
- ## Setup
60
-
61
- ### 1. Get your token
62
-
63
- 1. Open https://scheme.smartlaunchhub.com
64
- 2. Sign in with email
65
- 3. Go to Profile
66
- 4. Copy token from "Claude Code Integration" section
67
-
68
- ### 2. Add to Claude Code / Cline
69
-
70
- In `~/.claude.json` (or Cline settings):
71
-
72
- ```json
73
- {
74
- "mcpServers": {
75
- "schemeog": {
76
- "command": "npx",
77
- "args": ["-y", "schemeog-mcp"],
78
- "env": {
79
- "SCHEMEOG_TOKEN": "schog_xxxxx..."
80
- }
81
- }
82
- }
83
- }
84
- ```
85
-
86
- ## Schema Data Format
87
-
88
- ### Element (card or condition)
89
-
90
- ```json
91
- {
92
- "id": "unique_id",
93
- "type": "card",
94
- "title": "Card Title",
95
- "color": "light_blue",
96
- "tags": ["tag1", "tag2"],
97
- "description": "Detailed description",
98
- "borderColor": "blue",
99
- "completed": false,
100
- "eventDate": "2025-03-15",
101
- "connections": [
102
- {"to": "next_element_id", "label": "optional label"}
103
- ]
104
- }
105
- ```
106
-
107
- **IMPORTANT: Do NOT specify `x` and `y` coordinates!**
108
- - MCP automatically ignores coordinates to prevent cards from overlapping
109
- - Existing elements keep their positions
110
- - New elements are automatically positioned by auto-layout
111
- - This prevents the common problem of Claude copying coordinates from existing cards
112
-
113
- **Element types:**
114
- - `card` — regular process/action card
115
- - `condition` — decision point (diamond shape)
116
-
117
- **Completion status (`completed`):**
118
- - `true` — card is marked as completed (done)
119
- - `false` or omitted — card is not completed
120
-
121
- **Event date (`eventDate`):**
122
- - ISO 8601 format: `"2025-03-15"` or `"2025-03-15T10:00:00Z"`
123
- - Used for deadlines, milestones, or scheduled events
124
-
125
- **ID uniqueness:**
126
- - Each element MUST have a unique `id`
127
- - Duplicate IDs will cause an error and prevent schema creation
128
-
129
- **Available colors (`color`):**
130
- | Color | Purpose |
131
- |-------|---------|
132
- | `white` | Default white |
133
- | `light_blue` | Main processes |
134
- | `light_green` | Start and success |
135
- | `light_yellow` | Checks and conditions |
136
- | `light_orange` | Warnings |
137
- | `light_red` | Errors and critical |
138
- | `light_purple` | Decisions |
139
- | `light_gray` | Completion |
140
- | `light_pink` | Additional processes |
141
- | `light_teal` | Special operations |
142
-
143
- **Border colors (`borderColor`):** `default`, `blue`, `green`, `orange`, `purple`, `red`, `teal`, `yellow`, `gray`, `black`
144
-
145
- ### Connection (inline format)
146
-
147
- Connections are defined inside each element's `connections` array:
148
-
149
- ```json
150
- {
151
- "connections": [
152
- {"to": "target_id", "label": "optional label", "style": "solid"}
153
- ]
154
- }
155
- ```
156
-
157
- **Line styles (`style`):** `solid` (default), `dashed`, `dotted`
158
-
159
- ### Full schema example
160
-
161
- ```json
162
- {
163
- "name": "User Registration Flow",
164
- "description": "User registration process",
165
- "elements": [
166
- {
167
- "id": "start",
168
- "type": "card",
169
- "title": "Registration Form",
170
- "color": "light_green",
171
- "tags": ["user"],
172
- "description": "User fills in email and password",
173
- "connections": [
174
- {"to": "validate", "label": "submit"}
175
- ]
176
- },
177
- {
178
- "id": "validate",
179
- "type": "condition",
180
- "title": "Validate Data",
181
- "color": "light_yellow",
182
- "tags": ["system"],
183
- "connections": [
184
- {"to": "save", "label": "valid"},
185
- {"to": "error", "label": "invalid"}
186
- ]
187
- },
188
- {
189
- "id": "save",
190
- "type": "card",
191
- "title": "Save to Database",
192
- "color": "light_blue",
193
- "tags": ["system"],
194
- "connections": [{"to": "success"}]
195
- },
196
- {
197
- "id": "error",
198
- "type": "card",
199
- "title": "Validation Error",
200
- "color": "light_red",
201
- "tags": ["system"],
202
- "connections": [{"to": "start", "label": "retry"}]
203
- },
204
- {
205
- "id": "success",
206
- "type": "card",
207
- "title": "Registration Complete",
208
- "color": "light_green",
209
- "tags": ["user"]
210
- }
211
- ],
212
- "tagsDictionary": [
213
- {"id": "tag-user", "name": "user", "color": "#4CAF50"},
214
- {"id": "tag-system", "name": "system", "color": "#2196F3"}
215
- ]
216
- }
217
- ```
218
-
219
- ### Tags Dictionary (tagsDictionary)
220
-
221
- ```json
222
- {
223
- "tagsDictionary": [
224
- {"id": "tag-1", "name": "system", "color": "#2196F3"},
225
- {"id": "tag-2", "name": "user", "color": "#4CAF50"}
226
- ]
227
- }
228
- ```
229
-
230
- **Tags = roles/actors.** Indicate WHO performs the action:
231
- - `system`, `user`, `admin`
232
- - `client`, `manager`, `bot`
233
-
234
- ## Auto-Refresh Feature
235
-
236
- When you edit a schema via MCP while viewing it in the browser:
237
- - Browser automatically detects changes every 3 seconds
238
- - Page reloads ONLY when changes are made by MCP (not by your own edits)
239
- - No manual refresh needed — just edit via MCP and watch the browser update!
240
-
241
- **How it works:**
242
- - MCP marks all updates with `updatedBy: 'mcp'`
243
- - Browser ignores its own updates (`updatedBy: 'web'`)
244
- - This prevents infinite reload loops when you edit in browser
245
-
246
- ## Opening Schema by URL
247
-
248
- You can open any schema by URL using `get_schema_by_url`:
249
-
250
- ```
251
- # Canvas URL (основной формат)
252
- https://scheme.smartlaunchhub.com/canvas?schema=abc123
253
-
254
- # Shared link
255
- https://scheme.smartlaunchhub.com/shared/xyz789
256
- ```
257
-
258
- Just paste the URL and the MCP will extract the schema ID automatically.
259
-
260
- ## Schema Methodology
261
-
262
- Schema = complete tree of **ACTIONS** and **CONSEQUENCES**:
263
-
264
- 1. Each decision → show ALL possible options
265
- 2. Each option → show ALL consequences
266
- 3. Use `condition` for decision points
267
- 4. NOT abstract thoughts — CONCRETE paths
268
- 5. Tags indicate WHO performs the action
269
-
270
- **Example:**
271
- ```
272
- "Submit Form" → condition "Validate" →
273
- ├── "Data Valid" → "Save" → "Success"
274
- └── "Error" → "Show Errors" → "Fix Form"
275
- ```
276
-
277
- ## Import/Export Formats
278
-
279
- ### Export formats
280
-
281
- Use `export_schema_to_json` with the `format` parameter:
282
-
283
- | Format | Description |
284
- |--------|-------------|
285
- | `full` | Complete export with metadata, viewport, and all data |
286
- | `compact` | Schema name + elements + tagsDictionary only |
287
- | `elements_only` | Just the elements array |
288
-
289
- ### Import formats
290
-
291
- `import_schema_from_json` automatically detects and supports:
292
-
293
- **1. Full SchemeOG export:**
294
- ```json
295
- {
296
- "exportVersion": "1.0",
297
- "schema": {
298
- "name": "...",
299
- "elements": [...],
300
- "tagsDictionary": [...]
301
- }
302
- }
303
- ```
304
-
305
- **2. Simple format:**
306
- ```json
307
- {
308
- "name": "...",
309
- "elements": [...],
310
- "connections": [...],
311
- "tagsDictionary": [...]
312
- }
313
- ```
314
-
315
- **3. Local format (connections inside elements):**
316
- ```json
317
- {
318
- "name": "...",
319
- "elements": [
320
- {
321
- "id": "1",
322
- "title": "...",
323
- "connections": [{"to": "2"}]
324
- }
325
- ]
326
- }
327
- ```
328
-
329
- **4. Elements array only:**
330
- ```json
331
- [
332
- {"id": "1", "title": "...", "connections": [{"to": "2"}]}
333
- ]
334
- ```
335
-
336
- ### Import examples
337
-
338
- **Create new schema:**
339
- ```
340
- import_schema_from_json(
341
- json_content: {...},
342
- name: "My Schema"
343
- )
344
- ```
345
-
346
- **Update existing schema:**
347
- ```
348
- import_schema_from_json(
349
- json_content: {...},
350
- schema_id: "existing-id"
351
- )
352
- ```
353
-
354
- ## Version History
355
-
356
- MCP now automatically creates versions when updating schemas:
357
- - Before each update via MCP, a snapshot is saved
358
- - View version history in the web interface (History tab)
359
- - Restore any previous version with one click
360
-
361
- ## Links
362
-
363
- - [SchemeOG Cloud](https://scheme.smartlaunchhub.com)
364
- - [GitLab](https://gitlab.com/serter2069/schemeog-mcp)
365
-
366
- ## License
367
-
368
- MIT