@masonator/coolify-mcp 0.1.0 → 0.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.
Files changed (29) hide show
  1. package/README.md +129 -281
  2. package/dist/__tests__/coolify-client.test.js +242 -98
  3. package/dist/__tests__/mcp-server.test.js +143 -68
  4. package/dist/__tests__/resources/application-resources.test.d.ts +1 -0
  5. package/dist/__tests__/resources/application-resources.test.js +36 -0
  6. package/dist/__tests__/resources/database-resources.test.d.ts +1 -0
  7. package/dist/__tests__/resources/database-resources.test.js +72 -0
  8. package/dist/__tests__/resources/deployment-resources.test.d.ts +1 -0
  9. package/dist/__tests__/resources/deployment-resources.test.js +47 -0
  10. package/dist/__tests__/resources/service-resources.test.d.ts +1 -0
  11. package/dist/__tests__/resources/service-resources.test.js +81 -0
  12. package/dist/lib/coolify-client.d.ts +18 -6
  13. package/dist/lib/coolify-client.js +65 -15
  14. package/dist/lib/mcp-server.d.ts +24 -15
  15. package/dist/lib/mcp-server.js +270 -46
  16. package/dist/lib/resource.d.ts +13 -0
  17. package/dist/lib/resource.js +29 -0
  18. package/dist/resources/application-resources.d.ts +14 -0
  19. package/dist/resources/application-resources.js +59 -0
  20. package/dist/resources/database-resources.d.ts +17 -0
  21. package/dist/resources/database-resources.js +55 -0
  22. package/dist/resources/deployment-resources.d.ts +12 -0
  23. package/dist/resources/deployment-resources.js +48 -0
  24. package/dist/resources/index.d.ts +4 -0
  25. package/dist/resources/index.js +20 -0
  26. package/dist/resources/service-resources.d.ts +15 -0
  27. package/dist/resources/service-resources.js +55 -0
  28. package/dist/types/coolify.d.ts +163 -4
  29. package/package.json +4 -2
package/README.md CHANGED
@@ -2,365 +2,213 @@
2
2
 
