flowengine-mcp-app 2.0.1 → 3.0.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.
Files changed (48) hide show
  1. package/README.md +19 -270
  2. package/bin.js +12 -0
  3. package/package.json +8 -29
  4. package/LICENSE +0 -21
  5. package/build/client.d.ts +0 -56
  6. package/build/client.d.ts.map +0 -1
  7. package/build/client.js +0 -188
  8. package/build/client.js.map +0 -1
  9. package/build/index.d.ts +0 -12
  10. package/build/index.d.ts.map +0 -1
  11. package/build/index.js +0 -339
  12. package/build/index.js.map +0 -1
  13. package/build/ui/base.d.ts +0 -8
  14. package/build/ui/base.d.ts.map +0 -1
  15. package/build/ui/base.js +0 -425
  16. package/build/ui/base.js.map +0 -1
  17. package/build/ui/component-viewer.d.ts +0 -14
  18. package/build/ui/component-viewer.d.ts.map +0 -1
  19. package/build/ui/component-viewer.js +0 -678
  20. package/build/ui/component-viewer.js.map +0 -1
  21. package/build/ui/dashboard.d.ts +0 -21
  22. package/build/ui/dashboard.d.ts.map +0 -1
  23. package/build/ui/dashboard.js +0 -252
  24. package/build/ui/dashboard.js.map +0 -1
  25. package/build/ui/demo.d.ts +0 -14
  26. package/build/ui/demo.d.ts.map +0 -1
  27. package/build/ui/demo.js +0 -222
  28. package/build/ui/demo.js.map +0 -1
  29. package/build/ui/instances.d.ts +0 -17
  30. package/build/ui/instances.d.ts.map +0 -1
  31. package/build/ui/instances.js +0 -233
  32. package/build/ui/instances.js.map +0 -1
  33. package/build/ui/n8n-viewer.d.ts +0 -12
  34. package/build/ui/n8n-viewer.d.ts.map +0 -1
  35. package/build/ui/n8n-viewer.js +0 -371
  36. package/build/ui/n8n-viewer.js.map +0 -1
  37. package/build/ui/portals.d.ts +0 -14
  38. package/build/ui/portals.d.ts.map +0 -1
  39. package/build/ui/portals.js +0 -184
  40. package/build/ui/portals.js.map +0 -1
  41. package/build/ui/widgets.d.ts +0 -17
  42. package/build/ui/widgets.d.ts.map +0 -1
  43. package/build/ui/widgets.js +0 -200
  44. package/build/ui/widgets.js.map +0 -1
  45. package/build/ui/workflows.d.ts +0 -17
  46. package/build/ui/workflows.d.ts.map +0 -1
  47. package/build/ui/workflows.js +0 -217
  48. package/build/ui/workflows.js.map +0 -1
package/README.md CHANGED
@@ -1,290 +1,39 @@
1
- # FlowEngine MCP Server
1
+ # flowengine-mcp-app
2
2
 
