Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

create_security_group_rule

Add an ingress rule to a security group on the CloudStack MCP Server by specifying protocol, port range, CIDR list, or user security group list.

Instructions

Create a security group ingress rule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidrlistNoCIDR list (comma-separated)
endportNoEnd port
protocolYesProtocol (TCP, UDP, ICMP)
securitygroupidYesSecurity group ID
startportNoStart port
usersecuritygrouplistNoUser security group list

Implementation Reference

  • The main handler function that implements the tool logic by authorizing a security group ingress rule via the CloudStack client and returning a formatted response.
    async handleCreateSecurityGroupRule(args: any) {
      const result = await this.cloudStackClient.authorizeSecurityGroupIngress(args);
      
      return {
        content: [
          {
            type: 'text',
            text: `Created security group rule. Job ID: ${result.authorizesecuritygroupingressresponse?.jobid}\nRule ID: ${result.authorizesecuritygroupingressresponse?.id}`
          }
        ]
      };
    }
  • The tool definition object including name, description, and input schema (parameters with types and requirements) for validating tool inputs.
    {
      name: 'create_security_group_rule',
      description: 'Create a security group ingress rule',
      inputSchema: {
        type: 'object',
        properties: {
          securitygroupid: {
            type: 'string',
            description: 'Security group ID',
          },
          protocol: {
            type: 'string',
            description: 'Protocol (TCP, UDP, ICMP)',
          },
          startport: {
            type: 'number',
            description: 'Start port',
          },
          endport: {
            type: 'number',
            description: 'End port',
          },
          cidrlist: {
            type: 'string',
            description: 'CIDR list (comma-separated)',
          },
          usersecuritygrouplist: {
            type: 'string',
            description: 'User security group list',
          },
        },
        required: ['securitygroupid', 'protocol'],
        additionalProperties: false,
      },
    },
  • src/server.ts:206-207 (registration)
    The dispatch case in the main tool request handler that routes 'create_security_group_rule' calls to the appropriate security handler method.
    case 'create_security_group_rule':
      return await this.securityHandlers.handleCreateSecurityGroupRule(args);

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