@masonator/coolify-mcp 0.1.0 → 0.1.2

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 (29) hide show
  1. package/README.md +129 -281
  2. package/dist/__tests__/coolify-client.test.js +242 -98
  3. package/dist/__tests__/mcp-server.test.js +143 -68
  4. package/dist/__tests__/resources/application-resources.test.d.ts +1 -0
  5. package/dist/__tests__/resources/application-resources.test.js +36 -0
  6. package/dist/__tests__/resources/database-resources.test.d.ts +1 -0
  7. package/dist/__tests__/resources/database-resources.test.js +72 -0
  8. package/dist/__tests__/resources/deployment-resources.test.d.ts +1 -0
  9. package/dist/__tests__/resources/deployment-resources.test.js +47 -0
  10. package/dist/__tests__/resources/service-resources.test.d.ts +1 -0
  11. package/dist/__tests__/resources/service-resources.test.js +81 -0
  12. package/dist/lib/coolify-client.d.ts +18 -6
  13. package/dist/lib/coolify-client.js +65 -15
  14. package/dist/lib/mcp-server.d.ts +24 -15
  15. package/dist/lib/mcp-server.js +270 -46
  16. package/dist/lib/resource.d.ts +13 -0
  17. package/dist/lib/resource.js +29 -0
  18. package/dist/resources/application-resources.d.ts +14 -0
  19. package/dist/resources/application-resources.js +59 -0
  20. package/dist/resources/database-resources.d.ts +17 -0
  21. package/dist/resources/database-resources.js +55 -0
  22. package/dist/resources/deployment-resources.d.ts +12 -0
  23. package/dist/resources/deployment-resources.js +48 -0
  24. package/dist/resources/index.d.ts +4 -0
  25. package/dist/resources/index.js +20 -0
  26. package/dist/resources/service-resources.d.ts +15 -0
  27. package/dist/resources/service-resources.js +55 -0
  28. package/dist/types/coolify.d.ts +163 -4
  29. package/package.json +8 -3
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./database-resources.js"), exports);
18
+ __exportStar(require("./deployment-resources.js"), exports);
19
+ __exportStar(require("./application-resources.js"), exports);
20
+ __exportStar(require("./service-resources.js"), exports);
@@ -0,0 +1,15 @@
1
+ import { CoolifyClient } from '../lib/coolify-client.js';
2
+ import { Service, CreateServiceRequest, DeleteServiceOptions } from '../types/coolify.js';
3
+ export declare class ServiceResources {
4
+ private client;
5
+ constructor(client: CoolifyClient);
6
+ listServices(): Promise<Service[]>;
7
+ getService(id: string): Promise<Service>;
8
+ createService(data: CreateServiceRequest): Promise<{
9
+ uuid: string;
10
+ domains: string[];
11
+ }>;
12
+ deleteService(id: string, options?: DeleteServiceOptions): Promise<{
13
+ message: string;
14
+ }>;
15
+ }
@@ -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.ServiceResources = void 0;
13
+ const resource_js_1 = require("../lib/resource.js");
14
+ class ServiceResources {
15
+ constructor(client) {
16
+ this.client = client;
17
+ }
18
+ async listServices() {
19
+ return this.client.listServices();
20
+ }
21
+ async getService(id) {
22
+ return this.client.getService(id);
23
+ }
24
+ async createService(data) {
25
+ return this.client.createService(data);
26
+ }
27
+ async deleteService(id, options) {
28
+ return this.client.deleteService(id, options);
29
+ }
30
+ }
31
+ exports.ServiceResources = ServiceResources;
32
+ __decorate([
33
+ (0, resource_js_1.Resource)('coolify/services/list'),
34
+ __metadata("design:type", Function),
35
+ __metadata("design:paramtypes", []),
36
+ __metadata("design:returntype", Promise)
37
+ ], ServiceResources.prototype, "listServices", null);
38
+ __decorate([
39
+ (0, resource_js_1.Resource)('coolify/services/{id}'),
40
+ __metadata("design:type", Function),
41
+ __metadata("design:paramtypes", [String]),
42
+ __metadata("design:returntype", Promise)
43
+ ], ServiceResources.prototype, "getService", null);
44
+ __decorate([
45
+ (0, resource_js_1.Resource)('coolify/services/create'),
46
+ __metadata("design:type", Function),
47
+ __metadata("design:paramtypes", [Object]),
48
+ __metadata("design:returntype", Promise)
49
+ ], ServiceResources.prototype, "createService", null);
50
+ __decorate([
51
+ (0, resource_js_1.Resource)('coolify/services/{id}/delete'),
52
+ __metadata("design:type", Function),
53
+ __metadata("design:paramtypes", [String, Object]),
54
+ __metadata("design:returntype", Promise)
55
+ ], ServiceResources.prototype, "deleteService", null);
@@ -59,11 +59,170 @@ export interface UpdateProjectRequest {
59
59
  name?: string;
60
60
  description?: string;
61
61
  }
