amazon vpc lattice mcp server

Local 2025-09-01 01:01:15 0

A Model Context Protocol server that provides tools for accessing and managing AWS VPC Lattice information, allowing users to list sources and retrieve sample prompts related to AWS networking documentation.


A Model Context Protocol (MCP) server that provides tools for accessing and managing source information.

Features

The server provides five main tools:

  1. list_sources: Lists all available sources with their URLs
  2. get_source_prompts: Gets sample prompts for a specific source
  3. list_prompts: Lists all available prompt templates
  4. get_prompts: Gets details of a specific prompt template
  5. vpc_lattice_cli: Execute AWS CLI VPC Lattice commands for managing VPC Lattice resources

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/amazon-vpc-lattice-mcp-server.git
    cd amazon-vpc-lattice-mcp-server

  2. Install dependencies:

    npm install

  3. Build the server:

    npm run build

Configuration

Add the server to your MCP settings file (located at ~/Library/Application Support/Code/User/globalStorage/asbx.amzn-cline/settings/cline_mcp_settings.json):

{
  "mcpServers": {
    "amazon-vpc-lattice-mcp": {
      "command": "node",
      "args": ["/path/to/amazon-vpc-lattice-mcp-server/build/index.js"],
      "disabled": false,
      "autoApprove": [],
      "env": {}
    }
  }
}

Usage

Once configured, you can use the MCP tools in your conversations:

List Sources

use_mcp_tool({
  server_name: "amazon-vpc-lattice-mcp",
  tool_name: "list_sources",
  arguments: {}
})

Get Source Prompts

use_mcp_tool({
  server_name: "amazon-vpc-lattice-mcp",
  tool_name: "get_source_prompts",
  arguments: {
    source_name: "AWS Documentation"
  }
})

List Prompts

use_mcp_tool({
  server_name: "amazon-vpc-lattice-mcp",
  tool_name: "list_prompts",
  arguments: {}
})

Get Prompt Details

use_mcp_tool({
  server_name: "amazon-vpc-lattice-mcp",
  tool_name: "get_prompts",
  arguments: {
    prompt_name: "EKS Controller Setup"
  }
})

VPC Lattice CLI

The vpc_lattice_cli tool provides a programmatic interface to AWS VPC Lattice operations through the AWS CLI.

Features

  • Supports all major VPC Lattice CLI operations
  • Accepts command arguments as JavaScript objects
  • Automatically converts camelCase parameters to CLI-style kebab-case
  • Handles boolean flags, arrays, and complex values
  • Supports AWS profiles and region configuration
  • Returns parsed JSON responses

Available Commands

  • Service Network: create-service-network, delete-service-network, get-service-network, list-service-networks, update-service-network
  • Service: create-service, delete-service, get-service, list-services, update-service
  • Listener: create-listener, delete-listener, get-listener, list-listeners, update-listener
  • Rule: create-rule, delete-rule, get-rule, list-rules, update-rule
  • Target Group: create-target-group, delete-target-group, get-target-group, list-target-groups, update-target-group
  • Target Management: register-targets, deregister-targets, list-targets
  • Resource Tags: list-tags-for-resource, tag-resource, untag-resource

Examples

List service networks:

use_mcp_tool({
  server_name: "amazon-vpc-lattice-mcp",
  tool_name: "vpc_lattice_cli",
  arguments: {
    command: "list-service-networks",
    region: "us-west-2"
  }
})

Create a service network:

use_mcp_tool({
  server_name: "amazon-vpc-lattice-mcp",
  tool_name: "vpc_lattice_cli",
  arguments: {
    command: "create-service-network",
    args: {
      name: "my-network",
      authType: "NONE"
    }
  }
})

Create a service with tags:

