Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

enable_static_nat

Map a public IP address to a virtual machine using static NAT, ensuring direct accessibility and efficient routing between the VM and external networks. Requires IP address ID and VM ID for configuration.

Instructions

Enable static NAT for an IP to a VM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipaddressidYesPublic IP address ID
virtualmachineidYesVM ID
vmguestipNoVM guest IP (for multiple IPs)

Implementation Reference

  • The main handler function that implements the enable_static_nat tool logic. It calls the CloudStack client to enable static NAT and returns a formatted text response indicating success.
    async handleEnableStaticNat(args: any) { const result = await this.cloudStackClient.enableStaticNat(args); return { content: [ { type: 'text', text: `Enabled static NAT for IP ${args.ipaddressid} to VM ${args.virtualmachineid}. Success: ${result.enablestaticnatresponse?.success}` } ] }; }
  • The tool schema definition including name, description, and input schema validation for enable_static_nat.
    { name: 'enable_static_nat', description: 'Enable static NAT for an IP to a VM', inputSchema: { type: 'object', properties: { ipaddressid: { type: 'string', description: 'Public IP address ID', }, virtualmachineid: { type: 'string', description: 'VM ID', }, vmguestip: { type: 'string', description: 'VM guest IP (for multiple IPs)', }, }, required: ['ipaddressid', 'virtualmachineid'], additionalProperties: false, }, },
  • src/server.ts:158-159 (registration)
    The registration and dispatching of the enable_static_nat tool in the MCP server's CallToolRequest handler switch statement.
    case 'enable_static_nat': return await this.networkHandlers.handleEnableStaticNat(args);
  • Helper method in the CloudStackClient class that wraps the API request to CloudStack's enableStaticNat endpoint.
    async enableStaticNat(params: CloudStackParams): Promise<CloudStackResponse> { return this.request('enableStaticNat', params); }

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/phantosmax/cloudstack-mcp-server'

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