3
3
  A Model Context Protocol (MCP) server implementation for [Coolify](https://coolify.io/), enabling AI assistants to interact with your Coolify instances through natural language.
4
4
 
5
- ## Claude Desktop, Cursor, and other MCP compatible IDEs
5
+ ## Example Prompts
6
6
 
7
- ### Claude
8
-
9
- ```json
10
- "coolify": {
11
- "command": "npx",
12
- "args": [
13
- "-y", "@stumason/coolify-mcp"
14
- ],
15
- "env": {
16
- "COOLIFY_ACCESS_TOKEN": "0|your-secret-token",
17
- "COOLIFY_BASE_URL": "https://your-coolify-instance.com"
18
- }
19
- },
20
- ```
21
-
22
- ### Cursor
23
-
24
- command:
25
-
26
- `env COOLIFY_ACCESS_TOKEN:0|your-secret-token COOLIFY_BASE_URL:https://your-coolify-instance.com npx -y @stumason/coolify-mcp`
27
-
28
- ## Overview
29
-
30
- This MCP server provides a standardized interface for AI models to:
31
-
32
- - Query Coolify server information
33
- - Manage projects and environments
34
- - Handle deployments and resources
35
- - Monitor server status
36
- - And more...
37
-
38
- By implementing the [Model Context Protocol](https://modelcontextprotocol.io), this server allows AI assistants to understand and interact with your Coolify infrastructure in a secure and controlled manner.
39
-
40
- ## Prerequisites
41
-
42
- - Node.js >= 18
43
- - A running Coolify instance
44
- - Coolify API access token
45
-
46
- ## Installation
47
-
48
- ```bash
49
- # Clone the repository
50
- git clone https://github.com/stumason/coolify-mcp.git
51
- cd coolify-mcp
52
-
53
- # Install dependencies
54
- npm install
55
- ```
56
-
57
- ## Configuration
58
-
59
- The server requires the following environment variables:
60
-
61
- ```bash
62
- # Required
63
- COOLIFY_ACCESS_TOKEN=your_access_token_here
64
-
65
- # Optional (defaults to http://localhost:3000)
66
- COOLIFY_BASE_URL=https://your.coolify.instance
67
- ```
68
-
69
- ## Available Tools
7
+ Here are example prompts you can use with MCP-compatible AI assistants to interact with your Coolify instance:
70
8
 
71
9
  ### Server Management
72
10
 
73
- #### list_servers
74
-
75
- Lists all Coolify servers in your instance.
76
-
77
- ```typescript
78
- // Returns: ServerInfo[]
79
- await client.list_servers();
80
11
  ```
12
+ # List and Inspect Servers
13
+ - Show me all Coolify servers in my instance
14
+ - What's the status of server {uuid}?
15
+ - Show me the resources running on server {uuid}
16
+ - What domains are configured for server {uuid}?
17
+ - Can you validate the connection to server {uuid}?
81
18
 
82
- #### get_server
83
-
84
- Get detailed information about a specific server.
85
-
86
- ```typescript
87
- // Returns: ServerInfo
88
- await client.get_server(uuid: string)
19
+ # Resource Monitoring
20
+ - How much CPU and memory is server {uuid} using?
21
+ - List all resources running on server {uuid}
22
+ - Show me the current status of all servers
89
23
  ```
90
24
 
91
- #### get_server_resources
92
-
93
- Get current resources (applications, databases, etc.) running on a server.
25
+ ### Project Management
94
26
 
95
- ```typescript
96
- // Returns: ServerResources[]
97
- await client.get_server_resources(uuid: string)
98
27
  ```
28
+ # Project Operations
29
+ - List all my Coolify projects
30
+ - Create a new project called "my-webapp" with description "My web application"
31
+ - Show me the details of project {uuid}
32
+ - Update project {uuid} to change its name to "new-name"
33
+ - Delete project {uuid}
99
34
 
100
- #### get_server_domains
101
-
102
- Get domains associated with a server.
103
-
104
- ```typescript
105
- // Returns: ServerDomain[]
106
- await client.get_server_domains(uuid: string)
35
+ # Environment Management
36
+ - Show me the environments in project {uuid}
37
+ - Get details of the production environment in project {uuid}
38
+ - What variables are set in the staging environment of project {uuid}?
107
39
  ```
108
40
 
109
- #### validate_server
110
-
111
- Validate the connection to a specific server.
41
+ ### Application and Service Management
112
42
 
113
- ```typescript
114
- // Returns: ValidationResponse
115
- await client.validate_server(uuid: string)
116
43
  ```
44
+ # Application Management
45
+ - List all applications
46
+ - Show me details of application {uuid}
47
+ - Create a new application called "my-nodejs-app"
48
+ - Delete application {uuid}
117
49
 
118
- ### Project Management
119
-
120
- #### list_projects
121
-
122
- List all projects in your Coolify instance.
123
-
124
- ```typescript
125
- // Returns: Project[]
126
- await client.list_projects();
50
+ # Service Operations
51
+ - Show me all running services
52
+ - Create a new WordPress service:
53
+ - Name: my-blog
54
+ - Project UUID: {project_uuid}
55
+ - Server UUID: {server_uuid}
56
+ - Type: wordpress-with-mysql
57
+ - What's the status of service {uuid}?
58
+ - Delete service {uuid} and clean up its resources
127
59
  ```
128
60
 
129
- #### get_project
130
-
131
- Get detailed information about a specific project.
61
+ ### Database Management
132
62
 
133
- ```typescript
134
- // Returns: Project
135
- await client.get_project(uuid: string)
136
63
  ```
64
+ # Database Operations
65
+ - List all databases
66
+ - Show me the configuration of database {uuid}
67
+ - Update database {uuid}:
68
+ - Increase memory limit to 1GB
69
+ - Change public port to 5432
70
+ - Update password
71
+ - Delete database {uuid} and clean up volumes
137
72
 
138
- #### create_project
139
-
140
- Create a new project.
141
-
142
- ```typescript
143
- // Returns: { uuid: string }
144
- await client.create_project({
145
- name: string,
146
- description?: string
147
- })
73
+ # Database Types
74
+ - Create a PostgreSQL database
75
+ - Set up a Redis instance
76
+ - Configure a MongoDB database
77
+ - Initialize a MySQL database
148
78
  ```
149
79
 
150
- #### update_project
151
-
152
- Update an existing project's details.
80
+ ### Deployment Management
153
81
 
154
- ```typescript
155
- // Returns: Project
156
- await client.update_project(uuid: string, {
157
- name?: string,
158
- description?: string
159
- })
160
82
  ```
161
-
162
- #### delete_project
163
-
164
- Delete a project.
165
-
166
- ```typescript
167
- // Returns: { message: string }
168
- await client.delete_project(uuid: string)
83
+ # Deployment Operations
84
+ - Show me all active deployments
85
+ - What's the status of deployment {uuid}?
86
+ - Deploy application {uuid}
87
+ - Force rebuild and deploy application {uuid}
88
+ - List recent deployments for application {uuid}
169
89
  ```
170
90
 
171
- ### Environment Management
172
-
173
- #### list_environments
91
+ ## Installation
174
92
 
175
- List all environments or environments for a specific project.
93
+ ### Prerequisites
176
94
 
177
- ```typescript
178
- // Returns: Environment[]
179
- await client.list_environments(project_uuid?: string)
180
- ```
95
+ - Node.js >= 18
96
+ - A running Coolify instance
97
+ - Coolify API access token
181
98
 
182
- #### get_environment
99
+ ### Setup in AI Tools
183
100
 
184
- Get detailed information about a specific environment.
101
+ #### Claude Desktop
185
102
 
186
- ```typescript
187
- // Returns: Environment
188
- await client.get_environment(uuid: string)
103
+ ```json
104
+ "coolify": {
105
+ "command": "npx",
106
+ "args": [
107
+ "-y", "@masonator/coolify-mcp"
108
+ ],
109
+ "env": {
110
+ "COOLIFY_ACCESS_TOKEN": "0|your-secret-token",
111
+ "COOLIFY_BASE_URL": "https://your-coolify-instance.com"
112
+ }
113
+ }
189
114
  ```
190
115
 
191
- #### get_project_environment
192
-
193
- Get a specific environment within a project.
116
+ #### Cursor
194
117
 
195
- ```typescript
196
- // Returns: Environment
197
- await client.get_project_environment(
198
- project_uuid: string,
199
- environment_name_or_uuid: string
200
- )
118
+ ```bash
119
+ env COOLIFY_ACCESS_TOKEN:0|your-secret-token COOLIFY_BASE_URL:https://your-coolify-instance.com npx -y @stumason/coolify-mcp
201
120
  ```
202
121
 
203
- #### create_environment
122
+ ## Development
204
123
 
205
- Create a new environment.
124
+ ### Local Setup
206
125
 
207
- ```typescript
208
- // Returns: { uuid: string }
209
- await client.create_environment({
210
- name: string,
211
- project_uuid: string,
212
- variables?: Record<string, string>
213
- })
214
- ```
126
+ ```bash
127
+ # Clone the repository
128
+ git clone https://github.com/stumason/coolify-mcp.git
129
+ cd coolify-mcp
215
130
 
216
- #### update_environment_variables
131
+ # Install dependencies
132
+ npm install
217
133
 
218
- Update variables for a specific environment.
134
+ # Build the project
135
+ npm run build
219
136
 
220
- ```typescript
221
- // Returns: Environment
222
- await client.update_environment_variables(
223
- uuid: string,
224
- { variables: Record<string, string> }
225
- )
137
+ # Run tests
138
+ npm test
226
139
  ```
227
140
 
228
- #### delete_environment
141
+ ### Environment Variables
229
142
 
230
- Delete an environment.
143
+ ```bash
144
+ # Required
145
+ COOLIFY_ACCESS_TOKEN=your_access_token_here
231
146
 
232
- ```typescript
233
- // Returns: { message: string }
234
- await client.delete_environment(uuid: string)
147
+ # Optional (defaults to http://localhost:3000)
148
+ COOLIFY_BASE_URL=https://your.coolify.instance
235
149
  ```
236
150
 
237
- ## Type Definitions
151
+ ## API Reference
152
+
153
+ ### Resource Types
238
154
 
239
- ### ServerInfo
155
+ #### Application
240
156
 
241
157
  ```typescript
242
- interface ServerInfo {
158
+ interface Application {
243
159
  uuid: string;
244
160
  name: string;
245
- status: 'running' | 'stopped' | 'error';
246
- version: string;
247
- resources: {
248
- cpu: number;
249
- memory: number;
250
- disk: number;
251
- };
161
+ // Additional properties based on your Coolify instance
252
162
  }
253
163
  ```
254
164
 
255
- ### Environment
165
+ #### Service
256
166
 
257
167
  ```typescript
258
- interface Environment {
168
+ interface Service {
259
169
  id: number;
260
170
  uuid: string;
261
171
  name: string;
172
+ type: ServiceType; // Various types like 'wordpress', 'mysql', etc.
173
+ status: 'running' | 'stopped' | 'error';
262
174
  project_uuid: string;
263
- variables?: Record<string, string>;
264
- created_at: string;
265
- updated_at: string;
175
+ environment_uuid: string;
176
+ server_uuid: string;
177
+ domains?: string[];
266
178
  }
267
179
  ```
268
180
 
269
- ### Project
181
+ #### Database
270
182
 
271
183
  ```typescript
272
- interface Project {
184
+ interface Database {
273
185
  id: number;
274
186
  uuid: string;
275
187
  name: string;
276
- description?: string;
277
- environments?: Environment[];
188
+ type: 'postgresql' | 'mysql' | 'mongodb' | 'redis' | /* other types */;
189
+ status: 'running' | 'stopped' | 'error';
190
+ is_public: boolean;
191
+ public_port?: number;
192
+ // Additional configuration based on database type
278
193
  }
279
194
  ```
280
195
 
281
- ## Development
282
-
283
- ```bash
284
- # Run in development mode
285
- npm run build -- --watch
286
- ```
287
-
288
- ### Testing
289
-
290
- ```bash
291
- # Run all tests
292
- npm test
293
-
294
- # Run tests in watch mode
295
- npm test -- --watch
296
-
297
- # Run tests with coverage
298
- npm test -- --coverage
299
- ```
300
-
301
- ### Code Quality
302
-
303
- ```bash
304
- # Run linter
305
- npm run lint
306
-
307
- # Fix linting issues
308
- npm run lint -- --fix
309
-
310
- # Format code
311
- npm run format
312
- ```
313
-
314
- ## Architecture
315
-
316
- The project follows a modular architecture:
196
+ #### Deployment
317
197
 
318
- ```
319
- src/
320
- ├── lib/
321
- │ ├── coolify-client.ts # Coolify API client
322
- │ └── mcp-server.ts # MCP server implementation
323
- ├── types/
324
- │ └── coolify.ts # TypeScript type definitions
325
- └── index.ts # Entry point
198
+ ```typescript
199
+ interface Deployment {
200
+ id: number;
201
+ uuid: string;
202
+ application_uuid: string;
203
+ status: string;
204
+ created_at: string;
205
+ updated_at: string;
206
+ }
326
207
  ```
327
208
 
328
- ### Key Components
329
-
330
- 1. **CoolifyClient**: Handles communication with the Coolify API
331
-
332
- - Authentication
333
- - API request handling
334
- - Error management
335
-
336
- 2. **CoolifyMcpServer**: Implements the MCP server
337
- - Resource management
338
- - Tool implementations
339
- - Client request handling
340
-
341
209
  ## Contributing
342
210
 
343
- 1. Fork the repository
344
- 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
345
- 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
346
- 4. Push to the branch (`git push origin feature/amazing-feature`)
347
- 5. Open a Pull Request
348
-
349
- ### Development Guidelines
350
-
351
- - Follow TypeScript best practices
352
- - Maintain test coverage
353
- - Update documentation as needed
354
- - Follow the established code style
355
-
356
- ## CI/CD
357
-
358
- GitHub Actions workflows are configured to:
359
-
360
- - Run tests on Node.js 18.x and 20.x
361
- - Check code formatting
362
- - Verify build process
363
- - Run linting checks
211
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
364
212
 
365
213
  ## License
366
214