@mks2508/coolify-mks-cli-mcp 0.2.1 → 0.3.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/cli/index.js +141 -3
- package/dist/coolify/index.d.ts +49 -0
- package/dist/coolify/index.d.ts.map +1 -1
- package/dist/coolify/types.d.ts +10 -2
- package/dist/coolify/types.d.ts.map +1 -1
- package/dist/index.cjs +174 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +174 -6
- package/dist/index.js.map +1 -1
- package/dist/server/stdio.js +379 -8
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/handlers.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli/commands/env.ts +43 -1
- package/src/cli/index.ts +5 -2
- package/src/coolify/index.ts +212 -3
- package/src/coolify/types.ts +10 -2
- package/src/index.ts +10 -3
- package/src/tools/definitions.ts +141 -4
- package/src/tools/handlers.ts +168 -5
package/src/tools/handlers.ts
CHANGED
|
@@ -56,6 +56,8 @@ export async function handleToolCall(
|
|
|
56
56
|
return handleGetDeploymentHistory(coolify, args as unknown as GetDeploymentHistoryArgs)
|
|
57
57
|
case 'update_application':
|
|
58
58
|
return handleUpdateApplication(coolify, args as unknown as UpdateApplicationArgs)
|
|
59
|
+
case 'set_domains':
|
|
60
|
+
return handleSetDomains(coolify, args as unknown as SetDomainsArgs)
|
|
59
61
|
case 'list_servers':
|
|
60
62
|
return handleListServers(coolify)
|
|
61
63
|
case 'get_server':
|
|
@@ -68,12 +70,20 @@ export async function handleToolCall(
|
|
|
68
70
|
return handleGetServerDestinations(coolify, args as unknown as GetServerDestinationsArgs)
|
|
69
71
|
case 'create_application':
|
|
70
72
|
return handleCreateApplication(coolify, args as unknown as CreateApplicationArgs)
|
|
73
|
+
case 'create_project':
|
|
74
|
+
return handleCreateProject(coolify, args as unknown as CreateProjectArgs)
|
|
71
75
|
case 'get_resource_usage':
|
|
72
76
|
return handleGetResourceUsage(coolify, args as unknown as GetResourceUsageArgs)
|
|
73
77
|
case 'health_check':
|
|
74
78
|
return handleHealthCheck(coolify)
|
|
75
79
|
case 'get_application_details':
|
|
76
80
|
return handleGetApplicationDetails(coolify, args as unknown as GetApplicationDetailsArgs)
|
|
81
|
+
case 'list_deployments':
|
|
82
|
+
return handleListDeployments(coolify)
|
|
83
|
+
case 'get_deployment':
|
|
84
|
+
return handleGetDeployment(coolify, args as unknown as GetDeploymentArgs)
|
|
85
|
+
case 'get_application_deployments':
|
|
86
|
+
return handleGetApplicationDeployments(coolify, args as unknown as GetApplicationDeploymentsArgs)
|
|
77
87
|
default:
|
|
78
88
|
return {
|
|
79
89
|
content: [{ type: 'text', text: `Unknown tool: ${name}` }],
|
|
@@ -136,12 +146,21 @@ interface UpdateApplicationArgs {
|
|
|
136
146
|
uuid: string
|
|
137
147
|
name?: string
|
|
138
148
|
description?: string
|
|
139
|
-
buildPack?: 'dockerfile' | 'nixpacks' | 'static'
|
|
149
|
+
buildPack?: 'dockerfile' | 'nixpacks' | 'static' | 'dockercompose'
|
|
140
150
|
gitBranch?: string
|
|
141
151
|
portsExposes?: string
|
|
142
152
|
installCommand?: string
|
|
143
153
|
buildCommand?: string
|
|
144
154
|
startCommand?: string
|
|
155
|
+
domains?: string
|
|
156
|
+
isForceHttpsEnabled?: boolean
|
|
157
|
+
isAutoDeployEnabled?: boolean
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
interface SetDomainsArgs {
|
|
161
|
+
uuid: string
|
|
162
|
+
domains: string
|
|
163
|
+
forceHttps?: boolean
|
|
145
164
|
}
|
|
146
165
|
|
|
147
166
|
interface GetServerArgs {
|
|
@@ -160,7 +179,16 @@ interface CreateApplicationArgs {
|
|
|
160
179
|
githubRepoUrl: string
|
|
161
180
|
description?: string
|
|
162
181
|
branch?: string
|
|
163
|
-
buildPack?: 'dockerfile' | 'nixpacks' | 'static'
|
|
182
|
+
buildPack?: 'dockerfile' | 'nixpacks' | 'static' | 'dockercompose'
|
|
183
|
+
type?: string
|
|
184
|
+
dockerComposeLocation?: string
|
|
185
|
+
dockerfileLocation?: string
|
|
186
|
+
baseDirectory?: string
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
interface CreateProjectArgs {
|
|
190
|
+
name: string
|
|
191
|
+
description?: string
|
|
164
192
|
}
|
|
165
193
|
|
|
166
194
|
interface GetResourceUsageArgs {
|
|
@@ -171,6 +199,16 @@ interface GetApplicationDetailsArgs {
|
|
|
171
199
|
uuid: string
|
|
172
200
|
}
|
|
173
201
|
|
|
202
|
+
interface GetDeploymentArgs {
|
|
203
|
+
deploymentUuid: string
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
interface GetApplicationDeploymentsArgs {
|
|
207
|
+
uuid: string
|
|
208
|
+
skip?: number
|
|
209
|
+
take?: number
|
|
210
|
+
}
|
|
211
|
+
|
|
174
212
|
// Handler implementations
|
|
175
213
|
async function handleDeploy(coolify: CoolifyService, args: DeployArgs): Promise<CallToolResult> {
|
|
176
214
|
const result = await coolify.deploy({
|
|
@@ -399,7 +437,10 @@ async function handleUpdateApplication(coolify: CoolifyService, args: UpdateAppl
|
|
|
399
437
|
portsExposes: args.portsExposes,
|
|
400
438
|
installCommand: args.installCommand,
|
|
401
439
|
buildCommand: args.buildCommand,
|
|
402
|
-
startCommand: args.startCommand
|
|
440
|
+
startCommand: args.startCommand,
|
|
441
|
+
domains: args.domains,
|
|
442
|
+
isForceHttpsEnabled: args.isForceHttpsEnabled,
|
|
443
|
+
isAutoDeployEnabled: args.isAutoDeployEnabled
|
|
403
444
|
})
|
|
404
445
|
|
|
405
446
|
if (isOk(result)) {
|
|
@@ -421,6 +462,38 @@ async function handleUpdateApplication(coolify: CoolifyService, args: UpdateAppl
|
|
|
421
462
|
}
|
|
422
463
|
}
|
|
423
464
|
|
|
465
|
+
async function handleSetDomains(coolify: CoolifyService, args: SetDomainsArgs): Promise<CallToolResult> {
|
|
466
|
+
const result = await coolify.updateApplication(args.uuid, {
|
|
467
|
+
domains: args.domains,
|
|
468
|
+
isForceHttpsEnabled: args.forceHttps ?? true
|
|
469
|
+
})
|
|
470
|
+
|
|
471
|
+
if (isOk(result)) {
|
|
472
|
+
const domainList = args.domains.split(',').map(d => d.trim())
|
|
473
|
+
return {
|
|
474
|
+
content: [{
|
|
475
|
+
type: 'text',
|
|
476
|
+
text: JSON.stringify({
|
|
477
|
+
success: true,
|
|
478
|
+
message: `Domains configured for application ${args.uuid}`,
|
|
479
|
+
domains: domainList,
|
|
480
|
+
forceHttps: args.forceHttps ?? true,
|
|
481
|
+
nextSteps: [
|
|
482
|
+
'Ensure DNS records point to your server IP',
|
|
483
|
+
'Use deploy tool to apply domain changes',
|
|
484
|
+
'SSL certificates will be auto-generated via Let\'s Encrypt'
|
|
485
|
+
]
|
|
486
|
+
}, null, 2)
|
|
487
|
+
}]
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
return {
|
|
492
|
+
content: [{ type: 'text', text: `Failed to set domains: ${result.error.message}` }],
|
|
493
|
+
isError: true
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
424
497
|
async function handleListServers(coolify: CoolifyService): Promise<CallToolResult> {
|
|
425
498
|
const result = await coolify.listServers()
|
|
426
499
|
|
|
@@ -520,10 +593,13 @@ async function handleCreateApplication(coolify: CoolifyService, args: CreateAppl
|
|
|
520
593
|
projectUuid: args.projectUuid,
|
|
521
594
|
environmentUuid: args.environmentUuid,
|
|
522
595
|
serverUuid: args.serverUuid,
|
|
523
|
-
type: 'public',
|
|
596
|
+
type: (args.type as any) || 'public',
|
|
524
597
|
githubRepoUrl: args.githubRepoUrl,
|
|
525
598
|
branch: args.branch,
|
|
526
|
-
buildPack: args.buildPack
|
|
599
|
+
buildPack: args.buildPack,
|
|
600
|
+
dockerComposeLocation: args.dockerComposeLocation,
|
|
601
|
+
dockerfileLocation: args.dockerfileLocation,
|
|
602
|
+
baseDirectory: args.baseDirectory,
|
|
527
603
|
})
|
|
528
604
|
|
|
529
605
|
if (isOk(result)) {
|
|
@@ -549,6 +625,28 @@ async function handleCreateApplication(coolify: CoolifyService, args: CreateAppl
|
|
|
549
625
|
}
|
|
550
626
|
}
|
|
551
627
|
|
|
628
|
+
async function handleCreateProject(coolify: CoolifyService, args: CreateProjectArgs): Promise<CallToolResult> {
|
|
629
|
+
const result = await coolify.createProject(args.name, args.description)
|
|
630
|
+
|
|
631
|
+
if (isOk(result)) {
|
|
632
|
+
return {
|
|
633
|
+
content: [{
|
|
634
|
+
type: 'text',
|
|
635
|
+
text: JSON.stringify({
|
|
636
|
+
success: true,
|
|
637
|
+
message: `Project "${args.name}" created successfully`,
|
|
638
|
+
uuid: result.value.uuid,
|
|
639
|
+
}, null, 2)
|
|
640
|
+
}]
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
return {
|
|
645
|
+
content: [{ type: 'text', text: `Failed to create project: ${result.error.message}` }],
|
|
646
|
+
isError: true
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
552
650
|
async function handleGetResourceUsage(coolify: CoolifyService, args: GetResourceUsageArgs): Promise<CallToolResult> {
|
|
553
651
|
// For now, use getApplicationStatus - Coolify API doesn't have a separate resource usage endpoint
|
|
554
652
|
const result = await coolify.getApplicationStatus(args.uuid)
|
|
@@ -606,3 +704,68 @@ async function handleGetApplicationDetails(coolify: CoolifyService, args: GetApp
|
|
|
606
704
|
isError: true
|
|
607
705
|
}
|
|
608
706
|
}
|
|
707
|
+
|
|
708
|
+
async function handleListDeployments(coolify: CoolifyService): Promise<CallToolResult> {
|
|
709
|
+
const result = await coolify.listDeployments()
|
|
710
|
+
|
|
711
|
+
if (isOk(result)) {
|
|
712
|
+
return {
|
|
713
|
+
content: [{
|
|
714
|
+
type: 'text',
|
|
715
|
+
text: JSON.stringify({
|
|
716
|
+
success: true,
|
|
717
|
+
count: result.value.length,
|
|
718
|
+
deployments: result.value
|
|
719
|
+
}, null, 2)
|
|
720
|
+
}]
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
return {
|
|
725
|
+
content: [{ type: 'text', text: `Failed to list deployments: ${result.error.message}` }],
|
|
726
|
+
isError: true
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
async function handleGetDeployment(coolify: CoolifyService, args: GetDeploymentArgs): Promise<CallToolResult> {
|
|
731
|
+
const result = await coolify.getDeployment(args.deploymentUuid)
|
|
732
|
+
|
|
733
|
+
if (isOk(result)) {
|
|
734
|
+
return {
|
|
735
|
+
content: [{
|
|
736
|
+
type: 'text',
|
|
737
|
+
text: JSON.stringify({
|
|
738
|
+
success: true,
|
|
739
|
+
deployment: result.value
|
|
740
|
+
}, null, 2)
|
|
741
|
+
}]
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
return {
|
|
746
|
+
content: [{ type: 'text', text: `Failed to get deployment: ${result.error.message}` }],
|
|
747
|
+
isError: true
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
async function handleGetApplicationDeployments(coolify: CoolifyService, args: GetApplicationDeploymentsArgs): Promise<CallToolResult> {
|
|
752
|
+
const result = await coolify.getApplicationDeployments(args.uuid, args.skip, args.take)
|
|
753
|
+
|
|
754
|
+
if (isOk(result)) {
|
|
755
|
+
return {
|
|
756
|
+
content: [{
|
|
757
|
+
type: 'text',
|
|
758
|
+
text: JSON.stringify({
|
|
759
|
+
success: true,
|
|
760
|
+
count: result.value.length,
|
|
761
|
+
deployments: result.value
|
|
762
|
+
}, null, 2)
|
|
763
|
+
}]
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
return {
|
|
768
|
+
content: [{ type: 'text', text: `Failed to get application deployments: ${result.error.message}` }],
|
|
769
|
+
isError: true
|
|
770
|
+
}
|
|
771
|
+
}
|