create_public_application
Deploy applications from public Git repositories to Coolify PaaS by configuring project, environment, server, build settings, and ports for automated deployment.
Instructions
Create a new public application from a public Git repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_uuid | Yes | Project UUID | |
| environment_name | Yes | Environment name | |
| environment_uuid | No | Environment UUID (optional) | |
| server_uuid | Yes | Server UUID | |
| destination_uuid | No | Destination UUID (optional if server has single destination) | |
| git_repository | Yes | Public Git repository URL | |
| git_branch | Yes | Git branch name | |
| build_pack | Yes | Build pack type (nixpacks, dockerfile, dockercompose) | |
| ports_exposes | Yes | Ports to expose (e.g., "3000,8080") | |
| name | No | Application name (optional, auto-generated if not provided) | |
| description | No | Application description | |
| instant_deploy | No | Deploy immediately after creation |
Implementation Reference
- src/tools/handlers.ts:157-165 (handler)The switch case handler for 'create_public_application' that validates required parameters using requireParam and executes client.post to the Coolify API endpoint '/applications/public'.case 'create_public_application': requireParam(args, 'project_uuid'); requireParam(args, 'environment_name'); requireParam(args, 'server_uuid'); requireParam(args, 'git_repository'); requireParam(args, 'git_branch'); requireParam(args, 'build_pack'); requireParam(args, 'ports_exposes'); return client.post('/applications/public', args);
- src/tools/definitions.ts:285-306 (schema)The input schema definition for the 'create_public_application' tool, including description, properties, and required fields.{ name: 'create_public_application', description: 'Create a new public application from a public Git repository', inputSchema: { type: 'object', properties: { project_uuid: { type: 'string', description: 'Project UUID' }, environment_name: { type: 'string', description: 'Environment name' }, environment_uuid: { type: 'string', description: 'Environment UUID (optional)' }, server_uuid: { type: 'string', description: 'Server UUID' }, destination_uuid: { type: 'string', description: 'Destination UUID (optional if server has single destination)' }, git_repository: { type: 'string', description: 'Public Git repository URL' }, git_branch: { type: 'string', description: 'Git branch name' }, build_pack: { type: 'string', description: 'Build pack type (nixpacks, dockerfile, dockercompose)' }, ports_exposes: { type: 'string', description: 'Ports to expose (e.g., "3000,8080")' }, name: { type: 'string', description: 'Application name (optional, auto-generated if not provided)' }, description: { type: 'string', description: 'Application description' }, instant_deploy: { type: 'boolean', description: 'Deploy immediately after creation', default: false } }, required: ['project_uuid', 'environment_name', 'server_uuid', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'] } },
- src/index.ts:34-67 (registration)MCP server registration of tools via ListToolsRequestHandler (using getToolDefinitions which includes the schema) and CallToolRequestHandler (using handleTool to execute the tool by name).private setupHandlers() { // List available tools (filtered by read-only mode) this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getToolDefinitions() })); // Handle tool calls this.server.setRequestHandler(CallToolRequestSchema, async (request) => { if (!this.client) { throw new McpError(ErrorCode.InternalError, 'Client not initialized'); } const { name, arguments: args } = request.params; // Block write operations in read-only mode if (isReadOnlyMode() && !READ_ONLY_TOOLS.includes(name)) { throw new McpError( ErrorCode.InvalidRequest, `Operation '${name}' is not allowed in read-only mode. Set COOLIFY_READONLY=false to enable write operations.` ); } try { const result = await handleTool(this.client, name, args || {}); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { if (error instanceof McpError) throw error; const message = error instanceof Error ? error.message : 'Unknown error'; throw new McpError(ErrorCode.InternalError, `Tool execution failed: ${message}`); } });