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
| Name | Required | Description | Default |
|---|---|---|---|
| services | No |
Implementation Reference
- src/services/mcp-server.ts:89-107 (registration)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: [], },
- src/services/mcp-server.ts:220-244 (handler)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}`, }, ], }; }
- src/services/mcp-server.ts:26-32 (schema)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'), });
- src/tools/vps-initializer.ts:21-48 (handler)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;
- src/tools/vps-initializer.ts:10-16 (schema)TypeScript interface defining the VPSServices input structure used by initializeVPS.export interface VPSServices { nodejs?: boolean; pm2?: boolean; rust?: boolean; nginx?: boolean; redis?: boolean; }