62
- export interface CreateEnvironmentRequest {
62
+ export interface LogEntry {
63
+ timestamp: string;
64
+ level: string;
65
+ message: string;
66
+ }
67
+ export interface Deployment {
68
+ id: number;
69
+ uuid: string;
70
+ application_uuid: string;
71
+ status: string;
72
+ created_at: string;
73
+ updated_at: string;
74
+ }
75
+ export interface DatabaseBase {
76
+ id: number;
77
+ uuid: string;
78
+ name: string;
79
+ description?: string;
80
+ type: 'postgresql' | 'mysql' | 'mariadb' | 'mongodb' | 'redis' | 'keydb' | 'clickhouse' | 'dragonfly';
81
+ status: 'running' | 'stopped' | 'error';
82
+ created_at: string;
83
+ updated_at: string;
84
+ is_public: boolean;
85
+ public_port?: number;
86
+ image: string;
87
+ limits?: {
88
+ memory?: string;
89
+ memory_swap?: string;
90
+ memory_swappiness?: number;
91
+ memory_reservation?: string;
92
+ cpus?: string;
93
+ cpuset?: string;
94
+ cpu_shares?: number;
95
+ };
96
+ }
97
+ export interface PostgresDatabase extends DatabaseBase {
98
+ type: 'postgresql';
99
+ postgres_user: string;
100
+ postgres_password: string;
101
+ postgres_db: string;
102
+ postgres_initdb_args?: string;
103
+ postgres_host_auth_method?: string;
104
+ postgres_conf?: string;
105
+ }
106
+ export interface MySQLDatabase extends DatabaseBase {
107
+ type: 'mysql';
108
+ mysql_root_password: string;
109
+ mysql_user?: string;
110
+ mysql_password?: string;
111
+ mysql_database?: string;
112
+ }
113
+ export interface MariaDBDatabase extends DatabaseBase {
114
+ type: 'mariadb';
115
+ mariadb_root_password: string;
116
+ mariadb_user?: string;
117
+ mariadb_password?: string;
118
+ mariadb_database?: string;
119
+ mariadb_conf?: string;
120
+ }
121
+ export interface MongoDBDatabase extends DatabaseBase {
122
+ type: 'mongodb';
123
+ mongo_initdb_root_username: string;
124
+ mongo_initdb_root_password: string;
125
+ mongo_initdb_database?: string;
126
+ mongo_conf?: string;
127
+ }
128
+ export interface RedisDatabase extends DatabaseBase {
129
+ type: 'redis';
130
+ redis_password?: string;
131
+ redis_conf?: string;
132
+ }
133
+ export interface KeyDBDatabase extends DatabaseBase {
134
+ type: 'keydb';
135
+ keydb_password?: string;
136
+ keydb_conf?: string;
137
+ }
138
+ export interface ClickhouseDatabase extends DatabaseBase {
139
+ type: 'clickhouse';
140
+ clickhouse_admin_user: string;
141
+ clickhouse_admin_password: string;
142
+ }
143
+ export interface DragonflyDatabase extends DatabaseBase {
144
+ type: 'dragonfly';
145
+ dragonfly_password: string;
146
+ }
147
+ export type Database = PostgresDatabase | MySQLDatabase | MariaDBDatabase | MongoDBDatabase | RedisDatabase | KeyDBDatabase | ClickhouseDatabase | DragonflyDatabase;
148
+ export interface DatabaseUpdateRequest {
149
+ name?: string;
150
+ description?: string;
151
+ image?: string;
152
+ is_public?: boolean;
153
+ public_port?: number;
154
+ limits_memory?: string;
155
+ limits_memory_swap?: string;
156
+ limits_memory_swappiness?: number;
157
+ limits_memory_reservation?: string;
158
+ limits_cpus?: string;
159
+ limits_cpuset?: string;
160
+ limits_cpu_shares?: number;
161
+ postgres_user?: string;
162
+ postgres_password?: string;
163
+ postgres_db?: string;
164
+ postgres_initdb_args?: string;
165
+ postgres_host_auth_method?: string;
166
+ postgres_conf?: string;
167
+ clickhouse_admin_user?: string;
168
+ clickhouse_admin_password?: string;
169
+ dragonfly_password?: string;
170
+ redis_password?: string;
171
+ redis_conf?: string;
172
+ keydb_password?: string;
173
+ keydb_conf?: string;
174
+ mariadb_conf?: string;
175
+ mariadb_root_password?: string;
176
+ mariadb_user?: string;
177
+ mariadb_password?: string;
178
+ mariadb_database?: string;
179
+ mongo_conf?: string;
180
+ mongo_initdb_root_username?: string;
181
+ mongo_initdb_root_password?: string;
182
+ mongo_initdb_database?: string;
183
+ mysql_root_password?: string;
184
+ mysql_password?: string;
185
+ mysql_user?: string;
186
+ mysql_database?: string;
187
+ }
188
+ export type ServiceType = 'activepieces' | 'appsmith' | 'appwrite' | 'authentik' | 'babybuddy' | 'budge' | 'changedetection' | 'chatwoot' | 'classicpress-with-mariadb' | 'classicpress-with-mysql' | 'classicpress-without-database' | 'cloudflared' | 'code-server' | 'dashboard' | 'directus' | 'directus-with-postgresql' | 'docker-registry' | 'docuseal' | 'docuseal-with-postgres' | 'dokuwiki' | 'duplicati' | 'emby' | 'embystat' | 'fider' | 'filebrowser' | 'firefly' | 'formbricks' | 'ghost' | 'gitea' | 'gitea-with-mariadb' | 'gitea-with-mysql' | 'gitea-with-postgresql' | 'glance' | 'glances' | 'glitchtip' | 'grafana' | 'grafana-with-postgresql' | 'grocy' | 'heimdall' | 'homepage' | 'jellyfin' | 'kuzzle' | 'listmonk' | 'logto' | 'mediawiki' | 'meilisearch' | 'metabase' | 'metube' | 'minio' | 'moodle' | 'n8n' | 'n8n-with-postgresql' | 'next-image-transformation' | 'nextcloud' | 'nocodb' | 'odoo' | 'openblocks' | 'pairdrop' | 'penpot' | 'phpmyadmin' | 'pocketbase' | 'posthog' | 'reactive-resume' | 'rocketchat' | 'shlink' | 'slash' | 'snapdrop' | 'statusnook' | 'stirling-pdf' | 'supabase' | 'syncthing' | 'tolgee' | 'trigger' | 'trigger-with-external-database' | 'twenty' | 'umami' | 'unleash-with-postgresql' | 'unleash-without-database' | 'uptime-kuma' | 'vaultwarden' | 'vikunja' | 'weblate' | 'whoogle' | 'wordpress-with-mariadb' | 'wordpress-with-mysql' | 'wordpress-without-database';
189
+ export interface Service {
190
+ id: number;
191
+ uuid: string;
63
192
  name: string;
193
+ description?: string;
194
+ type: ServiceType;
195
+ status: 'running' | 'stopped' | 'error';
196
+ created_at: string;
197
+ updated_at: string;
64
198
  project_uuid: string;
65
- variables?: Record<string, string>;
199
+ environment_name: string;
200
+ environment_uuid: string;
201
+ server_uuid: string;
202
+ destination_uuid?: string;
203
+ domains?: string[];
204
+ }
205
+ export interface CreateServiceRequest {
206
+ type: ServiceType;
207
+ name?: string;
208
+ description?: string;
209
+ project_uuid: string;
210
+ environment_name?: string;
211
+ environment_uuid?: string;
212
+ server_uuid: string;
213
+ destination_uuid?: string;
214
+ instant_deploy?: boolean;
66
215
  }
67
- export interface UpdateEnvironmentVariablesRequest {
68
- variables: Record<string, string>;
216
+ export interface DeleteServiceOptions {
217
+ deleteConfigurations?: boolean;
218
+ deleteVolumes?: boolean;
219
+ dockerCleanup?: boolean;
220
+ deleteConnectedNetworks?: boolean;
221
+ }
222
+ export interface Application {
223
+ uuid: string;
224
+ name: string;
225
+ }
226
+ export interface CreateApplicationRequest {
227
+ name: string;
69
228
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@masonator/coolify-mcp",
3
3
  "scope": "@masonator",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "description": "MCP server implementation for Coolify",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "bin": {
9
- "coolify-mcp": "./dist/index.js"
9
+ "coolify-mcp": "dist/index.js"
10
10
  },
11
11
  "files": [
12
12
  "dist"
@@ -20,6 +20,7 @@
20
20
  "lint": "eslint . --ext .ts",
21
21
  "lint:fix": "eslint . --ext .ts --fix",
22
22
  "format": "prettier --write .",
23
+ "format:check": "prettier --check .",
23
24
  "prepare": "husky",
24
25
  "prepublishOnly": "npm test && npm run lint",
25
26
  "start": "node dist/index.js"
@@ -32,10 +33,14 @@
32
33
  "author": "Stuart Mason",
33
34
  "license": "MIT",
34
35
  "dependencies": {
35
- "@modelcontextprotocol/sdk": "^1.6.1",
36
+ "reflect-metadata": "^0.2.2",
36
37
  "zod": "^3.24.2"
37
38
  },
39
+ "peerDependencies": {
40
+ "@modelcontextprotocol/sdk": "^1.6.1"
41
+ },
38
42
  "devDependencies": {
43
+ "@modelcontextprotocol/sdk": "^1.6.1",
39
44
  "@types/jest": "^29.5.14",
40
45
  "@types/node": "^20.17.23",
41
46
  "@typescript-eslint/eslint-plugin": "^7.18.0",