@og-mcp/reactflow-mcp 1.0.4 → 1.0.6
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/LICENSE +21 -21
- package/README.md +74 -74
- package/dist/data/api-types.js +69 -69
- package/dist/data/components.js +217 -217
- package/dist/data/hooks.js +106 -106
- package/dist/data/migration.js +44 -44
- package/dist/data/patterns.js +582 -582
- package/dist/data/templates.js +126 -126
- package/dist/data/utilities.js +29 -29
- package/dist/index.js +0 -0
- package/dist/tools/cheatsheet.js +84 -84
- package/dist/tools/generate-flow.js +89 -89
- package/package.json +54 -54
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Orkait
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Orkait
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
# React Flow MCP Server
|
|
2
|
-
|
|
3
|
-
MCP server that gives AI assistants accurate [React Flow](https://reactflow.dev) (`@xyflow/react`) v12 documentation, API references, enterprise patterns, and code generation.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Tools
|
|
8
|
-
|
|
9
|
-
| Tool | Description |
|
|
10
|
-
|------|-------------|
|
|
11
|
-
| `list_apis` | Browse all 56 APIs grouped by kind (components, hooks, utilities, types) |
|
|
12
|
-
| `get_api` | Detailed reference for any API — props, usage, examples, tips |
|
|
13
|
-
| `search_docs` | Keyword search across all documentation and code examples |
|
|
14
|
-
| `get_examples` | Code examples by category (15 categories) |
|
|
15
|
-
| `get_pattern` | Enterprise patterns with full implementation (17 patterns) |
|
|
16
|
-
| `get_template` | Production-ready templates: custom-node, custom-edge, zustand-store |
|
|
17
|
-
| `get_migration_guide` | React Flow v11 to v12 migration guide |
|
|
18
|
-
| `generate_flow` | Generate a complete flow component from natural language |
|
|
19
|
-
|
|
20
|
-
## Resources
|
|
21
|
-
|
|
22
|
-
| Resource | URI |
|
|
23
|
-
|----------|-----|
|
|
24
|
-
| Cheatsheet | `reactflow://cheatsheet` |
|
|
25
|
-
|
|
26
|
-
## Patterns
|
|
27
|
-
|
|
28
|
-
zustand-store, undo-redo, drag-and-drop, auto-layout-dagre, auto-layout-elk, context-menu, copy-paste, save-restore, prevent-cycles, keyboard-shortcuts, performance, dark-mode, ssr, subflows, edge-reconnection, custom-connection-line, auto-layout-on-mount
|
|
29
|
-
|
|
30
|
-
## Install
|
|
31
|
-
|
|
32
|
-
### Claude Code
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
claude mcp add reactflow-mcp -- npx -y @codingdud/reactflow-mcp
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Claude Desktop / Cursor / Windsurf
|
|
39
|
-
|
|
40
|
-
Add to your MCP config:
|
|
41
|
-
|
|
42
|
-
```json
|
|
43
|
-
{
|
|
44
|
-
"mcpServers": {
|
|
45
|
-
"reactflow-mcp": {
|
|
46
|
-
"command": "npx",
|
|
47
|
-
"args": ["-y", "@orkait-ai/reactflow-mcp"]
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### From source
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
git clone https://github.com/codingdud/reactflow-mcp.git
|
|
57
|
-
cd reactflow-mcp-server
|
|
58
|
-
npm install
|
|
59
|
-
npm run build
|
|
60
|
-
npm start
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Development
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
npm install
|
|
67
|
-
npm run dev # watch mode
|
|
68
|
-
npm run build # production build
|
|
69
|
-
npm start # run server
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## License
|
|
73
|
-
|
|
74
|
-
MIT
|
|
1
|
+
# React Flow MCP Server
|
|
2
|
+
|
|
3
|
+
MCP server that gives AI assistants accurate [React Flow](https://reactflow.dev) (`@xyflow/react`) v12 documentation, API references, enterprise patterns, and code generation.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `list_apis` | Browse all 56 APIs grouped by kind (components, hooks, utilities, types) |
|
|
12
|
+
| `get_api` | Detailed reference for any API — props, usage, examples, tips |
|
|
13
|
+
| `search_docs` | Keyword search across all documentation and code examples |
|
|
14
|
+
| `get_examples` | Code examples by category (15 categories) |
|
|
15
|
+
| `get_pattern` | Enterprise patterns with full implementation (17 patterns) |
|
|
16
|
+
| `get_template` | Production-ready templates: custom-node, custom-edge, zustand-store |
|
|
17
|
+
| `get_migration_guide` | React Flow v11 to v12 migration guide |
|
|
18
|
+
| `generate_flow` | Generate a complete flow component from natural language |
|
|
19
|
+
|
|
20
|
+
## Resources
|
|
21
|
+
|
|
22
|
+
| Resource | URI |
|
|
23
|
+
|----------|-----|
|
|
24
|
+
| Cheatsheet | `reactflow://cheatsheet` |
|
|
25
|
+
|
|
26
|
+
## Patterns
|
|
27
|
+
|
|
28
|
+
zustand-store, undo-redo, drag-and-drop, auto-layout-dagre, auto-layout-elk, context-menu, copy-paste, save-restore, prevent-cycles, keyboard-shortcuts, performance, dark-mode, ssr, subflows, edge-reconnection, custom-connection-line, auto-layout-on-mount
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
### Claude Code
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
claude mcp add reactflow-mcp -- npx -y @codingdud/reactflow-mcp
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Claude Desktop / Cursor / Windsurf
|
|
39
|
+
|
|
40
|
+
Add to your MCP config:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"mcpServers": {
|
|
45
|
+
"reactflow-mcp": {
|
|
46
|
+
"command": "npx",
|
|
47
|
+
"args": ["-y", "@orkait-ai/reactflow-mcp"]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### From source
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
git clone https://github.com/codingdud/reactflow-mcp.git
|
|
57
|
+
cd reactflow-mcp-server
|
|
58
|
+
npm install
|
|
59
|
+
npm run build
|
|
60
|
+
npm start
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Development
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npm install
|
|
67
|
+
npm run dev # watch mode
|
|
68
|
+
npm run build # production build
|
|
69
|
+
npm start # run server
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
MIT
|
package/dist/data/api-types.js
CHANGED
|
@@ -27,24 +27,24 @@ const nodeType = {
|
|
|
27
27
|
{ name: "origin", type: "NodeOrigin", description: "Origin point [0-1, 0-1] for positioning.", default: "[0, 0]" },
|
|
28
28
|
{ name: "measured", type: "{ width?: number; height?: number }", description: "Read-only measured dimensions." },
|
|
29
29
|
],
|
|
30
|
-
usage: `const node: Node = {
|
|
31
|
-
id: '1',
|
|
32
|
-
type: 'custom',
|
|
33
|
-
position: { x: 100, y: 200 },
|
|
34
|
-
data: { label: 'My Node', status: 'active' },
|
|
30
|
+
usage: `const node: Node = {
|
|
31
|
+
id: '1',
|
|
32
|
+
type: 'custom',
|
|
33
|
+
position: { x: 100, y: 200 },
|
|
34
|
+
data: { label: 'My Node', status: 'active' },
|
|
35
35
|
};`,
|
|
36
36
|
examples: [
|
|
37
37
|
{
|
|
38
38
|
title: "Typed custom node data",
|
|
39
39
|
category: "custom-nodes",
|
|
40
|
-
code: `type MyNodeData = { label: string; status: 'active' | 'inactive' };
|
|
41
|
-
type MyNode = Node<MyNodeData, 'statusNode'>;
|
|
42
|
-
|
|
43
|
-
const node: MyNode = {
|
|
44
|
-
id: '1',
|
|
45
|
-
type: 'statusNode',
|
|
46
|
-
position: { x: 0, y: 0 },
|
|
47
|
-
data: { label: 'Server', status: 'active' },
|
|
40
|
+
code: `type MyNodeData = { label: string; status: 'active' | 'inactive' };
|
|
41
|
+
type MyNode = Node<MyNodeData, 'statusNode'>;
|
|
42
|
+
|
|
43
|
+
const node: MyNode = {
|
|
44
|
+
id: '1',
|
|
45
|
+
type: 'statusNode',
|
|
46
|
+
position: { x: 0, y: 0 },
|
|
47
|
+
data: { label: 'Server', status: 'active' },
|
|
48
48
|
};`,
|
|
49
49
|
},
|
|
50
50
|
],
|
|
@@ -82,13 +82,13 @@ const edgeType = {
|
|
|
82
82
|
{ name: "zIndex", type: "number", description: "Z-index." },
|
|
83
83
|
{ name: "interactionWidth", type: "number", description: "Width of invisible click target.", default: "20" },
|
|
84
84
|
],
|
|
85
|
-
usage: `const edge: Edge = {
|
|
86
|
-
id: 'e1-2',
|
|
87
|
-
source: '1',
|
|
88
|
-
target: '2',
|
|
89
|
-
type: 'smoothstep',
|
|
90
|
-
animated: true,
|
|
91
|
-
label: 'connects to',
|
|
85
|
+
usage: `const edge: Edge = {
|
|
86
|
+
id: 'e1-2',
|
|
87
|
+
source: '1',
|
|
88
|
+
target: '2',
|
|
89
|
+
type: 'smoothstep',
|
|
90
|
+
animated: true,
|
|
91
|
+
label: 'connects to',
|
|
92
92
|
};`,
|
|
93
93
|
examples: [],
|
|
94
94
|
tips: [
|
|
@@ -123,26 +123,26 @@ const nodePropsType = {
|
|
|
123
123
|
{ name: "sourcePosition", type: "Position", description: "Source handle position (default nodes only)." },
|
|
124
124
|
{ name: "targetPosition", type: "Position", description: "Target handle position (default nodes only)." },
|
|
125
125
|
],
|
|
126
|
-
usage: `import type { NodeProps, Node } from '@xyflow/react';
|
|
127
|
-
|
|
128
|
-
// Step 1: Define your node type
|
|
129
|
-
type CounterNode = Node<{ initialCount?: number }, 'counter'>;
|
|
130
|
-
|
|
131
|
-
// Step 2: Use NodeProps<YourNodeType> as the prop type
|
|
132
|
-
export default function CounterNode(props: NodeProps<CounterNode>) {
|
|
133
|
-
const [count, setCount] = useState(props.data?.initialCount ?? 0);
|
|
134
|
-
|
|
135
|
-
return (
|
|
136
|
-
<div>
|
|
137
|
-
<p>Count: {count}</p>
|
|
138
|
-
<button className="nodrag" onClick={() => setCount(count + 1)}>
|
|
139
|
-
Increment
|
|
140
|
-
</button>
|
|
141
|
-
</div>
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Step 3: Register in nodeTypes (outside component!)
|
|
126
|
+
usage: `import type { NodeProps, Node } from '@xyflow/react';
|
|
127
|
+
|
|
128
|
+
// Step 1: Define your node type
|
|
129
|
+
type CounterNode = Node<{ initialCount?: number }, 'counter'>;
|
|
130
|
+
|
|
131
|
+
// Step 2: Use NodeProps<YourNodeType> as the prop type
|
|
132
|
+
export default function CounterNode(props: NodeProps<CounterNode>) {
|
|
133
|
+
const [count, setCount] = useState(props.data?.initialCount ?? 0);
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<div>
|
|
137
|
+
<p>Count: {count}</p>
|
|
138
|
+
<button className="nodrag" onClick={() => setCount(count + 1)}>
|
|
139
|
+
Increment
|
|
140
|
+
</button>
|
|
141
|
+
</div>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Step 3: Register in nodeTypes (outside component!)
|
|
146
146
|
const nodeTypes = { counter: CounterNode };`,
|
|
147
147
|
examples: [],
|
|
148
148
|
tips: [
|
|
@@ -187,24 +187,24 @@ const edgePropsType = {
|
|
|
187
187
|
{ name: "style", type: "CSSProperties", description: "Edge SVG path styles." },
|
|
188
188
|
{ name: "interactionWidth", type: "number", description: "Width of invisible click target." },
|
|
189
189
|
],
|
|
190
|
-
usage: `import type { EdgeProps, Edge } from '@xyflow/react';
|
|
191
|
-
import { BaseEdge, getBezierPath } from '@xyflow/react';
|
|
192
|
-
|
|
193
|
-
// Step 1: Define your edge type (optional)
|
|
194
|
-
type CustomEdgeType = Edge<{ weight: number }, 'weighted'>;
|
|
195
|
-
|
|
196
|
-
// Step 2: Use EdgeProps<YourEdgeType>
|
|
197
|
-
function WeightedEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data, style }: EdgeProps<CustomEdgeType>) {
|
|
198
|
-
const [edgePath, labelX, labelY] = getBezierPath({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition });
|
|
199
|
-
return (
|
|
200
|
-
<>
|
|
201
|
-
<BaseEdge path={edgePath} style={style} />
|
|
202
|
-
<text x={labelX} y={labelY} textAnchor="middle">{data?.weight}</text>
|
|
203
|
-
</>
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Step 3: Register in edgeTypes (outside component!)
|
|
190
|
+
usage: `import type { EdgeProps, Edge } from '@xyflow/react';
|
|
191
|
+
import { BaseEdge, getBezierPath } from '@xyflow/react';
|
|
192
|
+
|
|
193
|
+
// Step 1: Define your edge type (optional)
|
|
194
|
+
type CustomEdgeType = Edge<{ weight: number }, 'weighted'>;
|
|
195
|
+
|
|
196
|
+
// Step 2: Use EdgeProps<YourEdgeType>
|
|
197
|
+
function WeightedEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data, style }: EdgeProps<CustomEdgeType>) {
|
|
198
|
+
const [edgePath, labelX, labelY] = getBezierPath({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition });
|
|
199
|
+
return (
|
|
200
|
+
<>
|
|
201
|
+
<BaseEdge path={edgePath} style={style} />
|
|
202
|
+
<text x={labelX} y={labelY} textAnchor="middle">{data?.weight}</text>
|
|
203
|
+
</>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Step 3: Register in edgeTypes (outside component!)
|
|
208
208
|
const edgeTypes = { weighted: WeightedEdge };`,
|
|
209
209
|
examples: [],
|
|
210
210
|
tips: [
|
|
@@ -225,8 +225,8 @@ const connectionType = {
|
|
|
225
225
|
{ name: "sourceHandle", type: "string | null", description: "Source handle ID." },
|
|
226
226
|
{ name: "targetHandle", type: "string | null", description: "Target handle ID." },
|
|
227
227
|
],
|
|
228
|
-
usage: `const onConnect = (connection: Connection) => {
|
|
229
|
-
setEdges((eds) => addEdge(connection, eds));
|
|
228
|
+
usage: `const onConnect = (connection: Connection) => {
|
|
229
|
+
setEdges((eds) => addEdge(connection, eds));
|
|
230
230
|
};`,
|
|
231
231
|
examples: [],
|
|
232
232
|
relatedApis: ["Edge", "addEdge", "useConnection"],
|
|
@@ -278,15 +278,15 @@ const reactFlowInstanceType = {
|
|
|
278
278
|
{ name: "isNodeIntersecting()", type: "(node, area, partially?) => boolean", description: "Check if node intersects area." },
|
|
279
279
|
{ name: "getNodesBounds()", type: "(nodes) => Rect", description: "Get bounding box of nodes." },
|
|
280
280
|
],
|
|
281
|
-
usage: `const reactFlow = useReactFlow();
|
|
282
|
-
|
|
283
|
-
// Add a node
|
|
284
|
-
reactFlow.addNodes({ id: 'new', position: { x: 100, y: 100 }, data: { label: 'New' } });
|
|
285
|
-
|
|
286
|
-
// Fit view with animation
|
|
287
|
-
reactFlow.fitView({ duration: 500, padding: 0.2 });
|
|
288
|
-
|
|
289
|
-
// Export flow
|
|
281
|
+
usage: `const reactFlow = useReactFlow();
|
|
282
|
+
|
|
283
|
+
// Add a node
|
|
284
|
+
reactFlow.addNodes({ id: 'new', position: { x: 100, y: 100 }, data: { label: 'New' } });
|
|
285
|
+
|
|
286
|
+
// Fit view with animation
|
|
287
|
+
reactFlow.fitView({ duration: 500, padding: 0.2 });
|
|
288
|
+
|
|
289
|
+
// Export flow
|
|
290
290
|
const json = reactFlow.toObject();`,
|
|
291
291
|
examples: [],
|
|
292
292
|
relatedApis: ["useReactFlow", "ReactFlowProvider"],
|