@masonator/coolify-mcp 0.1.18 → 0.2.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/dist/index.js +1 -1
- package/dist/lib/mcp-server.d.ts +9 -6
- package/dist/lib/mcp-server.js +24 -48
- 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,49 +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.client = new CoolifyClient(config);
|
|
10
|
-
this.server = new Server({
|
|
10
|
+
super({
|
|
11
11
|
name: 'coolify',
|
|
12
|
-
version: '0.1.
|
|
13
|
-
}, {
|
|
12
|
+
version: '0.1.18',
|
|
14
13
|
capabilities: {
|
|
15
|
-
tools:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
get_server_domains: { enabled: true },
|
|
20
|
-
validate_server: { enabled: true },
|
|
21
|
-
list_projects: { enabled: true },
|
|
22
|
-
get_project: { enabled: true },
|
|
23
|
-
create_project: { enabled: true },
|
|
24
|
-
update_project: { enabled: true },
|
|
25
|
-
delete_project: { enabled: true },
|
|
26
|
-
get_project_environment: { enabled: true },
|
|
27
|
-
list_databases: { enabled: true },
|
|
28
|
-
get_database: { enabled: true },
|
|
29
|
-
update_database: { enabled: true },
|
|
30
|
-
delete_database: { enabled: true },
|
|
31
|
-
deploy_application: { enabled: true },
|
|
32
|
-
list_services: { enabled: true },
|
|
33
|
-
get_service: { enabled: true },
|
|
34
|
-
create_service: { enabled: true },
|
|
35
|
-
delete_service: { enabled: true }
|
|
36
|
-
},
|
|
37
|
-
},
|
|
14
|
+
tools: true,
|
|
15
|
+
resources: false,
|
|
16
|
+
prompts: false
|
|
17
|
+
}
|
|
38
18
|
});
|
|
19
|
+
log('Initializing server with config: %o', config);
|
|
20
|
+
this.client = new CoolifyClient(config);
|
|
39
21
|
this.databaseResources = new DatabaseResources(this.client);
|
|
40
22
|
this.deploymentResources = new DeploymentResources(this.client);
|
|
41
23
|
this.applicationResources = new ApplicationResources(this.client);
|
|
42
24
|
this.serviceResources = new ServiceResources(this.client);
|
|
43
|
-
this.setupHandlers();
|
|
44
25
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
this.
|
|
48
|
-
|
|
26
|
+
setupRequestHandlers() {
|
|
27
|
+
log('Setting up request handlers');
|
|
28
|
+
this.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
29
|
+
log('Handling ListTools request');
|
|
49
30
|
return {
|
|
50
31
|
tools: [
|
|
51
32
|
{
|
|
@@ -276,7 +257,7 @@ export class CoolifyMcpServer {
|
|
|
276
257
|
],
|
|
277
258
|
};
|
|
278
259
|
});
|
|
279
|
-
this.
|
|
260
|
+
this.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
280
261
|
try {
|
|
281
262
|
if (!request.params.arguments) {
|
|
282
263
|
throw new Error('Arguments are required');
|
|
@@ -576,19 +557,14 @@ export class CoolifyMcpServer {
|
|
|
576
557
|
}
|
|
577
558
|
});
|
|
578
559
|
}
|
|
579
|
-
async
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}
|
|
588
|
-
catch (error) {
|
|
589
|
-
console.error('[CoolifyMCP] Error starting server:', error);
|
|
590
|
-
throw error;
|
|
591
|
-
}
|
|
560
|
+
async connect(transport) {
|
|
561
|
+
log('Setting up request handlers');
|
|
562
|
+
this.setupRequestHandlers();
|
|
563
|
+
log('Starting server...');
|
|
564
|
+
log('Validating connection...');
|
|
565
|
+
await this.client.validateConnection();
|
|
566
|
+
await super.connect(transport);
|
|
567
|
+
log('Server started successfully');
|
|
592
568
|
}
|
|
593
569
|
async list_servers() {
|
|
594
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.1
|
|
4
|
+
"version": "0.2.1",
|
|
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",
|