create_database
Create a new database for applications on Coolify PaaS. Supports PostgreSQL, MySQL, MariaDB, MongoDB, Redis, ClickHouse, Dragonfly, and KeyDB types.
Instructions
Create a new database. Valid types: postgresql, mysql, mariadb, mongodb, redis, clickhouse, dragonfly, keydb
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Database name | |
| type | Yes | Database type (postgresql, mysql, mariadb, mongodb, redis, clickhouse, dragonfly, keydb) | |
| project_uuid | Yes | Project UUID | |
| environment_name | Yes | Environment name | |
| server_uuid | Yes | Server UUID |
Implementation Reference
- src/tools/handlers.ts:362-384 (handler)Handler implementation that validates input parameters, maps the database type to the appropriate Coolify API endpoint, validates the type, and sends a POST request to create the database.case 'create_database': requireParam(args, 'name'); requireParam(args, 'type'); requireParam(args, 'project_uuid'); requireParam(args, 'environment_name'); requireParam(args, 'server_uuid'); // Coolify uses type-specific endpoints for database creation const dbType = String(args.type).toLowerCase(); const validTypes: Record<string, string> = { 'postgresql': '/databases/postgresql', 'mysql': '/databases/mysql', 'mariadb': '/databases/mariadb', 'mongodb': '/databases/mongodb', 'redis': '/databases/redis', 'clickhouse': '/databases/clickhouse', 'dragonfly': '/databases/dragonfly', 'keydb': '/databases/keydb' }; const endpoint = validTypes[dbType]; if (!endpoint) { throw new McpError(ErrorCode.InvalidParams, `Invalid database type: ${dbType}. Valid types are: ${Object.keys(validTypes).join(', ')}`); } return client.post(endpoint, args);
- src/tools/definitions.ts:587-599 (registration)Tool registration definition including the name, description, and input schema for the MCP tool system.name: 'create_database', description: 'Create a new database. Valid types: postgresql, mysql, mariadb, mongodb, redis, clickhouse, dragonfly, keydb', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Database name' }, type: { type: 'string', description: 'Database type (postgresql, mysql, mariadb, mongodb, redis, clickhouse, dragonfly, keydb)' }, project_uuid: { type: 'string', description: 'Project UUID' }, environment_name: { type: 'string', description: 'Environment name' }, server_uuid: { type: 'string', description: 'Server UUID' } }, required: ['name', 'type', 'project_uuid', 'environment_name', 'server_uuid'] }
- src/types.ts:150-156 (schema)TypeScript interface defining the structure of the input parameters for creating a database.export interface CreateDatabaseInput { name: string; type: string; project_uuid: string; environment_name: string; server_uuid: string; }