Skip to main content
Glama

create_server

Set up a new server in Coolify by specifying name, IP address, and SSH credentials to deploy applications and manage infrastructure.

Instructions

Create a new server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesServer name
descriptionNoServer description
ipYesServer IP address
portNoSSH port (default: 22)
userNoSSH user (default: root)root
private_key_uuidYesUUID of the private key for SSH
is_build_serverNoUse as build server
instant_validateNoValidate immediately

Implementation Reference

  • Handler implementation for 'create_server' tool: checks required parameters and sends POST request to Coolify API /servers endpoint.
    case 'create_server':
      requireParam(args, 'name');
      requireParam(args, 'ip');
      requireParam(args, 'private_key_uuid');
      return client.post('/servers', args);
  • Schema definition and registration in the allToolDefinitions array, including input schema with properties and required fields for create_server.
    {
      name: 'create_server',
      description: 'Create a new server',
      inputSchema: {
        type: 'object',
        properties: {
          name: { type: 'string', description: 'Server name' },
          description: { type: 'string', description: 'Server description' },
          ip: { type: 'string', description: 'Server IP address' },
          port: { type: 'number', description: 'SSH port (default: 22)', default: 22 },
          user: { type: 'string', description: 'SSH user (default: root)', default: 'root' },
          private_key_uuid: { type: 'string', description: 'UUID of the private key for SSH' },
          is_build_server: { type: 'boolean', description: 'Use as build server', default: false },
          instant_validate: { type: 'boolean', description: 'Validate immediately', default: true }
        },
        required: ['name', 'ip', 'private_key_uuid']
      }
  • TypeScript interface CreateServerInput defining the input parameters for create_server tool.
    export interface CreateServerInput {
      name: string;
      description?: string;
      ip: string;
      port?: number;
      user?: string;
      private_key_uuid: string;
      is_build_server?: boolean;
      instant_validate?: boolean;
    }
  • src/tools/index.ts:2-2 (registration)
    Re-export of handleTool function used by the MCP server.
    export { handleTool } from './handlers.js';
  • src/index.ts:41-67 (registration)
    MCP server request handler for CallToolRequestSchema, which dispatches to handleTool based on tool name, including create_server.
    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}`);
      }
    });
Install Server

Other 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/kof70/coolify-mcp-server'

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