coolify_databases
Manage databases in Coolify infrastructure: create, list, retrieve, update, and delete databases with support for PostgreSQL, MySQL, MongoDB, Redis, and other database types.
Instructions
Database CRUD operations - list, create, get, update, and delete databases
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform: list (list all databases), create (create new database), get (get database by UUID), update (update database), delete (delete database) | |
| uuid | No | Database UUID (required for get, update, delete actions) | |
| name | No | Database name (required for create, optional for update) | |
| description | No | Database description (optional for create and update) | |
| type | No | Database type (required for create action) | |
| server_uuid | No | Server UUID (required for create action) | |
| project_uuid | No | Project UUID (required for create action) | |
| environment_name | No | Environment name (required for create action) | |
| page | No | Page number (optional for list action) | |
| per_page | No | Items per page (optional for list action) |
Implementation Reference
- src/handlers.ts:244-273 (handler)Handler function that executes the coolify_databases tool logic for actions: list, create, get, update, delete by making API calls to Coolify endpoints.async databases(action: string, args: any) { switch (action) { case 'list': const queryString = this.apiClient.buildQueryString(args); const response = await this.apiClient.get(`/databases?${queryString}`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }; case 'create': if (!args.type) throw new Error('Database type is required for create action'); const endpoint = `/databases/${args.type}`; const createResponse = await this.apiClient.post(endpoint, args); return { content: [{ type: 'text', text: JSON.stringify(createResponse.data, null, 2) }] }; case 'get': if (!args.uuid) throw new Error('Database UUID is required for get action'); const getResponse = await this.apiClient.get(`/databases/${args.uuid}`); return { content: [{ type: 'text', text: JSON.stringify(getResponse.data, null, 2) }] }; case 'update': if (!args.uuid) throw new Error('Database UUID is required for update action'); const updateResponse = await this.apiClient.patch(`/databases/${args.uuid}`, { name: args.name, description: args.description, }); return { content: [{ type: 'text', text: JSON.stringify(updateResponse.data, null, 2) }] }; case 'delete': if (!args.uuid) throw new Error('Database UUID is required for delete action'); await this.apiClient.delete(`/databases/${args.uuid}`); return { content: [{ type: 'text', text: 'Database deleted successfully' }] }; default: throw new Error(`Unknown databases action: ${action}`); } }
- src/tools.ts:355-405 (schema)Input schema definition for the coolify_databases tool defining parameters for CRUD operations on databases.name: 'coolify_databases', description: 'Database CRUD operations - list, create, get, update, and delete databases', inputSchema: { type: 'object', properties: { action: { type: 'string', enum: ['list', 'create', 'get', 'update', 'delete'], description: 'Action to perform: list (list all databases), create (create new database), get (get database by UUID), update (update database), delete (delete database)' }, uuid: { type: 'string', description: 'Database UUID (required for get, update, delete actions)' }, name: { type: 'string', description: 'Database name (required for create, optional for update)' }, description: { type: 'string', description: 'Database description (optional for create and update)' }, type: { type: 'string', enum: ['postgresql', 'mysql', 'mongodb', 'redis', 'mariadb', 'clickhouse', 'dragonfly', 'keydb'], description: 'Database type (required for create action)' }, server_uuid: { type: 'string', description: 'Server UUID (required for create action)' }, project_uuid: { type: 'string', description: 'Project UUID (required for create action)' }, environment_name: { type: 'string', description: 'Environment name (required for create action)' }, page: { type: 'number', description: 'Page number (optional for list action)' }, per_page: { type: 'number', description: 'Items per page (optional for list action)' }, }, required: ['action'], }, },
- src/index.ts:85-142 (registration)Tool dispatch registration in the MCP server's handleToolCall switch statement, routing coolify_databases calls to the handlers.databases method.private async handleToolCall(name: string, args: any) { switch (name) { // System Management case 'coolify_system': return await this.handlers.system(args.action); // Team Management case 'coolify_teams': return await this.handlers.teams(args.action, args.team_id); // Project Management case 'coolify_projects': return await this.handlers.projects(args.action, args); case 'coolify_project_environments': return await this.handlers.projectEnvironments(args.action, args); // Application Management case 'coolify_applications': return await this.handlers.applications(args.action, args); case 'coolify_application_lifecycle': return await this.handlers.applicationLifecycle(args.action, args.uuid); case 'coolify_application_envs': return await this.handlers.applicationEnvs(args.action, args); case 'coolify_logs': return await this.handlers.logs(args.action, args.uuid, args.lines); case 'coolify_application_deployments': return await this.handlers.applicationDeployments(args.action, args); // Database Management case 'coolify_databases': return await this.handlers.databases(args.action, args); case 'coolify_database_lifecycle': return await this.handlers.databaseLifecycle(args.action, args.uuid); case 'coolify_database_types': return await this.handlers.databaseTypes(args.action, args); // Server Management case 'coolify_servers': return await this.handlers.servers(args.action, args); case 'coolify_server_management': return await this.handlers.serverManagement(args.action, args.uuid); // Service Management case 'coolify_services': return await this.handlers.services(args.action, args); case 'coolify_service_lifecycle': return await this.handlers.serviceLifecycle(args.action, args.uuid); case 'coolify_service_envs': return await this.handlers.serviceEnvs(args.action, args); // Security Keys Management case 'coolify_security_keys': return await this.handlers.securityKeys(args.action, args); default: throw new CoolifyError(`Unknown tool: ${name}`, 400); } }
- src/index.ts:60-64 (registration)Registration of tool list handler providing the coolify_databases tool schema via getTools() from tools.ts.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: getTools(), }; });