@serenichron/mcp-cloudron 0.1.0 → 0.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.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # mcp-cloudron
2
2
 
3
+ [![npm version](https://badge.fury.io/js/%40serenichron%2Fmcp-cloudron.svg)](https://www.npmjs.com/package/@serenichron/mcp-cloudron)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![MCP](https://img.shields.io/badge/MCP-Compatible-blue.svg)](https://modelcontextprotocol.io)
6
+
3
7
  MCP server for [Cloudron](https://cloudron.io) instance management. List apps, get status, and manage your self-hosted applications through the Model Context Protocol.
4
8
 
5
9
  ## Features
@@ -164,16 +168,44 @@ The server uses the [Cloudron REST API](https://docs.cloudron.io/api/). Currentl
164
168
  - `GET /api/v1/apps/:id` - Get application by ID
165
169
  - `GET /api/v1/cloudron/status` - Get instance status
166
170
 
171
+ ## Changelog
172
+
173
+ ### v0.2.0 (2025-12-26)
174
+
175
+ **New Features**:
176
+ - 15 new MCP tools across app management, backups, users, infrastructure
177
+ - Pre-flight validation for destructive operations (F37)
178
+ - Storage checks before data creation (F36)
179
+ - Async task tracking and cancellation (F34, F35)
180
+
181
+ **Critical Bug Fixes**:
182
+ - F23b: Corrected endpoint path and added required domain parameter
183
+ - F04: Fixed HTTP method (DELETE → POST) for uninstall operation
184
+ - Both bugs discovered via real API testing (mock tests validated nothing)
185
+
186
+ **Testing**:
187
+ - Real Cloudron API integration testing
188
+ - Validated against live instance
189
+ - All 16 tools tested with actual API calls
190
+
167
191
  ## Roadmap
168
192
 
169
193
  Future versions may include:
170
194
 
171
- - [ ] App lifecycle management (start, stop, restart)
172
- - [ ] Backup operations
173
- - [ ] User management
174
195
  - [ ] Domain configuration
175
196
  - [ ] App installation from App Store
176
197
 
198
+ ## Community
199
+
200
+ - 💬 [Cloudron Forum](https://forum.cloudron.io) - Discussion and support
201
+ - 🐛 [Issue Tracker](https://github.com/serenichron/mcp-cloudron/issues) - Report bugs
202
+ - 💡 [Feature Requests](https://github.com/serenichron/mcp-cloudron/issues/new?labels=enhancement) - Suggest improvements
203
+
204
+ ### Related Projects
205
+
206
+ - [Model Context Protocol](https://modelcontextprotocol.io) - MCP documentation
207
+ - [Cloudron](https://cloudron.io) - Self-hosted app platform
208
+
177
209
  ## License
178
210
 
179
211
  MIT - See [LICENSE](LICENSE) for details.
@@ -3,7 +3,7 @@
3
3
  * MVP scope: listApps + getApp endpoints
4
4
  * DI-enabled for testing
5
5
  */
6
- import type { CloudronClientConfig, App, SystemStatus } from './types.js';
6
+ import type { CloudronClientConfig, App, SystemStatus, TaskStatus, StorageInfo, ValidatableOperation, ValidationResult, Backup, AppStoreApp, User, LogType, LogEntry, AppConfig, ConfigureAppResponse, ManifestValidationResult, InstallAppParams } from './types.js';
7
7
  export declare class CloudronClient {
8
8
  private readonly baseUrl;
9
9
  private readonly token;
@@ -34,5 +34,162 @@ export declare class CloudronClient {
34
34
  * GET /api/v1/cloudron/status
35
35
  */
36
36
  getStatus(): Promise<SystemStatus>;
37
+ /**
38
+ * List all backups
39
+ * GET /api/v1/backups
40
+ * @returns Array of backups sorted by timestamp (newest first)
41
+ */
42
+ listBackups(): Promise<Backup[]>;
43
+ /**
44
+ * Create a new backup (with F36 pre-flight storage check)
45
+ * POST /api/v1/backups
46
+ * @returns Task ID for tracking backup progress via getTaskStatus()
47
+ */
48
+ createBackup(): Promise<string>;
49
+ /**
50
+ * List all users on Cloudron instance
51
+ * GET /api/v1/users
52
+ * @returns Array of users sorted by role then email
53
+ */
54
+ listUsers(): Promise<User[]>;
55
+ /**
56
+ * Search Cloudron App Store for available applications
57
+ * GET /api/v1/appstore?search={query}
58
+ * @param query - Optional search query (empty returns all apps)
59
+ * @returns Array of app store apps sorted by relevance score
60
+ */
61
+ searchApps(query?: string): Promise<AppStoreApp[]>;
62
+ /**
63
+ * Create a new user with role assignment (atomic operation)
64
+ * POST /api/v1/users
65
+ * @param email - User email address
66
+ * @param password - User password (must meet strength requirements)
67
+ * @param role - User role: 'admin', 'user', or 'guest'
68
+ * @returns Created user object
69
+ */
70
+ createUser(email: string, password: string, role: 'admin' | 'user' | 'guest'): Promise<User>;
71
+ /**
72
+ * Validate email format using RFC 5322 simplified regex
73
+ * @param email - Email to validate
74
+ * @returns true if email format is valid
75
+ */
76
+ private isValidEmail;
77
+ /**
78
+ * Validate password strength
79
+ * Requirements: 8+ characters, 1 uppercase letter, 1 number
80
+ * @param password - Password to validate
81
+ * @returns true if password meets strength requirements
82
+ */
83
+ private isValidPassword;
84
+ /**
85
+ * Start an app
86
+ * POST /api/v1/apps/:appId/start
87
+ * @returns 202 Accepted response with task ID
88
+ */
89
+ startApp(appId: string): Promise<{
90
+ taskId: string;
91
+ }>;
92
+ /**
93
+ * Stop an app
94
+ * POST /api/v1/apps/:appId/stop
95
+ * @returns 202 Accepted response with task ID
96
+ */
97
+ stopApp(appId: string): Promise<{
98
+ taskId: string;
99
+ }>;
100
+ /**
101
+ * Restart an app
102
+ * POST /api/v1/apps/:appId/restart
103
+ * @returns 202 Accepted response with task ID
104
+ */
105
+ restartApp(appId: string): Promise<{
106
+ taskId: string;
107
+ }>;
108
+ /**
109
+ * Configure app settings (env vars, memory limits, access control)
110
+ * PUT /api/v1/apps/:appId/configure
111
+ * @param appId - The app ID to configure
112
+ * @param config - Configuration object with env vars, memoryLimit, accessRestriction
113
+ * @returns Response with updated app and restart requirement flag
114
+ */
115
+ configureApp(appId: string, config: AppConfig): Promise<ConfigureAppResponse>;
116
+ /**
117
+ * Uninstall an application (DESTRUCTIVE OPERATION)
118
+ * POST /api/v1/apps/:id/uninstall
119
+ * Returns task ID for async operation tracking
120
+ * Performs pre-flight validation via F37 before proceeding
121
+ */
122
+ uninstallApp(appId: string): Promise<{
123
+ taskId: string;
124
+ }>;
125
+ /**
126
+ * Get task status for async operations
127
+ * GET /api/v1/tasks/:taskId
128
+ */
129
+ getTaskStatus(taskId: string): Promise<TaskStatus>;
130
+ /**
131
+ * Cancel a running async operation (kill switch)
132
+ * DELETE /api/v1/tasks/:taskId
133
+ * @returns Updated task status with 'cancelled' state
134
+ */
135
+ cancelTask(taskId: string): Promise<TaskStatus>;
136
+ /**
137
+ * Get logs for an app or service
138
+ * GET /api/v1/apps/:id/logs or GET /api/v1/services/:id/logs
139
+ * @param resourceId - App ID or service ID
140
+ * @param type - Type of resource ('app' or 'service')
141
+ * @param lines - Optional number of log lines to retrieve (default 100, max 1000)
142
+ * @returns Formatted log entries with timestamps and severity levels
143
+ */
144
+ getLogs(resourceId: string, type: LogType, lines?: number): Promise<LogEntry[]>;
145
+ /**
146
+ * Parse raw log lines into structured LogEntry objects
147
+ * Attempts to extract timestamp and severity level from log lines
148
+ */
149
+ private parseLogEntries;
150
+ /**
151
+ * Check available disk space for pre-flight validation
152
+ * GET /api/v1/cloudron/status (reuses existing endpoint)
153
+ * @param requiredMB - Optional required disk space in MB
154
+ * @returns Storage info with availability and threshold checks
155
+ */
156
+ checkStorage(requiredMB?: number): Promise<StorageInfo>;
157
+ /**
158
+ * Validate a destructive operation before execution (pre-flight safety check)
159
+ * @param operation - Type of operation to validate
160
+ * @param resourceId - ID of the resource being operated on
161
+ * @returns Validation result with errors, warnings, and recommendations
162
+ */
163
+ validateOperation(operation: ValidatableOperation, resourceId: string): Promise<ValidationResult>;
164
+ /**
165
+ * Validate uninstall_app operation
166
+ * Checks: app exists, no dependent apps, backup exists
167
+ */
168
+ private validateUninstallApp;
169
+ /**
170
+ * Validate delete_user operation
171
+ * Checks: user exists, not last admin, not currently logged in
172
+ */
173
+ private validateDeleteUser;
174
+ /**
175
+ * Validate restore_backup operation
176
+ * Checks: backup exists, backup integrity valid, sufficient storage
177
+ */
178
+ private validateRestoreBackup;
179
+ /**
180
+ * Validate app manifest before installation (F23a pre-flight safety check)
181
+ * Checks: F36 storage sufficient, dependencies available, configuration schema valid
182
+ * @param appId - The app ID to validate from App Store
183
+ * @param requiredMB - Optional disk space requirement in MB (defaults to 500MB)
184
+ * @returns Validation result with errors and warnings
185
+ */
186
+ validateManifest(appId: string, requiredMB?: number): Promise<ManifestValidationResult>;
187
+ /**
188
+ * Install an application from the App Store (F23b with pre-flight validation)
189
+ * POST /api/v1/apps/install
190
+ * @param params - Installation parameters (manifestId, location, optional config)
191
+ * @returns Task ID for tracking installation progress via getTaskStatus()
192
+ */
193
+ installApp(params: InstallAppParams): Promise<string>;
37
194
  }
38
195
  //# sourceMappingURL=cloudron-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cloudron-client.d.ts","sourceRoot":"","sources":["../src/cloudron-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAA6B,YAAY,EAAE,MAAM,YAAY,CAAC;AAKrG,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAE/B;;;OAGG;gBACS,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAelD;;;OAGG;YACW,WAAW;IAiEzB;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAKhC;;;;;OAKG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAOzC;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC;CAGzC"}
1
+ {"version":3,"file":"cloudron-client.d.ts","sourceRoot":"","sources":["../src/cloudron-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAA6B,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,EAAmB,WAAW,EAAoB,IAAI,EAAiB,OAAO,EAAE,QAAQ,EAAgB,SAAS,EA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