flowengine-mcp-app 1.0.0 → 1.1.1
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 +177 -113
- package/build/client.d.ts +8 -3
- package/build/client.d.ts.map +1 -1
- package/build/client.js +32 -5
- package/build/client.js.map +1 -1
- package/build/index.d.ts +7 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +186 -336
- package/build/index.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,37 +1,53 @@
|
|
|
1
|
-
# FlowEngine MCP
|
|
1
|
+
# FlowEngine MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Control your white-label automation platform directly from Claude**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The official Model Context Protocol (MCP) server for FlowEngine. Manage instances, client portals, and build UI components using AI - all from Claude Desktop, VSCode, or Claude Code CLI.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **🏢 Client Portals** - Manage your client instances and portals with visual dashboards
|
|
9
|
-
- **⚡ Workflow Manager** - View, toggle, and monitor automation workflows
|
|
10
|
-
- **🎨 UI Builder** - Create and manage forms, chatbots, and interactive components
|
|
11
|
-
- **🚀 Hosting Management** - Monitor instance health, storage, and status
|
|
7
|
+
## What is FlowEngine?
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
FlowEngine is a white-label n8n automation platform that lets you build and deploy workflow automations for your clients. This MCP server brings FlowEngine's core capabilities into Claude for seamless management.
|
|
14
10
|
|
|
15
|
-
##
|
|
11
|
+
## Core Features
|
|
16
12
|
|
|
17
|
-
###
|
|
13
|
+
### Instance Management
|
|
14
|
+
Provision and manage FlowEngine instances for your clients:
|
|
15
|
+
- List all instances with status
|
|
16
|
+
- Monitor health and performance
|
|
17
|
+
- Create new instances
|
|
18
|
+
- Update configurations
|
|
19
|
+
- Delete instances
|
|
20
|
+
|
|
21
|
+
### Client Portals
|
|
22
|
+
Access and monitor your client portals:
|
|
23
|
+
- View all client portal URLs
|
|
24
|
+
- Check portal status
|
|
25
|
+
- Monitor workflows and components per portal
|
|
26
|
+
|
|
27
|
+
### AI FlowBuilder
|
|
28
|
+
Create and manage UI components with AI:
|
|
29
|
+
- Build forms, chatbots, and widgets
|
|
30
|
+
- List all components across instances
|
|
31
|
+
- Update component configurations
|
|
32
|
+
- Delete components
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
18
35
|
|
|
36
|
+
### Prerequisites
|
|
19
37
|
- Node.js 18 or higher
|
|
20
|
-
- FlowEngine account with API key
|
|
21
|
-
- Claude
|
|
38
|
+
- FlowEngine account with API key ([Get one here](https://flowengine.cloud))
|
|
39
|
+
- Claude Desktop, VSCode, or Claude Code CLI
|
|
22
40
|
|
|
23
|
-
###
|
|
41
|
+
### Get Your API Key
|
|
24
42
|
|
|
25
43
|
1. Log in to [FlowEngine](https://flowengine.cloud)
|
|
26
|
-
2. Go to
|
|
27
|
-
3. Click
|
|
28
|
-
4. Copy
|
|
29
|
-
|
|
30
|
-
### Step 2: Configure Claude Code
|
|
44
|
+
2. Go to Settings → API Access
|
|
45
|
+
3. Click "Generate API Key"
|
|
46
|
+
4. Copy your key (shown only once)
|
|
31
47
|
|
|
32
|
-
|
|
48
|
+
### Quick Setup
|
|
33
49
|
|
|
34
|
-
|
|
50
|
+
#### Claude Desktop
|
|
35
51
|
|
|
36
52
|
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
37
53
|
|
|
@@ -40,176 +56,224 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
|
40
56
|
"mcpServers": {
|
|
41
57
|
"flowengine": {
|
|
42
58
|
"command": "npx",
|
|
43
|
-
"args": ["-y", "
|
|
59
|
+
"args": ["-y", "flowengine-mcp-app"],
|
|
44
60
|
"env": {
|
|
45
|
-
"FLOWENGINE_API_KEY": "your-api-key-here"
|
|
46
|
-
"FLOWENGINE_BASE_URL": "https://flowengine.cloud"
|
|
61
|
+
"FLOWENGINE_API_KEY": "your-api-key-here"
|
|
47
62
|
}
|
|
48
63
|
}
|
|
49
64
|
}
|
|
50
65
|
}
|
|
51
66
|
```
|
|
52
67
|
|
|
53
|
-
|
|
68
|
+
#### Claude Code CLI
|
|
54
69
|
|
|
55
|
-
Edit `~/.
|
|
70
|
+
Edit `~/.claude/claude_code_config.json`:
|
|
56
71
|
|
|
57
72
|
```json
|
|
58
73
|
{
|
|
59
74
|
"mcpServers": {
|
|
60
75
|
"flowengine": {
|
|
61
76
|
"command": "npx",
|
|
62
|
-
"args": ["-y", "
|
|
77
|
+
"args": ["-y", "flowengine-mcp-app"],
|
|
63
78
|
"env": {
|
|
64
|
-
"FLOWENGINE_API_KEY": "your-api-key-here"
|
|
65
|
-
"FLOWENGINE_BASE_URL": "https://flowengine.cloud"
|
|
79
|
+
"FLOWENGINE_API_KEY": "your-api-key-here"
|
|
66
80
|
}
|
|
67
81
|
}
|
|
68
82
|
}
|
|
69
83
|
}
|
|
70
84
|
```
|
|
71
85
|
|
|
72
|
-
|
|
86
|
+
#### VSCode (Claude Extension)
|
|
73
87
|
|
|
74
|
-
|
|
88
|
+
Add to your VSCode settings:
|
|
75
89
|
|
|
76
90
|
```json
|
|
77
91
|
{
|
|
78
92
|
"mcp.servers": {
|
|
79
93
|
"flowengine": {
|
|
80
94
|
"command": "npx",
|
|
81
|
-
"args": ["-y", "
|
|
95
|
+
"args": ["-y", "flowengine-mcp-app"],
|
|
82
96
|
"env": {
|
|
83
|
-
"FLOWENGINE_API_KEY": "your-api-key-here"
|
|
84
|
-
"FLOWENGINE_BASE_URL": "https://flowengine.cloud"
|
|
97
|
+
"FLOWENGINE_API_KEY": "your-api-key-here"
|
|
85
98
|
}
|
|
86
99
|
}
|
|
87
100
|
}
|
|
88
101
|
}
|
|
89
102
|
```
|
|
90
103
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Restart Claude Desktop, start a new Claude Code CLI session, or reload your VSCode window to load the MCP App.
|
|
104
|
+
**Then restart** Claude Desktop, start a new Claude Code session, or reload VSCode.
|
|
94
105
|
|
|
95
|
-
|
|
106
|
+
## Usage
|
|
96
107
|
|
|
97
|
-
|
|
108
|
+
### Interactive Dashboards
|
|
98
109
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
### View Interactive Dashboards
|
|
102
|
-
|
|
103
|
-
Ask Claude to show you any of these UIs:
|
|
110
|
+
Ask Claude to show visual dashboards:
|
|
104
111
|
|
|
105
112
|
```
|
|
106
|
-
"Show me the FlowEngine demo"
|
|
107
113
|
"Show me my client portals"
|
|
108
|
-
"Show me
|
|
109
|
-
"Show me
|
|
110
|
-
"Show me my hosting instances"
|
|
114
|
+
"Show me the AI FlowBuilder"
|
|
115
|
+
"Show me my instances"
|
|
111
116
|
```
|
|
112
117
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
### Use Tools for Quick Actions
|
|
118
|
+
### Natural Language Commands
|
|
116
119
|
|
|
117
|
-
|
|
120
|
+
Manage your platform through conversation:
|
|
118
121
|
|
|
119
122
|
```
|
|
120
|
-
"List all my
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
123
|
+
"List all my FlowEngine instances"
|
|
124
|
+
"What's the status of instance abc123?"
|
|
125
|
+
"Create a new contact form widget"
|
|
126
|
+
"Show me all UI components"
|
|
127
|
+
"Provision a new instance for Acme Corp"
|
|
124
128
|
```
|
|
125
129
|
|
|
126
|
-
|
|
130
|
+
## Available Tools
|
|
127
131
|
|
|
128
|
-
|
|
129
|
-
- `
|
|
130
|
-
- `
|
|
131
|
-
- `
|
|
132
|
-
- `
|
|
132
|
+
### Instance Management (5 tools)
|
|
133
|
+
- `flowengine_list_instances` - List all instances
|
|
134
|
+
- `flowengine_get_instance_status` - Get instance health
|
|
135
|
+
- `flowengine_create_instance` - Provision new instance
|
|
136
|
+
- `flowengine_update_instance` - Update settings
|
|
137
|
+
- `flowengine_delete_instance` - Delete instance
|
|
133
138
|
|
|
134
|
-
###
|
|
139
|
+
### Client Portals (1 tool)
|
|
140
|
+
- `flowengine_list_portals` - List all portals
|
|
135
141
|
|
|
136
|
-
|
|
137
|
-
- `
|
|
138
|
-
- `flowengine_get_workflow_executions` - Get workflow execution history
|
|
139
|
-
- `flowengine_list_instances` - List all instances
|
|
140
|
-
- `flowengine_get_instance_status` - Get instance health status
|
|
141
|
-
- `flowengine_list_ui_components` - List forms/chatbots/widgets
|
|
142
|
+
### AI FlowBuilder (5 tools)
|
|
143
|
+
- `flowengine_list_components` - List UI components
|
|
142
144
|
- `flowengine_get_component` - Get component details
|
|
143
|
-
- `
|
|
145
|
+
- `flowengine_create_component` - Create form/chatbot/widget
|
|
146
|
+
- `flowengine_update_component` - Update component
|
|
147
|
+
- `flowengine_delete_component` - Delete component
|
|
148
|
+
|
|
149
|
+
**Total: 11 tools** (optimized to prevent API concurrency issues)
|
|
150
|
+
|
|
151
|
+
## Resources
|
|
152
|
+
|
|
153
|
+
Interactive UI dashboards available via MCP Apps (MCP v1.1+):
|
|
154
|
+
|
|
155
|
+
- `ui://flowengine/portals` - Client Portals Dashboard
|
|
156
|
+
- `ui://flowengine/ui-builder` - AI FlowBuilder
|
|
157
|
+
- `ui://flowengine/instances` - Instance Manager
|
|
158
|
+
|
|
159
|
+
**Note**: MCP Apps is a new feature announced January 26, 2026. Support may vary by client:
|
|
160
|
+
- ✅ Claude Desktop: Coming soon
|
|
161
|
+
- ✅ Claude Code: Check version compatibility
|
|
162
|
+
- ✅ VSCode: Depends on extension version
|
|
163
|
+
|
|
164
|
+
## Configuration
|
|
165
|
+
|
|
166
|
+
### Environment Variables
|
|
167
|
+
|
|
168
|
+
- `FLOWENGINE_API_KEY` (required) - Your FlowEngine API key
|
|
169
|
+
- `FLOWENGINE_BASE_URL` (optional) - Custom base URL (defaults to https://flowengine.cloud)
|
|
170
|
+
|
|
171
|
+
### Custom Base URL
|
|
172
|
+
|
|
173
|
+
For self-hosted or custom deployments:
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"env": {
|
|
178
|
+
"FLOWENGINE_API_KEY": "your-key",
|
|
179
|
+
"FLOWENGINE_BASE_URL": "https://your-domain.com"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
```
|
|
144
183
|
|
|
145
|
-
##
|
|
184
|
+
## Development
|
|
146
185
|
|
|
147
|
-
|
|
186
|
+
### Local Development
|
|
148
187
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
188
|
+
```bash
|
|
189
|
+
# Clone and install
|
|
190
|
+
git clone https://github.com/FlowEngine-cloud/flowengine.git
|
|
191
|
+
cd flowengine/flowengine-mcp
|
|
192
|
+
npm install
|
|
154
193
|
|
|
155
|
-
|
|
194
|
+
# Build
|
|
195
|
+
npm run build
|
|
196
|
+
|
|
197
|
+
# Test locally
|
|
198
|
+
node build/index.js
|
|
199
|
+
```
|
|
156
200
|
|
|
157
201
|
### Project Structure
|
|
158
202
|
|
|
159
203
|
```
|
|
160
204
|
flowengine-mcp/
|
|
161
205
|
├── src/
|
|
162
|
-
│ ├── index.ts
|
|
163
|
-
│ ├── client.ts
|
|
164
|
-
│ └── ui/
|
|
165
|
-
│ ├── base.ts
|
|
166
|
-
│ ├──
|
|
167
|
-
│ ├──
|
|
168
|
-
│
|
|
169
|
-
│ ├── widgets.ts # UI builder UI
|
|
170
|
-
│ └── instances.ts # Hosting management UI
|
|
206
|
+
│ ├── index.ts # MCP server
|
|
207
|
+
│ ├── client.ts # FlowEngine API client
|
|
208
|
+
│ └── ui/ # Dashboard renderers
|
|
209
|
+
│ ├── base.ts
|
|
210
|
+
│ ├── portals.ts
|
|
211
|
+
│ ├── widgets.ts
|
|
212
|
+
│ └── instances.ts
|
|
171
213
|
├── package.json
|
|
172
214
|
├── tsconfig.json
|
|
173
215
|
└── README.md
|
|
174
216
|
```
|
|
175
217
|
|
|
176
|
-
### Build
|
|
218
|
+
### Using Local Build
|
|
177
219
|
|
|
178
|
-
|
|
179
|
-
|
|
220
|
+
Point your MCP config to local build:
|
|
221
|
+
|
|
222
|
+
```json
|
|
223
|
+
{
|
|
224
|
+
"mcpServers": {
|
|
225
|
+
"flowengine": {
|
|
226
|
+
"command": "node",
|
|
227
|
+
"args": ["/path/to/flowengine-mcp/build/index.js"],
|
|
228
|
+
"env": {
|
|
229
|
+
"FLOWENGINE_API_KEY": "your-key"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
180
234
|
```
|
|
181
235
|
|
|
182
|
-
|
|
236
|
+
## Troubleshooting
|
|
183
237
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
238
|
+
### API Key Issues
|
|
239
|
+
|
|
240
|
+
**Error: "FlowEngine API key not configured"**
|
|
241
|
+
|
|
242
|
+
Solution: Verify `FLOWENGINE_API_KEY` is set in your MCP config
|
|
243
|
+
|
|
244
|
+
### Connection Issues
|
|
245
|
+
|
|
246
|
+
**Error: "Failed to connect to FlowEngine API"**
|
|
247
|
+
|
|
248
|
+
Solutions:
|
|
249
|
+
- Check your internet connection
|
|
250
|
+
- Verify API key is valid
|
|
251
|
+
- Ensure `FLOWENGINE_BASE_URL` is correct (if using custom)
|
|
252
|
+
|
|
253
|
+
### MCP Server Not Starting
|
|
187
254
|
|
|
188
|
-
|
|
255
|
+
**Server doesn't appear in Claude**
|
|
189
256
|
|
|
190
|
-
|
|
257
|
+
Solutions:
|
|
258
|
+
- Restart Claude Desktop / reload VSCode / start new Claude Code session
|
|
259
|
+
- Check MCP config JSON syntax is valid
|
|
260
|
+
- View logs: `~/.claude/debug/latest` (Claude Code)
|
|
191
261
|
|
|
192
|
-
##
|
|
262
|
+
## Support
|
|
193
263
|
|
|
194
|
-
|
|
264
|
+
- **FlowEngine Support**: [flowengine.cloud/support](https://flowengine.cloud/support)
|
|
265
|
+
- **Documentation**: [docs.flowengine.cloud](https://docs.flowengine.cloud)
|
|
266
|
+
- **GitHub Issues**: [github.com/FlowEngine-cloud/flowengine/issues](https://github.com/FlowEngine-cloud/flowengine/issues)
|
|
267
|
+
- **MCP Protocol**: [modelcontextprotocol.io](https://modelcontextprotocol.io)
|
|
195
268
|
|
|
196
|
-
##
|
|
269
|
+
## License
|
|
197
270
|
|
|
198
|
-
|
|
199
|
-
- FlowEngine: [https://flowengine.cloud/support](https://flowengine.cloud/support)
|
|
200
|
-
- MCP Documentation: [https://modelcontextprotocol.io](https://modelcontextprotocol.io)
|
|
271
|
+
MIT License - See LICENSE file for details
|
|
201
272
|
|
|
202
|
-
##
|
|
273
|
+
## Contributing
|
|
203
274
|
|
|
204
|
-
|
|
275
|
+
Contributions welcome! Please read our contributing guidelines before submitting PRs.
|
|
205
276
|
|
|
206
|
-
|
|
207
|
-
- [ ] Workflow editor integration
|
|
208
|
-
- [ ] Template marketplace
|
|
209
|
-
- [ ] Advanced analytics dashboard
|
|
210
|
-
- [ ] Team collaboration features
|
|
211
|
-
- [ ] Webhook testing UI
|
|
212
|
-
- [ ] Credential management UI
|
|
213
|
-
- [ ] Backup & restore UI
|
|
277
|
+
---
|
|
214
278
|
|
|
215
|
-
|
|
279
|
+
Built by the FlowEngine team
|
package/build/client.d.ts
CHANGED
|
@@ -10,20 +10,25 @@ export declare class FlowEngineClient {
|
|
|
10
10
|
private apiKey;
|
|
11
11
|
private baseUrl;
|
|
12
12
|
constructor(config: FlowEngineConfig);
|
|
13
|
+
/**
|
|
14
|
+
* Parse error response based on Content-Type
|
|
15
|
+
* Handles JSON, HTML, and plain text responses
|
|
16
|
+
*/
|
|
17
|
+
private parseErrorResponse;
|
|
13
18
|
private request;
|
|
14
|
-
getClientInstances(): Promise<
|
|
19
|
+
getClientInstances(): Promise<any[]>;
|
|
15
20
|
getClientPanelWorkflows(instanceId: string): Promise<unknown>;
|
|
16
21
|
getClientPanelWidgets(instanceId: string): Promise<unknown>;
|
|
17
22
|
getWorkflows(instanceId?: string): Promise<unknown>;
|
|
18
23
|
toggleWorkflow(workflowId: string, enabled: boolean): Promise<unknown>;
|
|
19
24
|
archiveWorkflow(workflowId: string): Promise<unknown>;
|
|
20
25
|
getWorkflowParameters(workflowId: string): Promise<unknown>;
|
|
21
|
-
getWidgets(instanceId?: string): Promise<
|
|
26
|
+
getWidgets(instanceId?: string): Promise<any[]>;
|
|
22
27
|
getWidget(widgetId: string): Promise<unknown>;
|
|
23
28
|
createWidget(data: any): Promise<unknown>;
|
|
24
29
|
updateWidget(widgetId: string, data: any): Promise<unknown>;
|
|
25
30
|
deleteWidget(widgetId: string): Promise<unknown>;
|
|
26
|
-
getInstances(): Promise<
|
|
31
|
+
getInstances(): Promise<any[]>;
|
|
27
32
|
getInstanceStatus(instanceId: string): Promise<unknown>;
|
|
28
33
|
provisionInstance(data: any): Promise<unknown>;
|
|
29
34
|
updateInstance(data: any): Promise<unknown>;
|
package/build/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,gBAAgB;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,gBAAgB;IAKpC;;;OAGG;YACW,kBAAkB;YAuBlB,OAAO;IAmBf,kBAAkB;IAKlB,uBAAuB,CAAC,UAAU,EAAE,MA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apiKey;
|
|
10
10
|
this.baseUrl = config.baseUrl || 'https://flowengine.cloud';
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Parse error response based on Content-Type
|
|
14
|
+
* Handles JSON, HTML, and plain text responses
|
|
15
|
+
*/
|
|
16
|
+
async parseErrorResponse(response) {
|
|
17
|
+
const contentType = response.headers.get('content-type') || '';
|
|
18
|
+
// Handle JSON error responses
|
|
19
|
+
if (contentType.includes('application/json')) {
|
|
20
|
+
try {
|
|
21
|
+
const json = await response.json();
|
|
22
|
+
return json.error || json.message || JSON.stringify(json);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return 'Invalid JSON error response';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// Handle HTML error pages
|
|
29
|
+
const text = await response.text();
|
|
30
|
+
if (text.includes('<!DOCTYPE') || text.includes('<html')) {
|
|
31
|
+
return `Server error (HTTP ${response.status})`;
|
|
32
|
+
}
|
|
33
|
+
// Handle plain text, truncate if too long
|
|
34
|
+
return text.length > 200 ? text.substring(0, 200) + '...' : text;
|
|
35
|
+
}
|
|
12
36
|
async request(endpoint, options = {}) {
|
|
13
37
|
const url = `${this.baseUrl}${endpoint}`;
|
|
14
38
|
const headers = {
|
|
@@ -18,14 +42,15 @@ export class FlowEngineClient {
|
|
|
18
42
|
};
|
|
19
43
|
const response = await fetch(url, { ...options, headers });
|
|
20
44
|
if (!response.ok) {
|
|
21
|
-
const error = await
|
|
45
|
+
const error = await this.parseErrorResponse(response);
|
|
22
46
|
throw new Error(`FlowEngine API Error (${response.status}): ${error}`);
|
|
23
47
|
}
|
|
24
48
|
return response.json();
|
|
25
49
|
}
|
|
26
50
|
// Portal / Client Panel APIs
|
|
27
51
|
async getClientInstances() {
|
|
28
|
-
|
|
52
|
+
const response = await this.request('/api/mcp/portals');
|
|
53
|
+
return response.portals || [];
|
|
29
54
|
}
|
|
30
55
|
async getClientPanelWorkflows(instanceId) {
|
|
31
56
|
return this.request(`/api/client-panel/${instanceId}/workflows`);
|
|
@@ -36,7 +61,7 @@ export class FlowEngineClient {
|
|
|
36
61
|
// Workflow APIs
|
|
37
62
|
async getWorkflows(instanceId) {
|
|
38
63
|
const params = instanceId ? `?instanceId=${instanceId}` : '';
|
|
39
|
-
return this.request(`/api/
|
|
64
|
+
return this.request(`/api/mcp/workflows${params}`);
|
|
40
65
|
}
|
|
41
66
|
async toggleWorkflow(workflowId, enabled) {
|
|
42
67
|
return this.request(`/api/client/workflows/${workflowId}/toggle`, {
|
|
@@ -55,7 +80,8 @@ export class FlowEngineClient {
|
|
|
55
80
|
// Widget / UI Builder APIs
|
|
56
81
|
async getWidgets(instanceId) {
|
|
57
82
|
const params = instanceId ? `?instanceId=${instanceId}` : '';
|
|
58
|
-
|
|
83
|
+
const response = await this.request(`/api/mcp/components${params}`);
|
|
84
|
+
return response.components || [];
|
|
59
85
|
}
|
|
60
86
|
async getWidget(widgetId) {
|
|
61
87
|
return this.request(`/api/client/widgets/${widgetId}`);
|
|
@@ -79,7 +105,8 @@ export class FlowEngineClient {
|
|
|
79
105
|
}
|
|
80
106
|
// Instance / Hosting APIs
|
|
81
107
|
async getInstances() {
|
|
82
|
-
|
|
108
|
+
const response = await this.request('/api/mcp/instances');
|
|
109
|
+
return response.instances || [];
|
|
83
110
|
}
|
|
84
111
|
async getInstanceStatus(instanceId) {
|
|
85
112
|
return this.request(`/api/n8n/status?instanceId=${instanceId}`);
|
package/build/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,OAAO,gBAAgB;IACnB,MAAM,CAAS;IACf,OAAO,CAAS;IAExB,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,0BAA0B,CAAC;IAC9D,CAAC;IA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/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* FlowEngine MCP
|
|
4
|
-
*
|
|
3
|
+
* FlowEngine MCP Server
|
|
4
|
+
* Manage your white-label automation platform from Claude
|
|
5
|
+
*
|
|
6
|
+
* Core Features:
|
|
7
|
+
* 1. Instance Management - Provision and manage FlowEngine instances
|
|
8
|
+
* 2. Client Portals - Monitor and access client portals
|
|
9
|
+
* 3. AI FlowBuilder - Create forms, chatbots, and UI components
|
|
5
10
|
*/
|
|
6
11
|
export {};
|
|
7
12
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;GAQG"}
|