flowspec-mcp 4.1.0 → 4.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.
Files changed (67) hide show
  1. package/README.md +4 -159
  2. package/dist/db.d.ts +0 -26
  3. package/dist/db.js +396 -318
  4. package/dist/db.js.map +1 -1
  5. package/dist/index.js +0 -0
  6. package/dist/server.js +4 -23
  7. package/dist/server.js.map +1 -1
  8. package/dist/tools/createEdge.d.ts +4 -4
  9. package/dist/tools/createNode.d.ts +2 -2
  10. package/dist/tools/deleteEdge.js +4 -20
  11. package/dist/tools/deleteEdge.js.map +1 -1
  12. package/dist/tools/deleteNode.js +4 -20
  13. package/dist/tools/deleteNode.js.map +1 -1
  14. package/dist/tools/updateEdge.d.ts +2 -2
  15. package/dist/tools/updateEdge.js +3 -19
  16. package/dist/tools/updateEdge.js.map +1 -1
  17. package/dist/tools/updateNode.d.ts +2 -2
  18. package/dist/tools/updateNode.js +5 -21
  19. package/dist/tools/updateNode.js.map +1 -1
  20. package/dist/tools/updateProject.d.ts +2 -2
  21. package/dist/types.d.ts +0 -12
  22. package/package.json +2 -2
  23. package/dist/analysis/analysisUtils.d.ts +0 -36
  24. package/dist/analysis/analysisUtils.js +0 -284
  25. package/dist/analysis/analysisUtils.js.map +0 -1
  26. package/dist/export/jsonExporter.d.ts +0 -17
  27. package/dist/export/jsonExporter.js +0 -176
  28. package/dist/export/jsonExporter.js.map +0 -1
  29. package/dist/layout/semanticLayout.d.ts +0 -24
  30. package/dist/layout/semanticLayout.js +0 -233
  31. package/dist/layout/semanticLayout.js.map +0 -1
  32. package/dist/resources/selection.d.ts +0 -5
  33. package/dist/resources/selection.js +0 -88
  34. package/dist/resources/selection.js.map +0 -1
  35. package/dist/tools/captureScreen.d.ts +0 -48
  36. package/dist/tools/captureScreen.js +0 -135
  37. package/dist/tools/captureScreen.js.map +0 -1
  38. package/dist/tools/createSubview.d.ts +0 -50
  39. package/dist/tools/createSubview.js +0 -29
  40. package/dist/tools/createSubview.js.map +0 -1
  41. package/dist/tools/deleteSubview.d.ts +0 -24
  42. package/dist/tools/deleteSubview.js +0 -19
  43. package/dist/tools/deleteSubview.js.map +0 -1
  44. package/dist/tools/generateSpec.d.ts +0 -26
  45. package/dist/tools/generateSpec.js +0 -336
  46. package/dist/tools/generateSpec.js.map +0 -1
  47. package/dist/tools/getJson.d.ts +0 -21
  48. package/dist/tools/getJson.js +0 -24
  49. package/dist/tools/getJson.js.map +0 -1
  50. package/dist/tools/healthCheck.d.ts +0 -8
  51. package/dist/tools/healthCheck.js +0 -16
  52. package/dist/tools/healthCheck.js.map +0 -1
  53. package/dist/tools/ingestCodebase.d.ts +0 -27
  54. package/dist/tools/ingestCodebase.js +0 -516
  55. package/dist/tools/ingestCodebase.js.map +0 -1
  56. package/dist/tools/listSubviews.d.ts +0 -21
  57. package/dist/tools/listSubviews.js +0 -34
  58. package/dist/tools/listSubviews.js.map +0 -1
  59. package/dist/tools/smartLayout.d.ts +0 -30
  60. package/dist/tools/smartLayout.js +0 -74
  61. package/dist/tools/smartLayout.js.map +0 -1
  62. package/dist/tools/updateSubview.d.ts +0 -53
  63. package/dist/tools/updateSubview.js +0 -33
  64. package/dist/tools/updateSubview.js.map +0 -1
  65. package/dist/utils/selectionHelper.d.ts +0 -61
  66. package/dist/utils/selectionHelper.js +0 -111
  67. package/dist/utils/selectionHelper.js.map +0 -1
package/README.md CHANGED
@@ -2,21 +2,6 @@
2
2
 
