Skip to main content
Glama

vps_initialize

Set up a new VPS with basic configuration and optional services like Node.js, Nginx, and Redis. Automates installation and management for streamlined server deployment.

Instructions

Initialize a fresh VPS with basic setup and optional services

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
servicesNo

Implementation Reference

  • Registration of the 'vps_initialize' tool in the MCP server's listTools handler, including name, description, and input schema.
    { name: 'vps_initialize', description: 'Initialize a fresh VPS with basic setup and optional services', inputSchema: { type: 'object', properties: { services: { type: 'object', properties: { nodejs: { type: 'boolean', description: 'Install Node.js' }, pm2: { type: 'boolean', description: 'Install PM2' }, rust: { type: 'boolean', description: 'Install Rust' }, nginx: { type: 'boolean', description: 'Install Nginx' }, redis: { type: 'boolean', description: 'Install Redis' }, }, }, }, required: [], },
  • Direct MCP handler for 'vps_initialize' tool call, validates input and delegates to VPSInitializer.initializeVPS.
    private async handleVPSInitialize( args: unknown ): Promise<{ content: Array<{ type: 'text'; text: string }> }> { if (!this.vpsInitializer) { throw new Error('SSH connection not established. Please connect first.'); } const services = VPSServicesSchema.parse(args); const results = await this.vpsInitializer.initializeVPS(services); const output = results .map( result => `${result.service}: ${result.success ? 'Success' : 'Failed'} - ${result.message}` ) .join('\n'); return { content: [ { type: 'text', text: `VPS Initialization Results:\n${output}`, }, ], }; }
  • Zod schema for validating the services input parameter of vps_initialize tool.
    const VPSServicesSchema = z.object({ nodejs: z.boolean().optional().default(false).describe('Install Node.js'), pm2: z.boolean().optional().default(false).describe('Install PM2'), rust: z.boolean().optional().default(false).describe('Install Rust'), nginx: z.boolean().optional().default(false).describe('Install Nginx'), redis: z.boolean().optional().default(false).describe('Install Redis'), });
  • Core handler logic in VPSInitializer that orchestrates system update and conditional installation of selected services via SSH commands.
    async initializeVPS(services: VPSServices): Promise<VPSInitResult[]> { const results: VPSInitResult[] = []; // Always start with system updates results.push(await this.updateSystem()); // Install requested services if (services.nodejs) { results.push(await this.installNodeJS()); } if (services.pm2) { results.push(await this.installPM2()); } if (services.rust) { results.push(await this.installRust()); } if (services.nginx) { results.push(await this.installNginx()); } if (services.redis) { results.push(await this.installRedis()); } return results;
  • TypeScript interface defining the VPSServices input structure used by initializeVPS.
    export interface VPSServices { nodejs?: boolean; pm2?: boolean; rust?: boolean; nginx?: boolean; redis?: boolean; }

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/oxy-Op/DevPilot'

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