3
- **Control your white-label automation platform directly from Claude**
3
+ > Renamed to **[`@flowengine.cloud/flowengine-cli`](https://www.npmjs.com/package/@flowengine.cloud/flowengine-cli)**.
4
4
 
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.
5
+ This package is now a thin shim. Existing setups using
6
+ `npx -y flowengine-mcp-app` continue to work unchanged — the shim forwards
7
+ to the real MCP server inside `@flowengine.cloud/flowengine-cli`.
6
8
 
7
- ## What is FlowEngine?
8
-
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.
10
-
11
- ## Core Features
12
-
13
- ### Instance Management
14
- Provision and manage FlowEngine instances for your clients:
15
- - List all instances with details
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 and access details
24
- - Monitor workflows and components per portal
25
-
26
- ### AI FlowBuilder
27
- Create and manage UI components with AI:
28
- - Build forms, chatbots, and widgets
29
- - List all components across instances
30
- - Update component configurations
31
- - Delete components
32
-
33
- ## Installation
34
-
35
- ### Prerequisites
36
- - Node.js 18 or higher
37
- - FlowEngine account with API key ([Get one here](https://flowengine.cloud))
38
- - Claude Desktop, VSCode, or Claude Code CLI
39
-
40
- ### Get Your API Key
41
-
42
- 1. Log in to [FlowEngine](https://flowengine.cloud)
43
- 2. Go to Settings → API Access
44
- 3. Click "Generate API Key"
45
- 4. Copy your key (shown only once)
46
-
47
- ### Quick Setup
48
-
49
- #### Claude Desktop
50
-
51
- Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
52
-
53
- ```json
54
- {
55
- "mcpServers": {
56
- "flowengine": {
57
- "command": "npx",
58
- "args": ["-y", "flowengine-mcp-app"],
59
- "env": {
60
- "FLOWENGINE_API_KEY": "your-api-key-here"
61
- }
62
- }
63
- }
64
- }
65
- ```
66
-
67
- #### Claude Code CLI
68
-
69
- Edit `~/.claude/claude_code_config.json`:
70
-
71
- ```json
72
- {
73
- "mcpServers": {
74
- "flowengine": {
75
- "command": "npx",
76
- "args": ["-y", "flowengine-mcp-app"],
77
- "env": {
78
- "FLOWENGINE_API_KEY": "your-api-key-here"
79
- }
80
- }
81
- }
82
- }
83
- ```
84
-
85
- #### VSCode (Claude Extension)
86
-
87
- Add to your VSCode settings:
88
-
89
- ```json
90
- {
91
- "mcp.servers": {
92
- "flowengine": {
93
- "command": "npx",
94
- "args": ["-y", "flowengine-mcp-app"],
95
- "env": {
96
- "FLOWENGINE_API_KEY": "your-api-key-here"
97
- }
98
- }
99
- }
100
- }
101
- ```
102
-
103
- **Then restart** Claude Desktop, start a new Claude Code session, or reload VSCode.
104
-
105
- ## Usage
106
-
107
- ### 🎨 Interactive Dashboards (MCP Apps)
108
-
109
- **NEW!** Visual dashboards with interactive HTML interfaces. Ask Claude:
110
-
111
- | Command | What You Get |
112
- |---------|--------------|
113
- | **"Show me the FlowEngine client portals dashboard"** | Interactive dashboard with all your client portals, URLs, and storage details |
114
- | **"Show me the AI FlowBuilder"** | Visual dashboard for managing forms, chatbots, and widgets across all instances |
115
- | **"Show me my FlowEngine instances"** | Instance manager dashboard with resource details and quick actions |
116
-
117
- **How it works:**
118
- 1. Ask Claude using the exact commands above
119
- 2. Claude will display a rich HTML dashboard
120
- 3. View all your data in a visual, organized format
121
-
122
- **Fallback:** If dashboards don't appear, use text-based tools:
123
- ```
124
- "Use flowengine_list_portals to show my portals"
125
- "Use flowengine_list_instances"
126
- "Use flowengine_list_components"
127
- ```
128
-
129
- ### 💬 Natural Language Commands
130
-
131
- Manage your platform through conversation:
132
-
133
- ```
134
- "List all my FlowEngine instances"
135
- "What's the status of instance abc123?"
136
- "Create a new contact form widget"
137
- "Show me all UI components"
138
- "Provision a new instance for Acme Corp"
139
- ```
140
-
141
- ## Available Tools
142
-
143
- ### Instance Management (5 tools)
144
- - `flowengine_list_instances` - List all instances
145
- - `flowengine_get_instance_status` - Get instance health
146
- - `flowengine_create_instance` - Provision new instance
147
- - `flowengine_update_instance` - Update settings
148
- - `flowengine_delete_instance` - Delete instance
149
-
150
- ### Client Portals (1 tool)
151
- - `flowengine_list_portals` - List all portals
152
-
153
- ### AI FlowBuilder (5 tools)
154
- - `flowengine_list_components` - List UI components
155
- - `flowengine_get_component` - Get component details
156
- - `flowengine_create_component` - Create form/chatbot/widget
157
- - `flowengine_update_component` - Update component
158
- - `flowengine_delete_component` - Delete component
159
-
160
- **Total: 11 tools** (optimized to prevent API concurrency issues)
161
-
162
- ## Resources
163
-
164
- Interactive UI dashboards available via MCP Apps (MCP v1.1+):
165
-
166
- - `ui://flowengine/portals` - Client Portals Dashboard
167
- - `ui://flowengine/ui-builder` - AI FlowBuilder
168
- - `ui://flowengine/instances` - Instance Manager
169
-
170
- **Note**: MCP Apps is a new feature announced January 26, 2026. Support may vary by client:
171
- - ✅ Claude Desktop: Coming soon
172
- - ✅ Claude Code: Check version compatibility
173
- - ✅ VSCode: Depends on extension version
174
-
175
- ## Configuration
176
-
177
- ### Environment Variables
178
-
179
- - `FLOWENGINE_API_KEY` (required) - Your FlowEngine API key
180
- - `FLOWENGINE_BASE_URL` (optional) - Custom base URL (defaults to https://flowengine.cloud)
181
-
182
- ### Custom Base URL
183
-
184
- For self-hosted or custom deployments:
185
-
186
- ```json
187
- {
188
- "env": {
189
- "FLOWENGINE_API_KEY": "your-key",
190
- "FLOWENGINE_BASE_URL": "https://your-domain.com"
191
- }
192
- }
193
- ```
194
-
195
- ## Development
196
-
197
- ### Local Development
9
+ ## New install (recommended)
198
10
 
199
11
  ```bash
200
- # Clone and install
201
- git clone https://github.com/FlowEngine-cloud/flowengine.git
202
- cd flowengine/flowengine-mcp
203
- npm install
204
-
205
- # Build
206
- npm run build
207
-
208
- # Test locally
209
- node build/index.js
12
+ npm install -g @flowengine.cloud/flowengine-cli
210
13
  ```
211
14
 
212
- ### Project Structure
213
-
214
- ```
215
- flowengine-mcp/
216
- ├── src/
217
- │ ├── index.ts # MCP server
218
- │ ├── client.ts # FlowEngine API client
219
- │ └── ui/ # Dashboard renderers
220
- │ ├── base.ts
221
- │ ├── portals.ts
222
- │ ├── widgets.ts
223
- │ └── instances.ts
224
- ├── package.json
225
- ├── tsconfig.json
226
- └── README.md
227
- ```
15
+ This gives you:
228
16
 
229
- ### Using Local Build
17
+ - `fe` / `flowengine` — CLI for deploying and managing FlowEngine Functions
18
+ - `flowengine-mcp` — MCP server for Claude Desktop / VSCode / Cursor
230
19
 
231
- Point your MCP config to local build:
20
+ ## Claude Desktop config
232
21
 
233
- ```json
22
+ ```jsonc
234
23
  {
235
24
  "mcpServers": {
236
25
  "flowengine": {
237
- "command": "node",
238
- "args": ["/path/to/flowengine-mcp/build/index.js"],
239
- "env": {
240
- "FLOWENGINE_API_KEY": "your-key"
241
- }
26
+ "command": "npx",
27
+ "args": ["-y", "@flowengine.cloud/flowengine-cli"],
28
+ "env": { "FLOWENGINE_API_KEY": "fe_..." }
242
29
  }
243
30
  }
244
31
  }
245
32
  ```
246
33
 
247
- ## Troubleshooting
248
-
249
- ### API Key Issues
250
-
251
- **Error: "FlowEngine API key not configured"**
252
-
253
- Solution: Verify `FLOWENGINE_API_KEY` is set in your MCP config
254
-
255
- ### Connection Issues
256
-
257
- **Error: "Failed to connect to FlowEngine API"**
258
-
259
- Solutions:
260
- - Check your internet connection
261
- - Verify API key is valid
262
- - Ensure `FLOWENGINE_BASE_URL` is correct (if using custom)
263
-
264
- ### MCP Server Not Starting
265
-
266
- **Server doesn't appear in Claude**
267
-
268
- Solutions:
269
- - Restart Claude Desktop / reload VSCode / start new Claude Code session
270
- - Check MCP config JSON syntax is valid
271
- - View logs: `~/.claude/debug/latest` (Claude Code)
272
-
273
- ## Support
274
-
275
- - **FlowEngine Support**: [flowengine.cloud/support](https://flowengine.cloud/support)
276
- - **Documentation**: [docs.flowengine.cloud](https://docs.flowengine.cloud)
277
- - **GitHub Issues**: [github.com/FlowEngine-cloud/flowengine/issues](https://github.com/FlowEngine-cloud/flowengine/issues)
278
- - **MCP Protocol**: [modelcontextprotocol.io](https://modelcontextprotocol.io)
279
-
280
- ## License
281
-
282
- MIT License - See LICENSE file for details
283
-
284
- ## Contributing
285
-
286
- Contributions welcome! Please read our contributing guidelines before submitting PRs.
34
+ The old `flowengine-mcp-app` name in `args` still works via this shim.
287
35
 
288
- ---
36
+ ## Links
289
37
 
290
- Built by the FlowEngine team
38
+ - Homepage: <https://flowengine.cloud>
39
+ - Issues: <https://github.com/flowengine/flowengine/issues>
package/bin.js ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Back-compat shim. The MCP server now ships inside
4
+ * @flowengine.cloud/flowengine-cli. Existing
5
+ * `npx -y flowengine-mcp-app` setups still work because that package is
6
+ * declared as a dependency and we hand control to its MCP entry point.
7
+ */
8
+
9
+ import { createRequire } from 'node:module';
10
+ const require = createRequire(import.meta.url);
11
+ const target = require.resolve('@flowengine.cloud/flowengine-cli/build/index.js');
12
+ await import(target);
package/package.json CHANGED
@@ -1,54 +1,33 @@
1
1
  {
2
2
  "name": "flowengine-mcp-app",
3
- "version": "2.0.1",
4
- "description": "FlowEngine Model Context Protocol server for Claude. Manage n8n workflows, build UI components, configure client portals, and provision instances directly from Claude Desktop, VSCode, or CLI. Built with modern MCP Apps API.",
3
+ "version": "3.0.1",
4
+ "description": "Renamed to @flowengine.cloud/flowengine-cli. This thin shim re-exports the MCP server so existing `npx -y flowengine-mcp-app` configs keep working unchanged.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "flowengine-mcp": "./build/index.js"
7
+ "flowengine-mcp": "./bin.js"
8
8
  },
9
- "main": "./build/index.js",
10
9
  "files": [
11
- "build/**/*",
12
- "README.md",
13
- "LICENSE"
10
+ "bin.js",
11
+ "README.md"
14
12
  ],
15
13
  "repository": {
16
14
  "type": "git",
17
15
  "url": "https://github.com/flowengine/flowengine.git",
18
- "directory": "flowengine-mcp"
16
+ "directory": "flowengine-mcp-app"
19
17
  },
20
18
  "homepage": "https://flowengine.cloud",
21
19
  "bugs": {
22
20
  "url": "https://github.com/flowengine/flowengine/issues"
23
21
  },
24
- "scripts": {
25
- "build": "tsc",
26
- "prepare": "npm run build",
27
- "dev": "tsc --watch",
28
- "prepublishOnly": "npm run build"
29
- },
30
22
  "keywords": [
31
23
  "flowengine",
32
24
  "mcp",
33
- "mcp-app",
34
- "mcp-apps",
35
- "model-context-protocol",
36
- "claude",
37
- "automation",
38
- "n8n",
39
- "ui",
40
- "workflows",
41
- "no-code"
25
+ "deprecated-alias"
42
26
  ],
43
27
  "author": "FlowEngine",
44
28
  "license": "MIT",
45
29
  "dependencies": {
46
- "@modelcontextprotocol/ext-apps": "^1.0.1",
47
- "@modelcontextprotocol/sdk": "^1.25.0"
48
- },
49
- "devDependencies": {
50
- "@types/node": "^22.10.5",
51
- "typescript": "^5.7.3"
30
+ "@flowengine.cloud/flowengine-cli": "3.0.0"
52
31
  },
53
32
  "engines": {
54
33
  "node": ">=18.0.0"
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 FlowEngine
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/build/client.d.ts DELETED
@@ -1,56 +0,0 @@
1
- /**
2
- * FlowEngine API Client
3
- * Handles all API requests with API key authentication
4
- */
5
- export interface FlowEngineConfig {
6
- apiKey: string;
7
- baseUrl?: string;
8
- }
9
- export declare class FlowEngineClient {
10
- private apiKey;
11
- private baseUrl;
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;
18
- private request;
19
- getClientInstances(): Promise<any[]>;
20
- getClientPanelWorkflows(instanceId: string): Promise<unknown>;
21
- getClientPanelWidgets(instanceId: string): Promise<unknown>;
22
- getWorkflows(instanceId?: string): Promise<unknown>;
23
- toggleWorkflow(workflowId: string, enabled: boolean): Promise<unknown>;
24
- archiveWorkflow(workflowId: string): Promise<unknown>;
25
- getWorkflowParameters(workflowId: string): Promise<unknown>;
26
- getWidgets(instanceId?: string): Promise<any[]>;
27
- getWidget(widgetId: string): Promise<unknown>;
28
- createWidget(data: any): Promise<unknown>;
29
- updateWidget(widgetId: string, data: any): Promise<unknown>;
30
- deleteWidget(widgetId: string): Promise<unknown>;
31
- getInstances(): Promise<any[]>;
32
- getInstanceStatus(instanceId: string): Promise<unknown>;
33
- provisionInstance(data: any): Promise<unknown>;
34
- updateInstance(data: any): Promise<unknown>;
35
- deleteInstance(instanceId: string): Promise<unknown>;
36
- getExecutions(instanceId?: string): Promise<unknown>;
37
- getWorkflowExecutions(workflowId: string): Promise<unknown>;
38
- importWorkflowToInstance(data: {
39
- instanceId: string;
40
- workflowJSON: any;
41
- workflowTitle?: string;
42
- }): Promise<unknown>;
43
- importTemplate(data: {
44
- templateId: string;
45
- instanceId: string;
46
- }): Promise<unknown>;
47
- listTemplates(): Promise<unknown>;
48
- getCredentials(instanceId?: string): Promise<unknown>;
49
- getCredentialTypes(): Promise<unknown>;
50
- createCredential(data: any): Promise<unknown>;
51
- deleteCredential(credentialId: string): Promise<unknown>;
52
- testCredential(data: any): Promise<unknown>;
53
- getUserBudget(): Promise<unknown>;
54
- getApiKeyInfo(): Promise<unknown>;
55
- }
56
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
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,MAAM;IAI1C,qBAAqB,CAAC,UAAU,EAAE,MAAM;IAKxC,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM;IAKhC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAOnD,eAAe,CAAC,UAAU,EAAE,MAAM;IAMlC,qBAAqB,CAAC,UAAU,EAAE,MAAM;IAKxC,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM;IAM9B,SAAS,CAAC,QAAQ,EAAE,MAAM;IAI1B,YAAY,CAAC,IAAI,EAAE,GAAG;IAOtB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;IAOxC,YAAY,CAAC,QAAQ,EAAE,MAAM;IAO7B,YAAY;IAKZ,iBAAiB,CAAC,UAAU,EAAE,MAAM;IAIpC,iBAAiB,CAAC,IAAI,EAAE,GAAG;IAO3B,cAAc,CAAC,IAAI,EAAE,GAAG;IAOxB,cAAc,CAAC,UAAU,EAAE,MAAM;IAQjC,aAAa,CAAC,UAAU,CAAC,EAAE,MAAM;IAKjC,qBAAqB,CAAC,UAAU,EAAE,MAAM;IAIxC,wBAAwB,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,GAAG,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;IAOhG,cAAc,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE;IAO/D,aAAa;IAKb,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM;IAKlC,kBAAkB;IAIlB,gBAAgB,CAAC,IAAI,EAAE,GAAG;IAO1B,gBAAgB,CAAC,YAAY,EAAE,MAAM;IAMrC,cAAc,CAAC,IAAI,EAAE,GAAG;IAQxB,aAAa;IAIb,aAAa;CAGpB"}
package/build/client.js DELETED
@@ -1,188 +0,0 @@
1
- /**
2
- * FlowEngine API Client
3
- * Handles all API requests with API key authentication
4
- */
5
- export class FlowEngineClient {
6
- apiKey;
7
- baseUrl;
8
- constructor(config) {
9
- this.apiKey = config.apiKey;
10
- this.baseUrl = config.baseUrl || 'https://flowengine.cloud';
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
- }
36
- async request(endpoint, options = {}) {
37
- const url = `${this.baseUrl}${endpoint}`;
38
- const headers = {
39
- 'Authorization': `Bearer ${this.apiKey}`,
40
- 'Content-Type': 'application/json',
41
- ...options.headers,
42
- };
43
- const response = await fetch(url, { ...options, headers });
44
- if (!response.ok) {
45
- const error = await this.parseErrorResponse(response);
46
- throw new Error(`FlowEngine API Error (${response.status}): ${error}`);
47
- }
48
- return response.json();
49
- }
50
- // Portal / Client Panel APIs
51
- async getClientInstances() {
52
- const response = await this.request('/api/mcp/portals');
53
- return response.portals || [];
54
- }
55
- async getClientPanelWorkflows(instanceId) {
56
- return this.request(`/api/client-panel/${instanceId}/workflows`);
57
- }
58
- async getClientPanelWidgets(instanceId) {
59
- return this.request(`/api/client-panel/${instanceId}/all-widgets`);
60
- }
61
- // Workflow APIs
62
- async getWorkflows(instanceId) {
63
- const params = instanceId ? `?instanceId=${instanceId}` : '';
64
- return this.request(`/api/mcp/workflows${params}`);
65
- }
66
- async toggleWorkflow(workflowId, enabled) {
67
- return this.request(`/api/client/workflows/${workflowId}/toggle`, {
68
- method: 'PATCH',
69
- body: JSON.stringify({ active: enabled }),
70
- });
71
- }
72
- async archiveWorkflow(workflowId) {
73
- return this.request(`/api/client/workflows/${workflowId}/archive`, {
74
- method: 'PATCH',
75
- });
76
- }
77
- async getWorkflowParameters(workflowId) {
78
- return this.request(`/api/client/workflows/${workflowId}/parameters`);
79
- }
80
- // Widget / UI Builder APIs
81
- async getWidgets(instanceId) {
82
- const params = instanceId ? `?instanceId=${instanceId}` : '';
83
- const response = await this.request(`/api/mcp/components${params}`);
84
- return response.components || [];
85
- }
86
- async getWidget(widgetId) {
87
- return this.request(`/api/client/widgets/${widgetId}`);
88
- }
89
- async createWidget(data) {
90
- return this.request('/api/client/widgets', {
91
- method: 'POST',
92
- body: JSON.stringify(data),
93
- });
94
- }
95
- async updateWidget(widgetId, data) {
96
- return this.request(`/api/client/widgets/${widgetId}`, {
97
- method: 'PUT',
98
- body: JSON.stringify(data),
99
- });
100
- }
101
- async deleteWidget(widgetId) {
102
- return this.request(`/api/client/widgets/${widgetId}`, {
103
- method: 'DELETE',
104
- });
105
- }
106
- // Instance / Hosting APIs
107
- async getInstances() {
108
- const response = await this.request('/api/mcp/instances');
109
- return response.instances || [];
110
- }
111
- async getInstanceStatus(instanceId) {
112
- return this.request(`/api/n8n/status?instanceId=${instanceId}`);
113
- }
114
- async provisionInstance(data) {
115
- return this.request('/api/n8n/provision-instance', {
116
- method: 'POST',
117
- body: JSON.stringify(data),
118
- });
119
- }
120
- async updateInstance(data) {
121
- return this.request('/api/n8n/manage', {
122
- method: 'POST',
123
- body: JSON.stringify(data),
124
- });
125
- }
126
- async deleteInstance(instanceId) {
127
- return this.request('/api/n8n/delete-instance', {
128
- method: 'POST',
129
- body: JSON.stringify({ instanceId }),
130
- });
131
- }
132
- // Execution APIs
133
- async getExecutions(instanceId) {
134
- const params = instanceId ? `?instanceId=${instanceId}` : '';
135
- return this.request(`/api/client/executions${params}`);
136
- }
137
- async getWorkflowExecutions(workflowId) {
138
- return this.request(`/api/client/workflows/${workflowId}/executions`);
139
- }
140
- async importWorkflowToInstance(data) {
141
- return this.request('/api/workflows/import-to-instance', {
142
- method: 'POST',
143
- body: JSON.stringify(data),
144
- });
145
- }
146
- async importTemplate(data) {
147
- return this.request(`/api/client/templates/${data.templateId}/import`, {
148
- method: 'POST',
149
- body: JSON.stringify({ instanceId: data.instanceId }),
150
- });
151
- }
152
- async listTemplates() {
153
- return this.request('/api/n8n-templates');
154
- }
155
- // Credential APIs
156
- async getCredentials(instanceId) {
157
- const params = instanceId ? `?instanceId=${instanceId}` : '';
158
- return this.request(`/api/client/credentials${params}`);
159
- }
160
- async getCredentialTypes() {
161
- return this.request('/api/client/credentials/types');
162
- }
163
- async createCredential(data) {
164
- return this.request('/api/client/credentials', {
165
- method: 'POST',
166
- body: JSON.stringify(data),
167
- });
168
- }
169
- async deleteCredential(credentialId) {
170
- return this.request(`/api/client/credentials/${credentialId}`, {
171
- method: 'DELETE',
172
- });
173
- }
174
- async testCredential(data) {
175
- return this.request('/api/client/credentials/test', {
176
- method: 'POST',
177
- body: JSON.stringify(data),
178
- });
179
- }
180
- // User / Budget APIs
181
- async getUserBudget() {
182
- return this.request('/api/client/budget');
183
- }
184
- async getApiKeyInfo() {
185
- return this.request('/api/user/api-keys/info');
186
- }
187
- }
188
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
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;IAED;;;OAGG;IACK,KAAK,CAAC,kBAAkB,CAAC,QAAkB;QACjD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QAE/D,8BAA8B;QAC9B,IAAI,WAAW,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACnC,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC5D,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,6BAA6B,CAAC;YACvC,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- /**
3
- * FlowEngine MCP Server - Modern MCP Apps Implementation
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
10
- */
11
- export {};
12
- //# sourceMappingURL=index.d.ts.map