Amazon VPC Lattice MCP 服务器
用于源列表的模型上下文协议 (MCP) 服务器,提供访问和管理 AWS VPC Lattice 资源和相关文档的工具。
特征
该服务器提供五个主要工具:
list_sources:列出所有可用来源及其 URL 和示例提示get_source_prompts:获取特定源的示例提示list_amazon_vpc_lattice_prompts:列出所有可用的提示模板get_amazon_vpc_lattice_prompts:获取特定提示模板的详细信息vpc_lattice_cli:执行 AWS CLI VPC Lattice 命令来管理 VPC Lattice 资源
Related MCP server: Log Analyzer with MCP
安装
该项目使用 TypeScript 构建并使用 ES 模块。
克隆存储库:
git clone https://github.com/awslabs/amazon-vpc-lattice-mcp-server.git
cd amazon-vpc-lattice-mcp-server安装依赖项:
npm install构建服务器:
npm run build构建脚本将编译 TypeScript 代码并设置适当的可执行权限。
配置
将服务器添加到您的 MCP 设置文件(位于~/Library/Application Support/Code/User/globalStorage/asbx.amzn-cline/settings/cline_mcp_settings.json ):
{
"mcpServers": {
"amazon-vpc-lattice": {
"command": "node",
"args": ["/path/to/amazon-vpc-lattice-mcp-server/build/index.js"],
"disabled": false,
"autoApprove": [],
"env": {}
}
}
}用法
配置完成后,您就可以在对话中使用 MCP 工具了。请注意,您应该使用list_amazon_vpc_lattice_prompts来发现可用的提示,因为这些提示不像其他工具那样可以自动发现。
列出来源
use_mcp_tool({
server_name: "amazon-vpc-lattice",
tool_name: "list_sources",
arguments: {}
})获取源提示
use_mcp_tool({
server_name: "amazon-vpc-lattice",
tool_name: "get_source_prompts",
arguments: {
source_name: "AWS Documentation"
}
})列出 Amazon VPC Lattice 提示
use_mcp_tool({
server_name: "amazon-vpc-lattice",
tool_name: "list_amazon_vpc_lattice_prompts",
arguments: {}
})获取 Amazon VPC Lattice Prompt 详细信息
use_mcp_tool({
server_name: "amazon-vpc-lattice",
tool_name: "get_amazon_vpc_lattice_prompts",
arguments: {
prompt_name: "setup_eks_controller"
}
})VPC Lattice CLI
vpc_lattice_cli工具通过 AWS CLI 为 AWS VPC Lattice 操作提供编程接口。
特征
支持所有主要的 VPC Lattice CLI 操作
接受命令参数作为 JavaScript 对象
自动将 camelCase 参数转换为 CLI 风格的 kebab-case
处理布尔标志、数组和复数值
支持 AWS 配置文件和区域配置
返回已解析的 JSON 响应
可用命令
服务网络:创建服务网络、删除服务网络、获取服务网络、列出服务网络、更新服务网络
服务:创建服务、删除服务、获取服务、列出服务、更新服务
监听器:创建监听器、删除监听器、获取监听器、列出监听器、更新监听器
规则:创建规则、删除规则、获取规则、列出规则、更新规则
目标组:创建目标组、删除目标组、获取目标组、列出目标组、更新目标组
目标管理:注册目标、取消注册目标、列出目标
资源标签:list-tags-for-resource、tag-resource、untag-resource
示例
列出服务网络:
use_mcp_tool({
server_name: "amazon-vpc-lattice",
tool_name: "vpc_lattice_cli",
arguments: {
command: "list-service-networks",
region: "us-west-2"
}
})建立服务网络:
use_mcp_tool({
server_name: "amazon-vpc-lattice",
tool_name: "vpc_lattice_cli",
arguments: {
command: "create-service-network",
args: {
name: "my-network",
authType: "NONE"
}
}
})创建带有标签的服务:
use_mcp_tool({
server_name: "amazon-vpc-lattice",
tool_name: "vpc_lattice_cli",
arguments: {
command: "create-service",
args: {
name: "my-service",
serviceNetworkIdentifier: "sn-12345",
tags: [
{ key: "Environment", value: "Production" }
]
}
}
})创建目标组:
use_mcp_tool({
server_name: "amazon-vpc-lattice",
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"
}
}
}
}
})可用资源
该服务器包括以下来源:
AWS 文档 (docs.aws.amazon.com)
主要功能查询
配置指南
最佳实践
适用于 VPC Lattice 的 AWS 网关 API 控制器 (aws/aws-application-networking-k8s)
功能支持查询
问题跟踪
Kubernetes 网关 API(gateway-api.sigs.k8s.io)
错误解决
最佳实践指南
发展
项目结构
该项目组织如下:
src/index.ts:主服务器设置和初始化src/tools.ts:工具定义和处理程序src/data/:数据文件prompts.ts:提示模板和参数sources.ts:源定义及其提示
package.json:项目配置和依赖项tsconfig.json:TypeScript 配置.gitignore:Git 忽略规则build/:编译后的 JavaScript 输出
添加新来源
要添加新源,请修改src/data/sources.ts中的sources数组:
export const sources = [
{
name: 'Your Source',
url: 'https://your-source-url.com',
prompts: [
'Sample prompt 1 {placeholder}',
'Sample prompt 2 {placeholder}'
]
}
// ... existing sources
];添加新提示
要添加新的提示模板,请修改src/data/prompts.ts中的prompts数组:
export const prompts = [
{
name: 'Your Prompt Template',
description: 'Description of what the prompt does',
template: 'Your prompt template with {parameter} placeholders',
parameters: ['parameter']
}
// ... existing prompts
];脚本
npm run build:构建服务器并设置可执行权限npm run watch:用于开发的监视模式npm test:运行测试(目前尚未实现)
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.