use_mcp_tool({
  server_name: "amazon-vpc-lattice-mcp",
  tool_name: "vpc_lattice_cli",
  arguments: {
    command: "create-service",
    args: {
      name: "my-service",
      serviceNetworkIdentifier: "sn-12345",
      tags: [
        { key: "Environment", value: "Production" }
      ]
    }
  }
})

Create a target group:

use_mcp_tool({
  server_name: "amazon-vpc-lattice-mcp",
  tool_name: "vpc_lattice_cli",
  arguments: {
    command: "create-target-group",
    args: {
      name: "my-target-group",
      type: "INSTANCE",
      config: {
        port: 80,
        protocol: "HTTP",
        healthCheck: {
          enabled: true,
          protocol: "HTTP",
          path: "/health"
        }
      }
    }
  }
})

Register targets:

use_mcp_tool({
  server_name: "amazon-vpc-lattice-mcp",
  tool_name: "vpc_lattice_cli",
  arguments: {
    command: "register-targets",
    args: {
      targetGroupIdentifier: "tg-12345",
      targets: [
        { id: "i-1234567890abcdef0", port: 80 }
      ]
    }
  }
})

Available Sources

The server includes these sources:

  1. AWS Documentation (docs.aws.amazon.com)
  2. GitHub Repo for AWS Gateway API Controller for VPC Lattice (aws/aws-application-networking-k8s)
  3. Kubernetes Gateway API (gateway-api.sigs.k8s.io)

Development

Project Structure

  • src/index.ts: Main server implementation
  • package.json: Project configuration and dependencies
  • tsconfig.json: TypeScript configuration
  • .gitignore: Git ignore rules

Available Prompts

The server includes these prompt templates:

  1. EKS Controller Setup
  2. Guide for setting up the AWS Application Networking Controller for Kubernetes
  3. Parameters: cluster_name, region, k8s_version

  4. EKS Controller Tests

  5. Run unit and integration tests for the AWS Application Networking Controller
  6. Parameters: test_type, test_suite, test_filter, verbosity
  7. Supports both unit tests and integration tests with e2e-clean

  8. EKS Controller Issue Solution

  9. Create solutions for GitHub issues with proper testing and PR creation
  10. Parameters: issue_number, branch_name
  11. Includes presubmit checks and draft PR creation

  12. Code Review

  13. Review code changes and provide feedback
  14. Parameters: code

  15. Bug Analysis

  16. Analyze error messages and suggest fixes
  17. Parameters: error, context

  18. Architecture Review

  19. Review system architecture and provide recommendations
  20. Parameters: design

  21. Documentation Generator

  22. Generate documentation for code or APIs
  23. Parameters: code

  24. Security Review

  25. Review code or architecture for security concerns
  26. Parameters: target

Adding New Sources

To add new sources, modify the sources array in src/index.ts:

const sources = [
  {
    name:  Your Source ,
    url:  https://your-source-url.com ,
    prompts: [
       Sample prompt 1 {placeholder} ,
       Sample prompt 2 {placeholder} 
    ]
  }
  // ... existing sources
];

Adding New Prompts

To add new prompt templates, modify the prompts array in src/index.ts:

const prompts = [
  {
    name:  Your Prompt Template ,
    description:  Description of what the prompt does ,
    template:  Your prompt template with {parameter} placeholders ,
    parameters: [ parameter ]
  }
  // ... existing prompts
];

Scripts

  • npm run build: Build the server
  • npm run watch: Watch mode for development

License

[Add your license information here]

[
  {
    "description": "List all available sources with their URLs and sample prompts",
    "inputSchema": {
      "additionalProperties": false,
      "properties": {},
      "type": "object"
    },
    "name": "list_sources"
  },
  {
    "description": "Get sample prompts for a specific source",
    "inputSchema": {
      "additionalProperties": false,
      "properties": {
        "source_name": {
          "description": "Name of the source to get prompts for",
          "type": "string"
        }
      },
      "required": [
        "source_name"
      ],
      "type": "object"
    },
    "name": "get_source_prompts"
  }
]