3
3
  MCP (Model Context Protocol) server for [FlowSpec](https://flowspec.app) — exposes project specifications to Claude Code and other MCP-compatible AI tools.
4
4
 
5
- ## v4.1.0 - What's New
6
-
7
- - **Subviews Support** (NEW): Create, manage, and export focused mini-canvases showing node subsets
8
- - **Selection Resource**: Read currently selected nodes/edges from FlowSpec desktop editor
9
- - **"current" Alias**: Use `nodeId: "current"` or `edgeId: "current"` in update/delete tools
10
- - **Context-Aware Commands**: Enable natural language like "move this node" or "change the edge handle"
11
-
12
- ### v4.0.0 Changes
13
-
14
- - **JSON Export**: `flowspec_get_json` tool for faster parsing (100x) and smaller files (40%)
15
- - **YAML Export** (Deprecated): `flowspec_get_yaml` still available for backwards compatibility
16
- - **Performance**: Aligned with FlowSpec v4 normalized schema (8000x faster updates)
17
-
18
- **Migration**: Replace `flowspec_get_yaml` with `flowspec_get_json` in your workflows.
19
-
20
5
  ## Quick Start
21
6
 
22
7
  Add to your `~/.claude.json`:
@@ -68,8 +53,7 @@ Local mode connects to the FlowSpec desktop server at `http://localhost:3456`.
68
53
 
69
54
  ### Read Tools
70
55
  - **`flowspec_list_projects`** — List all projects with names and dates
71
- - **`flowspec_get_json`** — Get full JSON spec for a project (v4.0.0+, recommended)
72
- - **`flowspec_get_yaml`** — Get full YAML spec for a project (deprecated, use get_json)
56
+ - **`flowspec_get_yaml`** — Get full YAML spec for a project (optimised for Claude Code)
73
57
  - **`flowspec_get_project`** — Get raw canvas_state JSON
74
58
  - **`flowspec_search_nodes`** — Search nodes by label across all projects
75
59
  - **`flowspec_get_screen_context`** — Get screen/region/element structure
@@ -79,151 +63,12 @@ Local mode connects to the FlowSpec desktop server at `http://localhost:3456`.
79
63
  - **`flowspec_update_project`** — Update project name or canvas state
80
64
  - **`flowspec_delete_project`** — Delete a project
81
65
  - **`flowspec_create_node`** — Add a node (datapoint, component, transform, table)
82
- - **`flowspec_update_node`** — Update node data or position (supports `nodeId: "current"`)
83
- - **`flowspec_delete_node`** — Remove a node and connected edges (supports `nodeId: "current"`)
66
+ - **`flowspec_update_node`** — Update node data or position
67
+ - **`flowspec_delete_node`** — Remove a node and connected edges
84
68
  - **`flowspec_create_edge`** — Connect two nodes with an edge type
85
- - **`flowspec_update_edge`** — Update edge type, label, or handle positions (supports `edgeId: "current"`)
86
- - **`flowspec_delete_edge`** — Remove an edge (supports `edgeId: "current"`)
69
+ - **`flowspec_delete_edge`** — Remove an edge
87
70
  - **`flowspec_analyse_project`** — Run orphan node and duplicate label analysis
88
71
 
89
- ### Subview Tools (v4.1.0+)
90
- - **`flowspec_list_subviews`** — List all subviews in a project
91
- - **`flowspec_create_subview`** — Create a focused mini-canvas with selected nodes
92
- - **`flowspec_update_subview`** — Update subview name, description, or node positions
93
- - **`flowspec_delete_subview`** — Delete a subview
94
-
95
- ### Resources
96
- - **`flowspec://selection/current`** — Currently selected nodes, edges, and viewport in FlowSpec desktop editor (local mode only)
97
-
98
- ## Context-Aware Commands (v4.1.0+)
99
-
100
- The selection resource enables natural language commands that reference "this node" or "these edges".
101
-
102
- ### Reading Current Selection
103
-
104
- ```typescript
105
- // In Claude Code, use ReadMcpResourceTool:
106
- ReadMcpResourceTool({ uri: "flowspec://selection/current" })
107
-
108
- // Returns:
109
- {
110
- type: "selection",
111
- projectId: "...",
112
- projectName: "My App",
113
- selectedNodes: [{ id: "...", label: "User Email", type: "datapoint", ... }],
114
- selectedEdges: [{ id: "...", source: "...", target: "...", ... }],
115
- viewport: { x: 150.5, y: -200.3, zoom: 1.2 }
116
- }
117
- ```
118
-
119
- ### Using "current" Alias
120
-
121
- Instead of copying UUIDs, use `"current"` to reference the selected node/edge:
122
-
123
- ```typescript
124
- // Update the selected node
125
- flowspec_update_node({ projectId, nodeId: "current", position: { x: 500, y: 300 } })
126
-
127
- // Delete the selected edge
128
- flowspec_delete_edge({ projectId, edgeId: "current" })
129
-
130
- // Change edge handle
131
- flowspec_update_edge({ projectId, edgeId: "current", targetHandle: "target-left" })
132
- ```
133
-
134
- **Requirements:**
135
- - Desktop app must be running (local mode)
136
- - Exactly one node/edge must be selected (multi-selection returns error)
137
- - Selection must be less than 60 seconds old
138
-
139
- **Multi-selection:**
140
- - User holds Shift and clicks multiple nodes to select them
141
- - Selection resource returns all selected items
142
- - "current" alias does not work with multi-selection (use explicit IDs instead)
143
-
144
- ### Example Workflow
145
-
146
- ```
147
- User: (clicks node "User Email" in FlowSpec)
148
- User: "Move this node to the right"
149
-
150
- Claude:
151
- 1. ReadMcpResourceTool("flowspec://selection/current")
152
- → { selectedNodes: [{ id: "abc-123", label: "User Email", position: {x:100, y:200} }] }
153
- 2. flowspec_update_node({ projectId, nodeId: "current", position: {x:400, y:200} })
154
- → "Updated currently selected node (abc-123)"
155
- ```
156
-
157
- ## Subviews (v4.1.0+)
158
-
159
- Subviews are focused mini-canvases that show a subset of nodes from the main canvas. They're useful for:
160
- - **Focused workflows**: "Auth Flow", "Payment Processing", "Data Validation"
161
- - **Documentation**: Export specific flows as standalone diagrams
162
- - **Collaboration**: Share relevant subsets without overwhelming stakeholders
163
-
164
- ### Creating Subviews
165
-
166
- ```typescript
167
- // Create a subview for authentication flow
168
- flowspec_create_subview({
169
- projectId,
170
- name: "Auth Flow",
171
- description: "User authentication and session management",
172
- nodePositions: [
173
- { nodeId: "node-login-form", x: 100, y: 100 },
174
- { nodeId: "node-user-email", x: 300, y: 100 },
175
- { nodeId: "node-auth-token", x: 500, y: 100 }
176
- ]
177
- })
178
- ```
179
-
180
- ### Managing Subviews
181
-
182
- ```typescript
183
- // List all subviews
184
- flowspec_list_subviews({ projectId })
185
-
186
- // Update subview name or add more nodes
187
- flowspec_update_subview({
188
- projectId,
189
- subviewId: "subview-abc123",
190
- name: "Authentication & Authorization",
191
- nodePositions: [...existingNodes, { nodeId: "node-permissions", x: 700, y: 100 }]
192
- })
193
-
194
- // Delete a subview
195
- flowspec_delete_subview({ projectId, subviewId: "subview-abc123" })
196
- ```
197
-
198
- ### Subviews in Exports
199
-
200
- Subviews are automatically included in `flowspec_get_json` exports:
201
-
202
- ```json
203
- {
204
- "version": "1.3.0",
205
- "metadata": { ... },
206
- "dataPoints": [ ... ],
207
- "components": [ ... ],
208
- "subviews": [
209
- {
210
- "id": "subview-abc123",
211
- "name": "Auth Flow",
212
- "description": "User authentication and session management",
213
- "nodes": [
214
- {
215
- "nodeId": "node-login-form",
216
- "nodeLabel": "Login Form",
217
- "nodeType": "component",
218
- "x": 100,
219
- "y": 100
220
- }
221
- ]
222
- }
223
- ]
224
- }
225
- ```
226
-
227
72
  ## Development
228
73
 
229
74
  ```bash
package/dist/db.d.ts CHANGED
@@ -113,29 +113,3 @@ export declare function bulkImportCanvasState(projectId: string, canvasState: {
113
113
  edgeCount: number;
114
114
  screenCount: number;
115
115
  }>;
116
- export declare function createSubviewViaApi(projectId: string, name: string, description?: string, nodePositions?: Array<{
117
- nodeId: string;
118
- x: number;
119
- y: number;
120
- }>): Promise<{
121
- id: string;
122
- name: string;
123
- description?: string;
124
- nodePositions: Array<{
125
- nodeId: string;
126
- x: number;
127
- y: number;
128
- }>;
129
- } | null>;
130
- export declare function updateSubviewViaApi(projectId: string, subviewId: string, updates: Partial<{
131
- name: string;
132
- description: string;
133
- nodePositions: Array<{
134
- nodeId: string;
135
- x: number;
136
- y: number;
137
- }>;
138
- }>): Promise<{
139
- id: string;
140
- } | null>;
141
- export declare function deleteSubviewViaApi(projectId: string, subviewId: string): Promise<boolean>;