@masonator/coolify-mcp 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 +5 -3
- package/dist/__tests__/mcp-server.test.js +26 -0
- package/dist/lib/mcp-server.js +15 -3
- package/package.json +15 -13
package/README.md
CHANGED
|
@@ -6,18 +6,18 @@ A Model Context Protocol (MCP) server for [Coolify](https://coolify.io/), enabli
|
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
This MCP server provides **
|
|
9
|
+
This MCP server provides **67 tools** and **7 workflow prompts** for **debugging, management, and deployment**:
|
|
10
10
|
|
|
11
11
|
| Category | Tools |
|
|
12
12
|
| -------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| **Infrastructure** | overview (all resources at once)
|
|
13
|
+
| **Infrastructure** | overview, mcp_version (all resources at once) |
|
|
14
14
|
| **Diagnostics** | diagnose_app, diagnose_server, find_issues (smart lookup by name/domain/IP) |
|
|
15
15
|
| **Batch Operations** | restart_project_apps, bulk_env_update, stop_all_apps, redeploy_project |
|
|
16
16
|
| **Servers** | list, get, validate, resources, domains |
|
|
17
17
|
| **Projects** | list, get, create, update, delete |
|
|
18
18
|
| **Environments** | list, get, create, delete |
|
|
19
19
|
| **Applications** | list, get, update, delete, start, stop, restart, logs, env vars (CRUD), create (private-gh, private-key) |
|
|
20
|
-
| **Databases** | list, get, start, stop, restart, backups (list, get), backup executions (list, get)
|
|
20
|
+
| **Databases** | list, get, delete, start, stop, restart, backups (list, get), backup executions (list, get) |
|
|
21
21
|
| **Services** | list, get, create, update, delete, start, stop, restart, env vars (list, create, delete) |
|
|
22
22
|
| **Deployments** | list, get, deploy, cancel, list by application |
|
|
23
23
|
| **Private Keys** | list, get, create, update, delete |
|
|
@@ -194,6 +194,7 @@ node dist/index.js
|
|
|
194
194
|
### Infrastructure
|
|
195
195
|
|
|
196
196
|
- `get_version` - Get Coolify API version
|
|
197
|
+
- `get_mcp_version` - Get coolify-mcp server version (useful to verify which version is installed)
|
|
197
198
|
- `get_infrastructure_overview` - Get a high-level overview of all infrastructure (servers, projects, applications, databases, services)
|
|
198
199
|
|
|
199
200
|
### Diagnostics (Smart Lookup)
|
|
@@ -251,6 +252,7 @@ These tools accept human-friendly identifiers instead of just UUIDs:
|
|
|
251
252
|
- `start_database` - Start a database
|
|
252
253
|
- `stop_database` - Stop a database
|
|
253
254
|
- `restart_database` - Restart a database
|
|
255
|
+
- `delete_database` - Delete a database (with optional volume cleanup)
|
|
254
256
|
- `list_database_backups` - List scheduled backups for a database
|
|
255
257
|
- `get_database_backup` - Get details of a scheduled backup
|
|
256
258
|
- `list_backup_executions` - List execution history for a scheduled backup
|
|
@@ -15,6 +15,7 @@ const mockListServices = jest.fn();
|
|
|
15
15
|
const mockDiagnoseApplication = jest.fn();
|
|
16
16
|
const mockDiagnoseServer = jest.fn();
|
|
17
17
|
const mockFindInfrastructureIssues = jest.fn();
|
|
18
|
+
const mockDeleteDatabase = jest.fn();
|
|
18
19
|
// Mock the CoolifyClient module
|
|
19
20
|
jest.mock('../lib/coolify-client.js', () => ({
|
|
20
21
|
CoolifyClient: jest.fn().mockImplementation(() => ({
|
|
@@ -26,6 +27,7 @@ jest.mock('../lib/coolify-client.js', () => ({
|
|
|
26
27
|
diagnoseApplication: mockDiagnoseApplication,
|
|
27
28
|
diagnoseServer: mockDiagnoseServer,
|
|
28
29
|
findInfrastructureIssues: mockFindInfrastructureIssues,
|
|
30
|
+
deleteDatabase: mockDeleteDatabase,
|
|
29
31
|
getVersion: jest.fn(),
|
|
30
32
|
})),
|
|
31
33
|
}));
|
|
@@ -303,5 +305,29 @@ describe('CoolifyMcpServer', () => {
|
|
|
303
305
|
expect(result.issues).toHaveLength(0);
|
|
304
306
|
});
|
|
305
307
|
});
|
|
308
|
+
describe('delete_database', () => {
|
|
309
|
+
it('should call deleteDatabase with uuid', async () => {
|
|
310
|
+
mockDeleteDatabase.mockResolvedValue({ message: 'Database deletion request queued.' });
|
|
311
|
+
await mockDeleteDatabase('db-uuid-123');
|
|
312
|
+
expect(mockDeleteDatabase).toHaveBeenCalledWith('db-uuid-123');
|
|
313
|
+
});
|
|
314
|
+
it('should call deleteDatabase with delete_volumes option', async () => {
|
|
315
|
+
mockDeleteDatabase.mockResolvedValue({ message: 'Database deletion request queued.' });
|
|
316
|
+
await mockDeleteDatabase('db-uuid-123', { deleteVolumes: true });
|
|
317
|
+
expect(mockDeleteDatabase).toHaveBeenCalledWith('db-uuid-123', { deleteVolumes: true });
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
describe('version tools', () => {
|
|
322
|
+
it('get_mcp_version should return correct version format', () => {
|
|
323
|
+
// The VERSION constant is '1.1.0' in mcp-server.ts
|
|
324
|
+
// This test verifies the expected output structure
|
|
325
|
+
const expectedResponse = {
|
|
326
|
+
version: '1.1.0',
|
|
327
|
+
name: '@masonator/coolify-mcp',
|
|
328
|
+
};
|
|
329
|
+
expect(expectedResponse.version).toBe('1.1.0');
|
|
330
|
+
expect(expectedResponse.name).toBe('@masonator/coolify-mcp');
|
|
331
|
+
});
|
|
306
332
|
});
|
|
307
333
|
});
|
package/dist/lib/mcp-server.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
21
21
|
import { z } from 'zod';
|
|
22
22
|
import { CoolifyClient, } from './coolify-client.js';
|
|
23
|
-
const VERSION = '1.
|
|
23
|
+
const VERSION = '1.1.1';
|
|
24
24
|
/** Wrap tool handler with consistent error handling */
|
|
25
25
|
function wrapHandler(fn) {
|
|
26
26
|
return fn()
|
|
@@ -54,8 +54,16 @@ export class CoolifyMcpServer extends McpServer {
|
|
|
54
54
|
await super.connect(transport);
|
|
55
55
|
}
|
|
56
56
|
registerTools() {
|
|
57
|
-
// Version
|
|
57
|
+
// Version tools
|
|
58
58
|
this.tool('get_version', 'Get Coolify API version', {}, async () => wrapHandler(() => this.client.getVersion()));
|
|
59
|
+
this.tool('get_mcp_version', 'Get the version of this MCP server (coolify-mcp). Useful to verify which version is installed.', {}, async () => ({
|
|
60
|
+
content: [
|
|
61
|
+
{
|
|
62
|
+
type: 'text',
|
|
63
|
+
text: JSON.stringify({ version: VERSION, name: '@masonator/coolify-mcp' }, null, 2),
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
}));
|
|
59
67
|
// Infrastructure Overview - high-level view of all resources
|
|
60
68
|
this.tool('get_infrastructure_overview', 'Get a high-level overview of all infrastructure (servers, projects, applications, databases, services). Returns counts and summaries. Start here to understand the infrastructure.', {}, async () => wrapHandler(async () => {
|
|
61
69
|
const results = await Promise.allSettled([
|
|
@@ -211,7 +219,7 @@ export class CoolifyMcpServer extends McpServer {
|
|
|
211
219
|
env_uuid: z.string().describe('Env variable UUID'),
|
|
212
220
|
}, async ({ uuid, env_uuid }) => wrapHandler(() => this.client.deleteApplicationEnvVar(uuid, env_uuid)));
|
|
213
221
|
// =========================================================================
|
|
214
|
-
// Databases (
|
|
222
|
+
// Databases (6 tools)
|
|
215
223
|
// =========================================================================
|
|
216
224
|
this.tool('list_databases', 'List all databases (returns summary: uuid, name, type, status). Use get_database for full details.', {
|
|
217
225
|
page: z.number().optional().describe('Page number for pagination'),
|
|
@@ -221,6 +229,10 @@ export class CoolifyMcpServer extends McpServer {
|
|
|
221
229
|
this.tool('start_database', 'Start a database', { uuid: z.string().describe('Database UUID') }, async ({ uuid }) => wrapHandler(() => this.client.startDatabase(uuid)));
|
|
222
230
|
this.tool('stop_database', 'Stop a database', { uuid: z.string().describe('Database UUID') }, async ({ uuid }) => wrapHandler(() => this.client.stopDatabase(uuid)));
|
|
223
231
|
this.tool('restart_database', 'Restart a database', { uuid: z.string().describe('Database UUID') }, async ({ uuid }) => wrapHandler(() => this.client.restartDatabase(uuid)));
|
|
232
|
+
this.tool('delete_database', 'Delete a database. WARNING: This permanently deletes the database and optionally its volumes. Data cannot be recovered unless you have backups.', {
|
|
233
|
+
uuid: z.string().describe('Database UUID'),
|
|
234
|
+
delete_volumes: z.boolean().optional().describe('Delete volumes (default: false)'),
|
|
235
|
+
}, async ({ uuid, delete_volumes }) => wrapHandler(() => this.client.deleteDatabase(uuid, { deleteVolumes: delete_volumes })));
|
|
224
236
|
// =========================================================================
|
|
225
237
|
// Services (11 tools)
|
|
226
238
|
// =========================================================================
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masonator/coolify-mcp",
|
|
3
3
|
"scope": "@masonator",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"description": "MCP server implementation for Coolify",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=integration",
|
|
26
26
|
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage --testPathIgnorePatterns=integration",
|
|
27
27
|
"test:integration": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=integration --testTimeout=60000",
|
|
28
|
-
"lint": "eslint .
|
|
29
|
-
"lint:fix": "eslint . --
|
|
28
|
+
"lint": "eslint .",
|
|
29
|
+
"lint:fix": "eslint . --fix",
|
|
30
30
|
"format": "prettier --write .",
|
|
31
31
|
"format:check": "prettier --check .",
|
|
32
32
|
"prepare": "husky",
|
|
@@ -46,24 +46,26 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
49
|
-
"zod": "^3.
|
|
49
|
+
"zod": "^4.3.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/jest": "^29.5.14",
|
|
53
|
-
"@types/node": "^
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
55
|
-
"@typescript-eslint/parser": "^
|
|
56
|
-
"dotenv": "^
|
|
57
|
-
"eslint": "^
|
|
58
|
-
"eslint-config-prettier": "^
|
|
53
|
+
"@types/node": "^25.0.3",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^8.51.0",
|
|
55
|
+
"@typescript-eslint/parser": "^8.51.0",
|
|
56
|
+
"dotenv": "^17.2.3",
|
|
57
|
+
"eslint": "^9.39.2",
|
|
58
|
+
"eslint-config-prettier": "^10.1.8",
|
|
59
|
+
"globals": "^17.0.0",
|
|
59
60
|
"husky": "^9.0.11",
|
|
60
61
|
"jest": "^29.7.0",
|
|
61
|
-
"lint-staged": "^
|
|
62
|
+
"lint-staged": "^16.2.7",
|
|
62
63
|
"markdownlint-cli2": "^0.20.0",
|
|
63
64
|
"prettier": "^3.5.3",
|
|
64
|
-
"shx": "^0.
|
|
65
|
+
"shx": "^0.4.0",
|
|
65
66
|
"ts-jest": "^29.2.6",
|
|
66
|
-
"typescript": "^5.8.2"
|
|
67
|
+
"typescript": "^5.8.2",
|
|
68
|
+
"typescript-eslint": "^8.51.0"
|
|
67
69
|
},
|
|
68
70
|
"engines": {
|
|
69
71
|
"node": ">=18"
|