Skip to main content
Glama
rlymbur

Amazon VPC Lattice MCP Server

by rlymbur

vpc_lattice_cli

Manage and execute AWS CLI commands for VPC Lattice, including creating, updating, and deleting service networks, services, listeners, rules, and target groups, using specified AWS profiles and regions.

Instructions

Execute AWS CLI VPC Lattice commands

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoCommand arguments as key-value pairs
commandYesThe VPC Lattice subcommand to execute (e.g., create-service-network, list-service-networks)
profileNoAWS CLI profile to usedefault
regionNoAWS regionus-east-1

Implementation Reference

  • Handler implementation for the vpc_lattice_cli tool. Parses arguments, constructs AWS CLI command for vpc-lattice, spawns the process, captures output, and returns JSON result or errors.
    case 'vpc_lattice_cli': { const { command, args = {}, profile = 'default', region = 'us-east-1' } = request.params.arguments as { command: string; args?: Record<string, any>; profile?: string; region?: string; }; // Convert args object to CLI arguments string const argsStr = Object.entries(args) .map(([key, value]) => { const cliKey = key.replace(/[A-Z]/g, letter => `-${letter.toLowerCase()}`); if (typeof value === 'boolean') { return value ? `--${cliKey}` : `--no-${cliKey}`; } if (Array.isArray(value)) { return `--${cliKey} ${value.join(',')}`; } return `--${cliKey} ${value}`; }) .join(' '); // Construct and execute the AWS CLI command const { spawn } = await import('child_process'); const awsProcess = spawn('aws', [ 'vpc-lattice', command, '--profile', profile, '--region', region, ...(argsStr ? argsStr.split(' ') : []), '--output', 'json' ]); return new Promise((resolve, reject) => { let stdout = ''; let stderr = ''; awsProcess.stdout.on('data', (data) => { stdout += data.toString(); }); awsProcess.stderr.on('data', (data) => { stderr += data.toString(); }); awsProcess.on('close', (code) => { if (code !== 0) { reject(new McpError( ErrorCode.InternalError, `AWS CLI command failed: ${stderr}` )); return; } try { const result = stdout ? JSON.parse(stdout) : {}; resolve({ content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }); } catch (error) { reject(new McpError( ErrorCode.InternalError, `Failed to parse AWS CLI output: ${(error as Error).message}` )); } }); awsProcess.on('error', (error) => { reject(new McpError( ErrorCode.InternalError, `Failed to execute AWS CLI command: ${(error as Error).message}` )); }); }); }
  • src/tools.ts:64-126 (registration)
    Tool registration in the tools array, including name, description, and input schema defining allowed commands and arguments.
    { name: 'vpc_lattice_cli', description: 'Execute AWS CLI VPC Lattice commands', inputSchema: { type: 'object', properties: { command: { type: 'string', description: 'The VPC Lattice subcommand to execute (e.g., create-service-network, list-service-networks)', enum: [ 'create-service-network', 'delete-service-network', 'get-service-network', 'list-service-networks', 'update-service-network', 'create-service', 'delete-service', 'get-service', 'list-services', 'update-service', 'create-listener', 'delete-listener', 'get-listener', 'list-listeners', 'update-listener', 'create-rule', 'delete-rule', 'get-rule', 'list-rules', 'update-rule', 'create-target-group', 'delete-target-group', 'get-target-group', 'list-target-groups', 'update-target-group', 'register-targets', 'deregister-targets', 'list-targets', 'list-tags-for-resource', 'tag-resource', 'untag-resource' ] }, args: { type: 'object', description: 'Command arguments as key-value pairs', additionalProperties: true }, profile: { type: 'string', description: 'AWS CLI profile to use', default: 'default' }, region: { type: 'string', description: 'AWS region', default: 'us-east-1' } }, required: ['command'], additionalProperties: false } }
  • Input schema for vpc_lattice_cli tool, specifying command enum, args object, optional profile and region.
    inputSchema: { type: 'object', properties: { command: { type: 'string', description: 'The VPC Lattice subcommand to execute (e.g., create-service-network, list-service-networks)', enum: [ 'create-service-network', 'delete-service-network', 'get-service-network', 'list-service-networks', 'update-service-network', 'create-service', 'delete-service', 'get-service', 'list-services', 'update-service', 'create-listener', 'delete-listener', 'get-listener', 'list-listeners', 'update-listener', 'create-rule', 'delete-rule', 'get-rule', 'list-rules', 'update-rule', 'create-target-group', 'delete-target-group', 'get-target-group', 'list-target-groups', 'update-target-group', 'register-targets', 'deregister-targets', 'list-targets', 'list-tags-for-resource', 'tag-resource', 'untag-resource' ] }, args: { type: 'object', description: 'Command arguments as key-value pairs', additionalProperties: true }, profile: { type: 'string', description: 'AWS CLI profile to use', default: 'default' }, region: { type: 'string', description: 'AWS region', default: 'us-east-1' } }, required: ['command'], additionalProperties: false }

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/rlymbur/amazon-vpc-lattice-mcp-server'

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