@masonator/coolify-mcp 0.1.0 → 0.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 +129 -281
- package/dist/__tests__/coolify-client.test.js +242 -98
- package/dist/__tests__/mcp-server.test.js +143 -68
- package/dist/__tests__/resources/application-resources.test.d.ts +1 -0
- package/dist/__tests__/resources/application-resources.test.js +36 -0
- package/dist/__tests__/resources/database-resources.test.d.ts +1 -0
- package/dist/__tests__/resources/database-resources.test.js +72 -0
- package/dist/__tests__/resources/deployment-resources.test.d.ts +1 -0
- package/dist/__tests__/resources/deployment-resources.test.js +47 -0
- package/dist/__tests__/resources/service-resources.test.d.ts +1 -0
- package/dist/__tests__/resources/service-resources.test.js +81 -0
- package/dist/lib/coolify-client.d.ts +18 -6
- package/dist/lib/coolify-client.js +65 -15
- package/dist/lib/mcp-server.d.ts +24 -15
- package/dist/lib/mcp-server.js +270 -46
- package/dist/lib/resource.d.ts +13 -0
- package/dist/lib/resource.js +29 -0
- package/dist/resources/application-resources.d.ts +14 -0
- package/dist/resources/application-resources.js +59 -0
- package/dist/resources/database-resources.d.ts +17 -0
- package/dist/resources/database-resources.js +55 -0
- package/dist/resources/deployment-resources.d.ts +12 -0
- package/dist/resources/deployment-resources.js +48 -0
- package/dist/resources/index.d.ts +4 -0
- package/dist/resources/index.js +20 -0
- package/dist/resources/service-resources.d.ts +15 -0
- package/dist/resources/service-resources.js +55 -0
- package/dist/types/coolify.d.ts +163 -4
- package/package.json +4 -2
package/dist/lib/mcp-server.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoolifyMcpServer = void 0;
|
|
4
|
-
const
|
|
4
|
+
const mcp_1 = require("@modelcontextprotocol/sdk/server/mcp");
|
|
5
5
|
const coolify_client_js_1 = require("./coolify-client.js");
|
|
6
6
|
const zod_1 = require("zod");
|
|
7
|
+
const index_js_1 = require("../resources/index.js");
|
|
7
8
|
class CoolifyMcpServer {
|
|
8
9
|
constructor(config) {
|
|
9
|
-
this.server = new
|
|
10
|
+
this.server = new mcp_1.McpServer({
|
|
10
11
|
name: 'coolify',
|
|
11
12
|
version: '0.1.0',
|
|
12
13
|
});
|
|
13
14
|
this.client = new coolify_client_js_1.CoolifyClient(config);
|
|
15
|
+
this.databaseResources = new index_js_1.DatabaseResources(this.client);
|
|
16
|
+
this.deploymentResources = new index_js_1.DeploymentResources(this.client);
|
|
17
|
+
this.applicationResources = new index_js_1.ApplicationResources(this.client);
|
|
18
|
+
this.serviceResources = new index_js_1.ServiceResources(this.client);
|
|
14
19
|
this.setupTools();
|
|
15
20
|
}
|
|
16
21
|
setupTools() {
|
|
@@ -201,16 +206,11 @@ class CoolifyMcpServer {
|
|
|
201
206
|
};
|
|
202
207
|
}
|
|
203
208
|
});
|
|
204
|
-
this.server.tool('
|
|
205
|
-
project_uuid: zod_1.z
|
|
206
|
-
.string()
|
|
207
|
-
.optional()
|
|
208
|
-
.describe('Optional UUID of the project to list environments for'),
|
|
209
|
-
}, async (params) => {
|
|
209
|
+
this.server.tool('list_databases', 'List all databases', {}, async () => {
|
|
210
210
|
try {
|
|
211
|
-
const
|
|
211
|
+
const databases = await this.client.listDatabases();
|
|
212
212
|
return {
|
|
213
|
-
content: [{ type: 'text', text: JSON.stringify(
|
|
213
|
+
content: [{ type: 'text', text: JSON.stringify(databases) }],
|
|
214
214
|
isError: false,
|
|
215
215
|
};
|
|
216
216
|
}
|
|
@@ -222,13 +222,69 @@ class CoolifyMcpServer {
|
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
224
|
});
|
|
225
|
-
this.server.tool('
|
|
226
|
-
|
|
225
|
+
this.server.tool('get_database', 'Get details about a specific database', { uuid: zod_1.z.string().describe('UUID of the database to get details for') }, async (params) => {
|
|
226
|
+
try {
|
|
227
|
+
const database = await this.client.getDatabase(params.uuid);
|
|
228
|
+
return {
|
|
229
|
+
content: [{ type: 'text', text: JSON.stringify(database) }],
|
|
230
|
+
isError: false,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
235
|
+
return {
|
|
236
|
+
content: [{ type: 'text', text: errorMessage }],
|
|
237
|
+
isError: true,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
this.server.tool('update_database', 'Update an existing database', {
|
|
242
|
+
uuid: zod_1.z.string().describe('UUID of the database to update'),
|
|
243
|
+
name: zod_1.z.string().optional().describe('New name for the database'),
|
|
244
|
+
description: zod_1.z.string().optional().describe('New description for the database'),
|
|
245
|
+
image: zod_1.z.string().optional().describe('New Docker image for the database'),
|
|
246
|
+
is_public: zod_1.z.boolean().optional().describe('Whether the database should be public'),
|
|
247
|
+
public_port: zod_1.z.number().optional().describe('Public port for the database'),
|
|
248
|
+
limits_memory: zod_1.z.string().optional().describe('Memory limit (e.g., "512M", "1G")'),
|
|
249
|
+
limits_memory_swap: zod_1.z.string().optional().describe('Memory swap limit'),
|
|
250
|
+
limits_memory_swappiness: zod_1.z.number().optional().describe('Memory swappiness (0-100)'),
|
|
251
|
+
limits_memory_reservation: zod_1.z.string().optional().describe('Memory reservation'),
|
|
252
|
+
limits_cpus: zod_1.z.string().optional().describe('CPU limit (e.g., "0.5", "1")'),
|
|
253
|
+
limits_cpuset: zod_1.z.string().optional().describe('CPU set (e.g., "0", "0,1")'),
|
|
254
|
+
limits_cpu_shares: zod_1.z.number().optional().describe('CPU shares (relative weight)'),
|
|
255
|
+
// Database-specific configuration
|
|
256
|
+
postgres_user: zod_1.z.string().optional().describe('PostgreSQL user'),
|
|
257
|
+
postgres_password: zod_1.z.string().optional().describe('PostgreSQL password'),
|
|
258
|
+
postgres_db: zod_1.z.string().optional().describe('PostgreSQL database name'),
|
|
259
|
+
postgres_initdb_args: zod_1.z.string().optional().describe('PostgreSQL initdb arguments'),
|
|
260
|
+
postgres_host_auth_method: zod_1.z.string().optional().describe('PostgreSQL host auth method'),
|
|
261
|
+
postgres_conf: zod_1.z.string().optional().describe('PostgreSQL configuration'),
|
|
262
|
+
clickhouse_admin_user: zod_1.z.string().optional().describe('Clickhouse admin user'),
|
|
263
|
+
clickhouse_admin_password: zod_1.z.string().optional().describe('Clickhouse admin password'),
|
|
264
|
+
dragonfly_password: zod_1.z.string().optional().describe('Dragonfly password'),
|
|
265
|
+
redis_password: zod_1.z.string().optional().describe('Redis password'),
|
|
266
|
+
redis_conf: zod_1.z.string().optional().describe('Redis configuration'),
|
|
267
|
+
keydb_password: zod_1.z.string().optional().describe('KeyDB password'),
|
|
268
|
+
keydb_conf: zod_1.z.string().optional().describe('KeyDB configuration'),
|
|
269
|
+
mariadb_conf: zod_1.z.string().optional().describe('MariaDB configuration'),
|
|
270
|
+
mariadb_root_password: zod_1.z.string().optional().describe('MariaDB root password'),
|
|
271
|
+
mariadb_user: zod_1.z.string().optional().describe('MariaDB user'),
|
|
272
|
+
mariadb_password: zod_1.z.string().optional().describe('MariaDB password'),
|
|
273
|
+
mariadb_database: zod_1.z.string().optional().describe('MariaDB database name'),
|
|
274
|
+
mongo_conf: zod_1.z.string().optional().describe('MongoDB configuration'),
|
|
275
|
+
mongo_initdb_root_username: zod_1.z.string().optional().describe('MongoDB root username'),
|
|
276
|
+
mongo_initdb_root_password: zod_1.z.string().optional().describe('MongoDB root password'),
|
|
277
|
+
mongo_initdb_database: zod_1.z.string().optional().describe('MongoDB initial database'),
|
|
278
|
+
mysql_root_password: zod_1.z.string().optional().describe('MySQL root password'),
|
|
279
|
+
mysql_password: zod_1.z.string().optional().describe('MySQL password'),
|
|
280
|
+
mysql_user: zod_1.z.string().optional().describe('MySQL user'),
|
|
281
|
+
mysql_database: zod_1.z.string().optional().describe('MySQL database name'),
|
|
227
282
|
}, async (params) => {
|
|
228
283
|
try {
|
|
229
|
-
const
|
|
284
|
+
const { uuid, ...updateData } = params;
|
|
285
|
+
const result = await this.client.updateDatabase(uuid, updateData);
|
|
230
286
|
return {
|
|
231
|
-
content: [{ type: 'text', text: JSON.stringify(
|
|
287
|
+
content: [{ type: 'text', text: JSON.stringify(result) }],
|
|
232
288
|
isError: false,
|
|
233
289
|
};
|
|
234
290
|
}
|
|
@@ -240,13 +296,19 @@ class CoolifyMcpServer {
|
|
|
240
296
|
};
|
|
241
297
|
}
|
|
242
298
|
});
|
|
243
|
-
this.server.tool('
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
299
|
+
this.server.tool('delete_database', 'Delete a database', {
|
|
300
|
+
uuid: zod_1.z.string().describe('UUID of the database to delete'),
|
|
301
|
+
deleteConfigurations: zod_1.z.boolean().optional().describe('Whether to delete configurations'),
|
|
302
|
+
deleteVolumes: zod_1.z.boolean().optional().describe('Whether to delete volumes'),
|
|
303
|
+
dockerCleanup: zod_1.z.boolean().optional().describe('Whether to run docker cleanup'),
|
|
304
|
+
deleteConnectedNetworks: zod_1.z
|
|
305
|
+
.boolean()
|
|
306
|
+
.optional()
|
|
307
|
+
.describe('Whether to delete connected networks'),
|
|
247
308
|
}, async (params) => {
|
|
248
309
|
try {
|
|
249
|
-
const
|
|
310
|
+
const { uuid, ...options } = params;
|
|
311
|
+
const result = await this.client.deleteDatabase(uuid, options);
|
|
250
312
|
return {
|
|
251
313
|
content: [{ type: 'text', text: JSON.stringify(result) }],
|
|
252
314
|
isError: false,
|
|
@@ -260,14 +322,161 @@ class CoolifyMcpServer {
|
|
|
260
322
|
};
|
|
261
323
|
}
|
|
262
324
|
});
|
|
263
|
-
this.server.tool('
|
|
264
|
-
uuid: zod_1.z.string().describe('UUID of the
|
|
265
|
-
variables: zod_1.z.record(zod_1.z.string()).describe('New environment variables'),
|
|
325
|
+
this.server.tool('deploy_application', 'Deploy an application using its UUID', {
|
|
326
|
+
uuid: zod_1.z.string().describe('UUID of the application to deploy'),
|
|
266
327
|
}, async (params) => {
|
|
267
328
|
try {
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
329
|
+
const deployment = await this.client.deployApplication(params.uuid);
|
|
330
|
+
return {
|
|
331
|
+
content: [{ type: 'text', text: JSON.stringify(deployment) }],
|
|
332
|
+
isError: false,
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
catch (error) {
|
|
336
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
337
|
+
return {
|
|
338
|
+
content: [{ type: 'text', text: errorMessage }],
|
|
339
|
+
isError: true,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
this.server.tool('list_services', 'List all services', {}, async () => {
|
|
344
|
+
try {
|
|
345
|
+
const services = await this.client.listServices();
|
|
346
|
+
return {
|
|
347
|
+
content: [{ type: 'text', text: JSON.stringify(services) }],
|
|
348
|
+
isError: false,
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
catch (error) {
|
|
352
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
353
|
+
return {
|
|
354
|
+
content: [{ type: 'text', text: errorMessage }],
|
|
355
|
+
isError: true,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
this.server.tool('get_service', 'Get details about a specific service', { uuid: zod_1.z.string().describe('UUID of the service to get details for') }, async (params) => {
|
|
360
|
+
try {
|
|
361
|
+
const service = await this.client.getService(params.uuid);
|
|
362
|
+
return {
|
|
363
|
+
content: [{ type: 'text', text: JSON.stringify(service) }],
|
|
364
|
+
isError: false,
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
369
|
+
return {
|
|
370
|
+
content: [{ type: 'text', text: errorMessage }],
|
|
371
|
+
isError: true,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
this.server.tool('create_service', 'Create a new service', {
|
|
376
|
+
type: zod_1.z
|
|
377
|
+
.enum([
|
|
378
|
+
'activepieces',
|
|
379
|
+
'appsmith',
|
|
380
|
+
'appwrite',
|
|
381
|
+
'authentik',
|
|
382
|
+
'babybuddy',
|
|
383
|
+
'budge',
|
|
384
|
+
'changedetection',
|
|
385
|
+
'chatwoot',
|
|
386
|
+
'classicpress-with-mariadb',
|
|
387
|
+
'classicpress-with-mysql',
|
|
388
|
+
'classicpress-without-database',
|
|
389
|
+
'cloudflared',
|
|
390
|
+
'code-server',
|
|
391
|
+
'dashboard',
|
|
392
|
+
'directus',
|
|
393
|
+
'directus-with-postgresql',
|
|
394
|
+
'docker-registry',
|
|
395
|
+
'docuseal',
|
|
396
|
+
'docuseal-with-postgres',
|
|
397
|
+
'dokuwiki',
|
|
398
|
+
'duplicati',
|
|
399
|
+
'emby',
|
|
400
|
+
'embystat',
|
|
401
|
+
'fider',
|
|
402
|
+
'filebrowser',
|
|
403
|
+
'firefly',
|
|
404
|
+
'formbricks',
|
|
405
|
+
'ghost',
|
|
406
|
+
'gitea',
|
|
407
|
+
'gitea-with-mariadb',
|
|
408
|
+
'gitea-with-mysql',
|
|
409
|
+
'gitea-with-postgresql',
|
|
410
|
+
'glance',
|
|
411
|
+
'glances',
|
|
412
|
+
'glitchtip',
|
|
413
|
+
'grafana',
|
|
414
|
+
'grafana-with-postgresql',
|
|
415
|
+
'grocy',
|
|
416
|
+
'heimdall',
|
|
417
|
+
'homepage',
|
|
418
|
+
'jellyfin',
|
|
419
|
+
'kuzzle',
|
|
420
|
+
'listmonk',
|
|
421
|
+
'logto',
|
|
422
|
+
'mediawiki',
|
|
423
|
+
'meilisearch',
|
|
424
|
+
'metabase',
|
|
425
|
+
'metube',
|
|
426
|
+
'minio',
|
|
427
|
+
'moodle',
|
|
428
|
+
'n8n',
|
|
429
|
+
'n8n-with-postgresql',
|
|
430
|
+
'next-image-transformation',
|
|
431
|
+
'nextcloud',
|
|
432
|
+
'nocodb',
|
|
433
|
+
'odoo',
|
|
434
|
+
'openblocks',
|
|
435
|
+
'pairdrop',
|
|
436
|
+
'penpot',
|
|
437
|
+
'phpmyadmin',
|
|
438
|
+
'pocketbase',
|
|
439
|
+
'posthog',
|
|
440
|
+
'reactive-resume',
|
|
441
|
+
'rocketchat',
|
|
442
|
+
'shlink',
|
|
443
|
+
'slash',
|
|
444
|
+
'snapdrop',
|
|
445
|
+
'statusnook',
|
|
446
|
+
'stirling-pdf',
|
|
447
|
+
'supabase',
|
|
448
|
+
'syncthing',
|
|
449
|
+
'tolgee',
|
|
450
|
+
'trigger',
|
|
451
|
+
'trigger-with-external-database',
|
|
452
|
+
'twenty',
|
|
453
|
+
'umami',
|
|
454
|
+
'unleash-with-postgresql',
|
|
455
|
+
'unleash-without-database',
|
|
456
|
+
'uptime-kuma',
|
|
457
|
+
'vaultwarden',
|
|
458
|
+
'vikunja',
|
|
459
|
+
'weblate',
|
|
460
|
+
'whoogle',
|
|
461
|
+
'wordpress-with-mariadb',
|
|
462
|
+
'wordpress-with-mysql',
|
|
463
|
+
'wordpress-without-database',
|
|
464
|
+
])
|
|
465
|
+
.describe('Type of service to create'),
|
|
466
|
+
name: zod_1.z.string().optional().describe('Name for the service'),
|
|
467
|
+
description: zod_1.z.string().optional().describe('Description of the service'),
|
|
468
|
+
project_uuid: zod_1.z.string().describe('UUID of the project to create the service in'),
|
|
469
|
+
environment_name: zod_1.z.string().optional().describe('Name of the environment'),
|
|
470
|
+
environment_uuid: zod_1.z.string().optional().describe('UUID of the environment'),
|
|
471
|
+
server_uuid: zod_1.z.string().describe('UUID of the server to deploy the service on'),
|
|
472
|
+
destination_uuid: zod_1.z.string().optional().describe('UUID of the destination'),
|
|
473
|
+
instant_deploy: zod_1.z
|
|
474
|
+
.boolean()
|
|
475
|
+
.optional()
|
|
476
|
+
.describe('Whether to deploy the service immediately'),
|
|
477
|
+
}, async (params) => {
|
|
478
|
+
try {
|
|
479
|
+
const result = await this.client.createService(params);
|
|
271
480
|
return {
|
|
272
481
|
content: [{ type: 'text', text: JSON.stringify(result) }],
|
|
273
482
|
isError: false,
|
|
@@ -281,11 +490,19 @@ class CoolifyMcpServer {
|
|
|
281
490
|
};
|
|
282
491
|
}
|
|
283
492
|
});
|
|
284
|
-
this.server.tool('
|
|
285
|
-
uuid: zod_1.z.string().describe('UUID of the
|
|
493
|
+
this.server.tool('delete_service', 'Delete a service', {
|
|
494
|
+
uuid: zod_1.z.string().describe('UUID of the service to delete'),
|
|
495
|
+
deleteConfigurations: zod_1.z.boolean().optional().describe('Whether to delete configurations'),
|
|
496
|
+
deleteVolumes: zod_1.z.boolean().optional().describe('Whether to delete volumes'),
|
|
497
|
+
dockerCleanup: zod_1.z.boolean().optional().describe('Whether to run docker cleanup'),
|
|
498
|
+
deleteConnectedNetworks: zod_1.z
|
|
499
|
+
.boolean()
|
|
500
|
+
.optional()
|
|
501
|
+
.describe('Whether to delete connected networks'),
|
|
286
502
|
}, async (params) => {
|
|
287
503
|
try {
|
|
288
|
-
const
|
|
504
|
+
const { uuid, ...options } = params;
|
|
505
|
+
const result = await this.client.deleteService(uuid, options);
|
|
289
506
|
return {
|
|
290
507
|
content: [{ type: 'text', text: JSON.stringify(result) }],
|
|
291
508
|
isError: false,
|
|
@@ -299,16 +516,11 @@ class CoolifyMcpServer {
|
|
|
299
516
|
};
|
|
300
517
|
}
|
|
301
518
|
});
|
|
519
|
+
// End of tool definitions
|
|
302
520
|
}
|
|
303
521
|
async start(transport) {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
await this.server.connect(transport);
|
|
307
|
-
}
|
|
308
|
-
catch (error) {
|
|
309
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
310
|
-
throw new Error(`Failed to start MCP server: ${errorMessage}`);
|
|
311
|
-
}
|
|
522
|
+
await this.client.validateConnection();
|
|
523
|
+
await this.server.connect(transport);
|
|
312
524
|
}
|
|
313
525
|
async list_servers() {
|
|
314
526
|
return this.client.listServers();
|
|
@@ -343,20 +555,32 @@ class CoolifyMcpServer {
|
|
|
343
555
|
async get_project_environment(projectUuid, environmentNameOrUuid) {
|
|
344
556
|
return this.client.getProjectEnvironment(projectUuid, environmentNameOrUuid);
|
|
345
557
|
}
|
|
346
|
-
async
|
|
347
|
-
return this.client.
|
|
558
|
+
async deploy_application(params) {
|
|
559
|
+
return this.client.deployApplication(params.uuid);
|
|
560
|
+
}
|
|
561
|
+
async list_databases() {
|
|
562
|
+
return this.client.listDatabases();
|
|
563
|
+
}
|
|
564
|
+
async get_database(uuid) {
|
|
565
|
+
return this.client.getDatabase(uuid);
|
|
566
|
+
}
|
|
567
|
+
async update_database(uuid, data) {
|
|
568
|
+
return this.client.updateDatabase(uuid, data);
|
|
569
|
+
}
|
|
570
|
+
async delete_database(uuid, options) {
|
|
571
|
+
return this.client.deleteDatabase(uuid, options);
|
|
348
572
|
}
|
|
349
|
-
async
|
|
350
|
-
return this.client.
|
|
573
|
+
async list_services() {
|
|
574
|
+
return this.client.listServices();
|
|
351
575
|
}
|
|
352
|
-
async
|
|
353
|
-
return this.client.
|
|
576
|
+
async get_service(uuid) {
|
|
577
|
+
return this.client.getService(uuid);
|
|
354
578
|
}
|
|
355
|
-
async
|
|
356
|
-
return this.client.
|
|
579
|
+
async create_service(data) {
|
|
580
|
+
return this.client.createService(data);
|
|
357
581
|
}
|
|
358
|
-
async
|
|
359
|
-
return this.client.
|
|
582
|
+
async delete_service(uuid, options) {
|
|
583
|
+
return this.client.deleteService(uuid, options);
|
|
360
584
|
}
|
|
361
585
|
}
|
|
362
586
|
exports.CoolifyMcpServer = CoolifyMcpServer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
/**
|
|
3
|
+
* Decorator for marking methods as MCP resources.
|
|
4
|
+
* @param uri The URI pattern for the resource
|
|
5
|
+
*/
|
|
6
|
+
export declare function Resource(uri: string): MethodDecorator;
|
|
7
|
+
/**
|
|
8
|
+
* Get the resource URI for a decorated method
|
|
9
|
+
* @param target The class instance or constructor
|
|
10
|
+
* @param propertyKey The method name
|
|
11
|
+
* @returns The resource URI or undefined if not a resource
|
|
12
|
+
*/
|
|
13
|
+
export declare function getResourceUri(target: object, propertyKey: string | symbol): string | undefined;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Resource = Resource;
|
|
4
|
+
exports.getResourceUri = getResourceUri;
|
|
5
|
+
require("reflect-metadata");
|
|
6
|
+
/**
|
|
7
|
+
* Metadata key for storing the resource URI
|
|
8
|
+
*/
|
|
9
|
+
const RESOURCE_URI_KEY = Symbol('resourceUri');
|
|
10
|
+
/**
|
|
11
|
+
* Decorator for marking methods as MCP resources.
|
|
12
|
+
* @param uri The URI pattern for the resource
|
|
13
|
+
*/
|
|
14
|
+
function Resource(uri) {
|
|
15
|
+
return function (target, propertyKey, descriptor) {
|
|
16
|
+
// Store the URI pattern in the method's metadata
|
|
17
|
+
Reflect.defineMetadata(RESOURCE_URI_KEY, uri, target, propertyKey);
|
|
18
|
+
return descriptor;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the resource URI for a decorated method
|
|
23
|
+
* @param target The class instance or constructor
|
|
24
|
+
* @param propertyKey The method name
|
|
25
|
+
* @returns The resource URI or undefined if not a resource
|
|
26
|
+
*/
|
|
27
|
+
function getResourceUri(target, propertyKey) {
|
|
28
|
+
return Reflect.getMetadata(RESOURCE_URI_KEY, target, propertyKey);
|
|
29
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CoolifyClient } from '../lib/coolify-client.js';
|
|
2
|
+
import { Application, CreateApplicationRequest } from '../types/coolify.js';
|
|
3
|
+
export declare class ApplicationResources {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: CoolifyClient);
|
|
6
|
+
listApplications(): Promise<Application[]>;
|
|
7
|
+
getApplication(_id: string): Promise<Application>;
|
|
8
|
+
createApplication(_data: CreateApplicationRequest): Promise<{
|
|
9
|
+
uuid: string;
|
|
10
|
+
}>;
|
|
11
|
+
deleteApplication(_id: string): Promise<{
|
|
12
|
+
message: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ApplicationResources = void 0;
|
|
13
|
+
const resource_js_1 = require("../lib/resource.js");
|
|
14
|
+
class ApplicationResources {
|
|
15
|
+
constructor(client) {
|
|
16
|
+
this.client = client;
|
|
17
|
+
}
|
|
18
|
+
async listApplications() {
|
|
19
|
+
// TODO: Implement listApplications in CoolifyClient
|
|
20
|
+
throw new Error('Not implemented');
|
|
21
|
+
}
|
|
22
|
+
async getApplication(_id) {
|
|
23
|
+
// TODO: Implement getApplication in CoolifyClient
|
|
24
|
+
throw new Error('Not implemented');
|
|
25
|
+
}
|
|
26
|
+
async createApplication(_data) {
|
|
27
|
+
// TODO: Implement createApplication in CoolifyClient
|
|
28
|
+
throw new Error('Not implemented');
|
|
29
|
+
}
|
|
30
|
+
async deleteApplication(_id) {
|
|
31
|
+
// TODO: Implement deleteApplication in CoolifyClient
|
|
32
|
+
throw new Error('Not implemented');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ApplicationResources = ApplicationResources;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, resource_js_1.Resource)('coolify/applications/list'),
|
|
38
|
+
__metadata("design:type", Function),
|
|
39
|
+
__metadata("design:paramtypes", []),
|
|
40
|
+
__metadata("design:returntype", Promise)
|
|
41
|
+
], ApplicationResources.prototype, "listApplications", null);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, resource_js_1.Resource)('coolify/applications/{id}'),
|
|
44
|
+
__metadata("design:type", Function),
|
|
45
|
+
__metadata("design:paramtypes", [String]),
|
|
46
|
+
__metadata("design:returntype", Promise)
|
|
47
|
+
], ApplicationResources.prototype, "getApplication", null);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, resource_js_1.Resource)('coolify/applications/create'),
|
|
50
|
+
__metadata("design:type", Function),
|
|
51
|
+
__metadata("design:paramtypes", [Object]),
|
|
52
|
+
__metadata("design:returntype", Promise)
|
|
53
|
+
], ApplicationResources.prototype, "createApplication", null);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, resource_js_1.Resource)('coolify/applications/{id}/delete'),
|
|
56
|
+
__metadata("design:type", Function),
|
|
57
|
+
__metadata("design:paramtypes", [String]),
|
|
58
|
+
__metadata("design:returntype", Promise)
|
|
59
|
+
], ApplicationResources.prototype, "deleteApplication", null);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CoolifyClient } from '../lib/coolify-client.js';
|
|
2
|
+
import { Database, DatabaseUpdateRequest } from '../types/coolify.js';
|
|
3
|
+
export declare class DatabaseResources {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: CoolifyClient);
|
|
6
|
+
listDatabases(): Promise<Database[]>;
|
|
7
|
+
getDatabase(id: string): Promise<Database>;
|
|
8
|
+
updateDatabase(id: string, data: DatabaseUpdateRequest): Promise<Database>;
|
|
9
|
+
deleteDatabase(id: string, options?: {
|
|
10
|
+
deleteConfigurations?: boolean;
|
|
11
|
+
deleteVolumes?: boolean;
|
|
12
|
+
dockerCleanup?: boolean;
|
|
13
|
+
deleteConnectedNetworks?: boolean;
|
|
14
|
+
}): Promise<{
|
|
15
|
+
message: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DatabaseResources = void 0;
|
|
13
|
+
const resource_js_1 = require("../lib/resource.js");
|
|
14
|
+
class DatabaseResources {
|
|
15
|
+
constructor(client) {
|
|
16
|
+
this.client = client;
|
|
17
|
+
}
|
|
18
|
+
async listDatabases() {
|
|
19
|
+
return this.client.listDatabases();
|
|
20
|
+
}
|
|
21
|
+
async getDatabase(id) {
|
|
22
|
+
return this.client.getDatabase(id);
|
|
23
|
+
}
|
|
24
|
+
async updateDatabase(id, data) {
|
|
25
|
+
return this.client.updateDatabase(id, data);
|
|
26
|
+
}
|
|
27
|
+
async deleteDatabase(id, options) {
|
|
28
|
+
return this.client.deleteDatabase(id, options);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.DatabaseResources = DatabaseResources;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, resource_js_1.Resource)('coolify/databases/list'),
|
|
34
|
+
__metadata("design:type", Function),
|
|
35
|
+
__metadata("design:paramtypes", []),
|
|
36
|
+
__metadata("design:returntype", Promise)
|
|
37
|
+
], DatabaseResources.prototype, "listDatabases", null);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, resource_js_1.Resource)('coolify/databases/{id}'),
|
|
40
|
+
__metadata("design:type", Function),
|
|
41
|
+
__metadata("design:paramtypes", [String]),
|
|
42
|
+
__metadata("design:returntype", Promise)
|
|
43
|
+
], DatabaseResources.prototype, "getDatabase", null);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, resource_js_1.Resource)('coolify/databases/{id}/update'),
|
|
46
|
+
__metadata("design:type", Function),
|
|
47
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
48
|
+
__metadata("design:returntype", Promise)
|
|
49
|
+
], DatabaseResources.prototype, "updateDatabase", null);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, resource_js_1.Resource)('coolify/databases/{id}/delete'),
|
|
52
|
+
__metadata("design:type", Function),
|
|
53
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
54
|
+
__metadata("design:returntype", Promise)
|
|
55
|
+
], DatabaseResources.prototype, "deleteDatabase", null);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CoolifyClient } from '../lib/coolify-client.js';
|
|
2
|
+
import { Deployment } from '../types/coolify.js';
|
|
3
|
+
export declare class DeploymentResources {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: CoolifyClient);
|
|
6
|
+
listDeployments(): Promise<Deployment[]>;
|
|
7
|
+
getDeployment(_id: string): Promise<Deployment>;
|
|
8
|
+
deploy(params: {
|
|
9
|
+
uuid: string;
|
|
10
|
+
forceRebuild?: boolean;
|
|
11
|
+
}): Promise<Deployment>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DeploymentResources = void 0;
|
|
13
|
+
const resource_js_1 = require("../lib/resource.js");
|
|
14
|
+
class DeploymentResources {
|
|
15
|
+
constructor(client) {
|
|
16
|
+
this.client = client;
|
|
17
|
+
}
|
|
18
|
+
async listDeployments() {
|
|
19
|
+
// TODO: Implement listDeployments in CoolifyClient
|
|
20
|
+
throw new Error('Not implemented');
|
|
21
|
+
}
|
|
22
|
+
async getDeployment(_id) {
|
|
23
|
+
// TODO: Implement getDeployment in CoolifyClient
|
|
24
|
+
throw new Error('Not implemented');
|
|
25
|
+
}
|
|
26
|
+
async deploy(params) {
|
|
27
|
+
return this.client.deployApplication(params.uuid);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.DeploymentResources = DeploymentResources;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, resource_js_1.Resource)('coolify/deployments/list'),
|
|
33
|
+
__metadata("design:type", Function),
|
|
34
|
+
__metadata("design:paramtypes", []),
|
|
35
|
+
__metadata("design:returntype", Promise)
|
|
36
|
+
], DeploymentResources.prototype, "listDeployments", null);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, resource_js_1.Resource)('coolify/deployments/{id}'),
|
|
39
|
+
__metadata("design:type", Function),
|
|
40
|
+
__metadata("design:paramtypes", [String]),
|
|
41
|
+
__metadata("design:returntype", Promise)
|
|
42
|
+
], DeploymentResources.prototype, "getDeployment", null);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, resource_js_1.Resource)('coolify/deploy'),
|
|
45
|
+
__metadata("design:type", Function),
|
|
46
|
+
__metadata("design:paramtypes", [Object]),
|
|
47
|
+
__metadata("design:returntype", Promise)
|
|
48
|
+
], DeploymentResources.prototype, "deploy", null);
|