Skip to main content
Glama

coolify_environment_configuration

Configure and manage environment variables, domains, and application logs for self-hosted applications on Coolify MCP Server. Perform actions like updating or retrieving environment settings, setting domains, and fetching logs efficiently.

Instructions

Manage environment variables, configure domains, and retrieve application logs

Input Schema

NameRequiredDescriptionDefault
actionYesAction to perform: update env vars, get env vars, set domain, or get logs
applicationIdYesApplication ID (required for all actions)
domainNoDomain name to set (for set_domain action)
enableHttpsNoWhether to enable HTTPS/SSL (for set_domain action)
linesNoNumber of log lines to retrieve (for get_logs action)
sinceNoRetrieve logs since this timestamp (ISO format, for get_logs action)
variablesNoArray of environment variables to set (for update_env)

Input Schema (JSON Schema)

{ "properties": { "action": { "description": "Action to perform: update env vars, get env vars, set domain, or get logs", "enum": [ "update_env", "get_env", "set_domain", "get_logs" ], "type": "string" }, "applicationId": { "description": "Application ID (required for all actions)", "type": "string" }, "domain": { "description": "Domain name to set (for set_domain action)", "type": "string" }, "enableHttps": { "default": true, "description": "Whether to enable HTTPS/SSL (for set_domain action)", "type": "boolean" }, "lines": { "default": 100, "description": "Number of log lines to retrieve (for get_logs action)", "maximum": 1000, "minimum": 1, "type": "number" }, "since": { "description": "Retrieve logs since this timestamp (ISO format, for get_logs action)", "type": "string" }, "variables": { "description": "Array of environment variables to set (for update_env)", "items": { "properties": { "is_build_time": { "default": false, "description": "Whether this variable is available at build time", "type": "boolean" }, "is_sensitive": { "default": false, "description": "Whether this is a sensitive variable (will be hidden in UI)", "type": "boolean" }, "key": { "description": "Environment variable key/name", "type": "string" }, "value": { "description": "Environment variable value", "type": "string" } }, "required": [ "key", "value" ], "type": "object" }, "type": "array" } }, "required": [ "action", "applicationId" ], "type": "object" }

Implementation Reference

  • The handler function that implements the core logic for the 'coolify_environment_configuration' tool, dispatching to specific actions like updating environment variables, getting env vars, setting domains, and retrieving logs using the Coolify API client.
    export async function handleEnvironmentConfiguration( coolifyClient: CoolifyApiClient, args: any ): Promise<any> { try { const { action, applicationId, ...params } = args; let result; let message; switch (action) { case 'update_env': if (!params.variables || !Array.isArray(params.variables)) { throw new Error('variables array is required for update_env action'); } result = await coolifyClient.updateEnvironmentVariables(applicationId, params.variables); message = `Updated ${params.variables.length} environment variables for application ${applicationId}`; break; case 'get_env': result = await coolifyClient.getEnvironmentVariables(applicationId); message = `Retrieved environment variables for application ${applicationId}`; break; case 'set_domain': if (!params.domain) { throw new Error('domain is required for set_domain action'); } result = await coolifyClient.setDomain(applicationId, params.domain, params.enableHttps); message = `Set domain ${params.domain} for application ${applicationId}`; break; case 'get_logs': result = await coolifyClient.getApplicationLogs( applicationId, params.lines || 100, params.since ); message = `Retrieved ${params.lines || 100} log lines for application ${applicationId}`; break; default: throw new Error(`Unknown environment action: ${action}`); } return { content: [ { type: 'text', text: JSON.stringify({ success: true, data: result, message: message }, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: error instanceof Error ? error.message : 'Unknown error occurred' }, null, 2) } ], isError: true }; } }
  • The Tool object definition including name, description, and detailed inputSchema for validating tool inputs.
    export const environmentConfigurationTool: Tool = { name: 'coolify_environment_configuration', description: 'Manage environment variables, configure domains, and retrieve application logs', inputSchema: { type: 'object', properties: { action: { type: 'string', enum: ['update_env', 'get_env', 'set_domain', 'get_logs'], description: 'Action to perform: update env vars, get env vars, set domain, or get logs', }, applicationId: { type: 'string', description: 'Application ID (required for all actions)', }, // Environment variable parameters variables: { type: 'array', description: 'Array of environment variables to set (for update_env)', items: { type: 'object', properties: { key: { type: 'string', description: 'Environment variable key/name', }, value: { type: 'string', description: 'Environment variable value', }, is_sensitive: { type: 'boolean', description: 'Whether this is a sensitive variable (will be hidden in UI)', default: false, }, is_build_time: { type: 'boolean', description: 'Whether this variable is available at build time', default: false, }, }, required: ['key', 'value'], }, }, // Domain parameters domain: { type: 'string', description: 'Domain name to set (for set_domain action)', }, enableHttps: { type: 'boolean', description: 'Whether to enable HTTPS/SSL (for set_domain action)', default: true, }, // Log parameters lines: { type: 'number', description: 'Number of log lines to retrieve (for get_logs action)', default: 100, minimum: 1, maximum: 1000, }, since: { type: 'string', description: 'Retrieve logs since this timestamp (ISO format, for get_logs action)', }, }, required: ['action', 'applicationId'], }, };
  • src/index.ts:39-42 (registration)
    Import of the tool schema and handler function from the unified environment tool module.
    import { environmentConfigurationTool, handleEnvironmentConfiguration, } from './tools/environment-unified';
  • src/index.ts:125-134 (registration)
    Registration of the tool in the listTools handler, making it discoverable by clients.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ applicationManagementTool, environmentConfigurationTool, systemManagementTool, documentationTool, ], }; });
  • src/index.ts:153-154 (registration)
    Registration of the handler dispatch in the CallToolRequestSchema switch statement.
    case 'coolify_environment_configuration': return await handleEnvironmentConfiguration(this.coolifyClient, args);

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GoCoder7/coolify-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server