@masonator/coolify-mcp 0.1.17 → 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/dist/index.js +1 -1
- package/dist/lib/mcp-server.d.ts +9 -6
- package/dist/lib/mcp-server.js +23 -34
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ async function main() {
|
|
|
11
11
|
}
|
|
12
12
|
const server = new CoolifyMcpServer(config);
|
|
13
13
|
const transport = new StdioServerTransport();
|
|
14
|
-
await server.
|
|
14
|
+
await server.connect(transport);
|
|
15
15
|
}
|
|
16
16
|
main().catch((error) => {
|
|
17
17
|
console.error('Fatal error:', error);
|
package/dist/lib/mcp-server.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
1
2
|
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
2
|
-
import {
|
|
3
|
-
export declare class CoolifyMcpServer {
|
|
4
|
-
private server;
|
|
3
|
+
import { ServerInfo, ServerResources, ServerDomain, ValidationResponse, Project, CreateProjectRequest, UpdateProjectRequest, Environment, Deployment, Database, DatabaseUpdateRequest, Service, CreateServiceRequest, DeleteServiceOptions } from '../types/coolify.js';
|
|
4
|
+
export declare class CoolifyMcpServer extends Server {
|
|
5
5
|
private client;
|
|
6
6
|
private databaseResources;
|
|
7
7
|
private deploymentResources;
|
|
8
8
|
private applicationResources;
|
|
9
9
|
private serviceResources;
|
|
10
|
-
constructor(config:
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
constructor(config: {
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
accessToken: string;
|
|
13
|
+
});
|
|
14
|
+
private setupRequestHandlers;
|
|
15
|
+
connect(transport: Transport): Promise<void>;
|
|
13
16
|
list_servers(): Promise<ServerInfo[]>;
|
|
14
17
|
get_server(uuid: string): Promise<ServerInfo>;
|
|
15
18
|
get_server_resources(uuid: string): Promise<ServerResources>;
|
package/dist/lib/mcp-server.js
CHANGED
|
@@ -3,46 +3,30 @@ import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprot
|
|
|
3
3
|
import { CoolifyClient } from './coolify-client.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { DatabaseResources, DeploymentResources, ApplicationResources, ServiceResources, } from '../resources/index.js';
|
|
6
|
-
|
|
6
|
+
import debug from 'debug';
|
|
7
|
+
const log = debug('coolify:mcp');
|
|
8
|
+
export class CoolifyMcpServer extends Server {
|
|
7
9
|
constructor(config) {
|
|
8
|
-
|
|
9
|
-
this.server = new Server({
|
|
10
|
+
super({
|
|
10
11
|
name: 'coolify',
|
|
11
|
-
version: '0.1.
|
|
12
|
-
}, {
|
|
12
|
+
version: '0.1.18',
|
|
13
13
|
capabilities: {
|
|
14
|
-
tools:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
get_server_domains: { enabled: true },
|
|
19
|
-
validate_server: { enabled: true },
|
|
20
|
-
list_projects: { enabled: true },
|
|
21
|
-
get_project: { enabled: true },
|
|
22
|
-
create_project: { enabled: true },
|
|
23
|
-
update_project: { enabled: true },
|
|
24
|
-
delete_project: { enabled: true },
|
|
25
|
-
get_project_environment: { enabled: true },
|
|
26
|
-
list_databases: { enabled: true },
|
|
27
|
-
get_database: { enabled: true },
|
|
28
|
-
update_database: { enabled: true },
|
|
29
|
-
delete_database: { enabled: true },
|
|
30
|
-
deploy_application: { enabled: true },
|
|
31
|
-
list_services: { enabled: true },
|
|
32
|
-
get_service: { enabled: true },
|
|
33
|
-
create_service: { enabled: true },
|
|
34
|
-
delete_service: { enabled: true }
|
|
35
|
-
},
|
|
36
|
-
},
|
|
14
|
+
tools: true,
|
|
15
|
+
resources: false,
|
|
16
|
+
prompts: false
|
|
17
|
+
}
|
|
37
18
|
});
|
|
19
|
+
log('Initializing server with config: %o', config);
|
|
20
|
+
this.client = new CoolifyClient(config);
|
|
38
21
|
this.databaseResources = new DatabaseResources(this.client);
|
|
39
22
|
this.deploymentResources = new DeploymentResources(this.client);
|
|
40
23
|
this.applicationResources = new ApplicationResources(this.client);
|
|
41
24
|
this.serviceResources = new ServiceResources(this.client);
|
|
42
|
-
this.setupHandlers();
|
|
43
25
|
}
|
|
44
|
-
|
|
45
|
-
|
|
26
|
+
setupRequestHandlers() {
|
|
27
|
+
log('Setting up request handlers');
|
|
28
|
+
this.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
29
|
+
log('Handling ListTools request');
|
|
46
30
|
return {
|
|
47
31
|
tools: [
|
|
48
32
|
{
|
|
@@ -273,7 +257,7 @@ export class CoolifyMcpServer {
|
|
|
273
257
|
],
|
|
274
258
|
};
|
|
275
259
|
});
|
|
276
|
-
this.
|
|
260
|
+
this.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
277
261
|
try {
|
|
278
262
|
if (!request.params.arguments) {
|
|
279
263
|
throw new Error('Arguments are required');
|
|
@@ -573,9 +557,14 @@ export class CoolifyMcpServer {
|
|
|
573
557
|
}
|
|
574
558
|
});
|
|
575
559
|
}
|
|
576
|
-
async
|
|
560
|
+
async connect(transport) {
|
|
561
|
+
log('Setting up request handlers');
|
|
562
|
+
this.setupRequestHandlers();
|
|
563
|
+
log('Starting server...');
|
|
564
|
+
log('Validating connection...');
|
|
577
565
|
await this.client.validateConnection();
|
|
578
|
-
await
|
|
566
|
+
await super.connect(transport);
|
|
567
|
+
log('Server started successfully');
|
|
579
568
|
}
|
|
580
569
|
async list_servers() {
|
|
581
570
|
return this.client.listServers();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masonator/coolify-mcp",
|
|
3
3
|
"scope": "@masonator",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"description": "MCP server implementation for Coolify",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"author": "Stuart Mason",
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@masonator/coolify-mcp": "^0.1.12",
|
|
45
44
|
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
46
45
|
"@modelcontextprotocol/server-github": "^2025.1.23",
|
|
47
46
|
"reflect-metadata": "^0.2.2",
|
|
48
47
|
"zod": "^3.24.2"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
50
|
+
"@types/debug": "^4.1.12",
|
|
51
51
|
"@types/jest": "^29.5.14",
|
|
52
52
|
"@types/node": "^20.17.23",
|
|
53
53
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|