@masonator/coolify-mcp 0.8.0 → 0.8.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 CHANGED
@@ -1,16 +1,17 @@
1
- [![MseeP.ai Security Assessment Badge](https://mseep.net/pr/stumason-coolify-mcp-badge.png)](https://mseep.ai/app/stumason-coolify-mcp)
2
-
3
1
  # Coolify MCP Server
4
2
 
3
+ [![MseeP.ai Security Assessment Badge](https://mseep.net/pr/stumason-coolify-mcp-badge.png)](https://mseep.ai/app/stumason-coolify-mcp)
4
+
5
5
  A Model Context Protocol (MCP) server for [Coolify](https://coolify.io/), enabling AI assistants to manage and debug your Coolify instances through natural language.
6
6
 
7
7
  ## Features
8
8
 
9
- This MCP server provides **58 tools** focused on **debugging, management, and deployment**:
9
+ This MCP server provides **61 tools** focused on **debugging, management, and deployment**:
10
10
 
11
11
  | Category | Tools |
12
12
  | ------------------ | -------------------------------------------------------------------------------------------------------- |
13
13
  | **Infrastructure** | overview (all resources at once) |
14
+ | **Diagnostics** | diagnose_app, diagnose_server, find_issues (smart lookup by name/domain/IP) |
14
15
  | **Servers** | list, get, validate, resources, domains |
15
16
  | **Projects** | list, get, create, update, delete |
16
17
  | **Environments** | list, get, create, delete |
@@ -82,11 +83,12 @@ The Coolify API returns extremely verbose responses - a single application can c
82
83
 
83
84
  ### Response Size Comparison
84
85
 
85
- | Endpoint | Full Response | Summary Response | Reduction |
86
- | ----------------- | ------------- | ---------------- | --------- |
87
- | list_applications | ~170KB | ~4.4KB | **97%** |
88
- | list_services | ~367KB | ~1.2KB | **99%** |
89
- | list_servers | ~4KB | ~0.4KB | **90%** |
86
+ | Endpoint | Full Response | Summary Response | Reduction |
87
+ | --------------------- | ------------- | ---------------- | --------- |
88
+ | list_applications | ~170KB | ~4.4KB | **97%** |
89
+ | list_services | ~367KB | ~1.2KB | **99%** |
90
+ | list_servers | ~4KB | ~0.4KB | **90%** |
91
+ | list_application_envs | ~3KB/var | ~0.1KB/var | **97%** |
90
92
 
91
93
  ### Recommended Workflow
92
94
 
@@ -108,7 +110,7 @@ list_applications(page=2, per_page=10)
108
110
 
109
111
  ### Getting Started
110
112
 
111
- ```
113
+ ```text
112
114
  Give me an overview of my infrastructure
113
115
  Show me all my applications
114
116
  What's running on my servers?
@@ -116,9 +118,12 @@ What's running on my servers?
116
118
 
117
119
  ### Debugging & Monitoring
118
120
 
119
- ```
121
+ ```text
122
+ Diagnose my stuartmason.co.uk app
123
+ What's wrong with my-api application?
124
+ Check the status of server 192.168.1.100
125
+ Find any issues in my infrastructure
120
126
  Get the logs for application {uuid}
121
- What's the status of application {uuid}?
122
127
  What environment variables are set for application {uuid}?
123
128
  Show me recent deployments for application {uuid}
124
129
  What resources are running on server {uuid}?
@@ -126,7 +131,7 @@ What resources are running on server {uuid}?
126
131
 
127
132
  ### Application Management
128
133
 
129
- ```
134
+ ```text
130
135
  Restart application {uuid}
131
136
  Stop the database {uuid}
132
137
  Start service {uuid}
@@ -136,7 +141,7 @@ Update the DATABASE_URL env var for application {uuid}
136
141
 
137
142
  ### Project Setup
138
143
 
139
- ```
144
+ ```text
140
145
  Create a new project called "my-app"
141
146
  Create a staging environment in project {uuid}
142
147
  Deploy my app from private GitHub repo org/repo on branch main
@@ -176,6 +181,14 @@ node dist/index.js
176
181
  - `get_version` - Get Coolify API version
177
182
  - `get_infrastructure_overview` - Get a high-level overview of all infrastructure (servers, projects, applications, databases, services)
178
183
 
184
+ ### Diagnostics (Smart Lookup)
185
+
186
+ These tools accept human-friendly identifiers instead of just UUIDs:
187
+
188
+ - `diagnose_app` - Get comprehensive app diagnostics (status, logs, env vars, deployments). Accepts UUID, name, or domain (e.g., "stuartmason.co.uk" or "my-app")
189
+ - `diagnose_server` - Get server diagnostics (status, resources, domains, validation). Accepts UUID, name, or IP address (e.g., "coolify-apps" or "192.168.1.100")
190
+ - `find_issues` - Scan entire infrastructure for unhealthy apps, databases, services, and unreachable servers
191
+
179
192
  ### Servers
180
193
 
181
194
  - `list_servers` - List all servers (returns summary)
@@ -649,6 +649,34 @@ describe('CoolifyClient', () => {
649
649
  expect(result).toEqual([mockEnvVar]);
650
650
  expect(mockFetch).toHaveBeenCalledWith('http://localhost:3000/api/v1/applications/app-uuid/envs', expect.any(Object));
651
651
  });
652
+ it('should list application env vars with summary', async () => {
653
+ const fullEnvVar = {
654
+ id: 1,
655
+ uuid: 'env-var-uuid',
656
+ key: 'API_KEY',
657
+ value: 'secret123',
658
+ is_build_time: false,
659
+ is_literal: true,
660
+ is_multiline: false,
661
+ is_preview: false,
662
+ is_shared: false,
663
+ is_shown_once: false,
664
+ application_id: 1,
665
+ created_at: '2024-01-01',
666
+ updated_at: '2024-01-01',
667
+ };
668
+ mockFetch.mockResolvedValueOnce(mockResponse([fullEnvVar]));
669
+ const result = await client.listApplicationEnvVars('app-uuid', { summary: true });
670
+ // Summary should only include uuid, key, value, is_build_time
671
+ expect(result).toEqual([
672
+ {
673
+ uuid: 'env-var-uuid',
674
+ key: 'API_KEY',
675
+ value: 'secret123',
676
+ is_build_time: false,
677
+ },
678
+ ]);
679
+ });
652
680
  it('should create application env var', async () => {
653
681
  mockFetch.mockResolvedValueOnce(mockResponse({ uuid: 'new-env-uuid' }));
654
682
  const result = await client.createApplicationEnvVar('app-uuid', {
@@ -2,7 +2,7 @@
2
2
  * Coolify API Client
3
3
  * Complete HTTP client for the Coolify API v1
4
4
  */
5
- import type { CoolifyConfig, DeleteOptions, MessageResponse, UuidResponse, Server, ServerResource, ServerDomain, ServerValidation, CreateServerRequest, UpdateServerRequest, Project, CreateProjectRequest, UpdateProjectRequest, Environment, CreateEnvironmentRequest, Application, CreateApplicationPublicRequest, CreateApplicationPrivateGHRequest, CreateApplicationPrivateKeyRequest, CreateApplicationDockerfileRequest, CreateApplicationDockerImageRequest, CreateApplicationDockerComposeRequest, UpdateApplicationRequest, ApplicationActionResponse, EnvironmentVariable, CreateEnvVarRequest, UpdateEnvVarRequest, BulkUpdateEnvVarsRequest, Database, UpdateDatabaseRequest, DatabaseBackup, BackupExecution, Service, CreateServiceRequest, UpdateServiceRequest, ServiceCreateResponse, Deployment, Team, TeamMember, PrivateKey, CreatePrivateKeyRequest, UpdatePrivateKeyRequest, CloudToken, CreateCloudTokenRequest, UpdateCloudTokenRequest, CloudTokenValidation, Version, ApplicationDiagnostic, ServerDiagnostic, InfrastructureIssuesReport } from '../types/coolify.js';
5
+ import type { CoolifyConfig, DeleteOptions, MessageResponse, UuidResponse, Server, ServerResource, ServerDomain, ServerValidation, CreateServerRequest, UpdateServerRequest, Project, CreateProjectRequest, UpdateProjectRequest, Environment, CreateEnvironmentRequest, Application, CreateApplicationPublicRequest, CreateApplicationPrivateGHRequest, CreateApplicationPrivateKeyRequest, CreateApplicationDockerfileRequest, CreateApplicationDockerImageRequest, CreateApplicationDockerComposeRequest, UpdateApplicationRequest, ApplicationActionResponse, EnvironmentVariable, EnvVarSummary, CreateEnvVarRequest, UpdateEnvVarRequest, BulkUpdateEnvVarsRequest, Database, UpdateDatabaseRequest, DatabaseBackup, BackupExecution, Service, CreateServiceRequest, UpdateServiceRequest, ServiceCreateResponse, Deployment, Team, TeamMember, PrivateKey, CreatePrivateKeyRequest, UpdatePrivateKeyRequest, CloudToken, CreateCloudTokenRequest, UpdateCloudTokenRequest, CloudTokenValidation, Version, ApplicationDiagnostic, ServerDiagnostic, InfrastructureIssuesReport } from '../types/coolify.js';
6
6
  export interface ListOptions {
7
7
  page?: number;
8
8
  per_page?: number;
@@ -100,7 +100,9 @@ export declare class CoolifyClient {
100
100
  }): Promise<ApplicationActionResponse>;
101
101
  stopApplication(uuid: string): Promise<ApplicationActionResponse>;
102
102
  restartApplication(uuid: string): Promise<ApplicationActionResponse>;
103
- listApplicationEnvVars(uuid: string): Promise<EnvironmentVariable[]>;
103
+ listApplicationEnvVars(uuid: string, options?: {
104
+ summary?: boolean;
105
+ }): Promise<EnvironmentVariable[] | EnvVarSummary[]>;
104
106
  createApplicationEnvVar(uuid: string, data: CreateEnvVarRequest): Promise<UuidResponse>;
105
107
  updateApplicationEnvVar(uuid: string, data: UpdateEnvVarRequest): Promise<MessageResponse>;
106
108
  bulkUpdateApplicationEnvVars(uuid: string, data: BulkUpdateEnvVarsRequest): Promise<MessageResponse>;
@@ -71,6 +71,14 @@ function toProjectSummary(proj) {
71
71
  description: proj.description,
72
72
  };
73
73
  }
74
+ function toEnvVarSummary(envVar) {
75
+ return {
76
+ uuid: envVar.uuid,
77
+ key: envVar.key,
78
+ value: envVar.value,
79
+ is_build_time: envVar.is_build_time,
80
+ };
81
+ }
74
82
  /**
75
83
  * HTTP client for the Coolify API
76
84
  */
@@ -333,8 +341,9 @@ export class CoolifyClient {
333
341
  // ===========================================================================
334
342
  // Application Environment Variables
335
343
  // ===========================================================================
336
- async listApplicationEnvVars(uuid) {
337
- return this.request(`/applications/${uuid}/envs`);
344
+ async listApplicationEnvVars(uuid, options) {
345
+ const envVars = await this.request(`/applications/${uuid}/envs`);
346
+ return options?.summary ? envVars.map(toEnvVarSummary) : envVars;
338
347
  }
339
348
  async createApplicationEnvVar(uuid, data) {
340
349
  return this.request(`/applications/${uuid}/envs`, {
@@ -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 = '0.8.0';
23
+ const VERSION = '0.8.1';
24
24
  /** Wrap tool handler with consistent error handling */
25
25
  function wrapHandler(fn) {
26
26
  return fn()
@@ -193,7 +193,7 @@ export class CoolifyMcpServer extends McpServer {
193
193
  lines: z.number().optional().describe('Number of lines'),
194
194
  }, async ({ uuid, lines }) => wrapHandler(() => this.client.getApplicationLogs(uuid, lines)));
195
195
  // Application env vars
196
- this.tool('list_application_envs', 'List application environment variables', { uuid: z.string().describe('Application UUID') }, async ({ uuid }) => wrapHandler(() => this.client.listApplicationEnvVars(uuid)));
196
+ this.tool('list_application_envs', 'List application environment variables (returns summary: uuid, key, value, is_build_time)', { uuid: z.string().describe('Application UUID') }, async ({ uuid }) => wrapHandler(() => this.client.listApplicationEnvVars(uuid, { summary: true })));
197
197
  this.tool('create_application_env', 'Create application environment variable', {
198
198
  uuid: z.string().describe('Application UUID'),
199
199
  key: z.string().describe('Variable key'),
@@ -344,7 +344,7 @@ export class CoolifyMcpServer extends McpServer {
344
344
  // =========================================================================
345
345
  // Diagnostics (3 tools) - Composite tools for debugging
346
346
  // =========================================================================
347
- this.tool('diagnose_app', 'Get comprehensive diagnostic info for an application. Accepts UUID, name, or domain (e.g., "tidylinker.com" or "my-app"). Aggregates: status, health assessment, logs (last 50 lines), environment variables (keys only, values hidden), and recent deployments. Use this for debugging application issues.', { query: z.string().describe('Application UUID, name, or domain (FQDN)') }, async ({ query }) => wrapHandler(() => this.client.diagnoseApplication(query)));
347
+ this.tool('diagnose_app', 'Get comprehensive diagnostic info for an application. Accepts UUID, name, or domain (e.g., "stuartmason.co.uk" or "my-app"). Aggregates: status, health assessment, logs (last 50 lines), environment variables (keys only, values hidden), and recent deployments. Use this for debugging application issues.', { query: z.string().describe('Application UUID, name, or domain (FQDN)') }, async ({ query }) => wrapHandler(() => this.client.diagnoseApplication(query)));
348
348
  this.tool('diagnose_server', 'Get comprehensive diagnostic info for a server. Accepts UUID, name, or IP address (e.g., "coolify-apps" or "192.168.1.100"). Aggregates: server status, health assessment, running resources, configured domains, and connection validation. Use this for debugging server issues.', { query: z.string().describe('Server UUID, name, or IP address') }, async ({ query }) => wrapHandler(() => this.client.diagnoseServer(query)));
349
349
  this.tool('find_issues', 'Scan entire infrastructure for common issues. Finds: unreachable servers, unhealthy/stopped applications, exited databases, and stopped services. Returns a summary with issue counts and detailed list of problems.', {}, async () => wrapHandler(() => this.client.findInfrastructureIssues()));
350
350
  }
@@ -348,6 +348,12 @@ export interface UpdateEnvVarRequest {
348
348
  export interface BulkUpdateEnvVarsRequest {
349
349
  data: CreateEnvVarRequest[];
350
350
  }
351
+ export interface EnvVarSummary {
352
+ uuid: string;
353
+ key: string;
354
+ value: string;
355
+ is_build_time: boolean;
356
+ }
351
357
  export type DatabaseType = 'postgresql' | 'mysql' | 'mariadb' | 'mongodb' | 'redis' | 'keydb' | 'clickhouse' | 'dragonfly';
352
358
  export interface DatabaseLimits {
353
359
  memory?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@masonator/coolify-mcp",
3
3
  "scope": "@masonator",
4
- "version": "0.8.0",
4
+ "version": "0.8.1",
5
5
  "description": "MCP server implementation for Coolify",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",