本项目是一个模型上下文协议(MCP)服务器,它能够提供来源列表、工具访问功能,还可用于管理AWS VPC网关资源及相关文档,为用户在AWS VPC网关的操作和管理上提供便利。
本服务器提供了五个主要工具,方便用户对来源和提示进行管理与操作:
list_sources):显示所有可用的来源。show_source):显示指定来源的详细信息,包括其URL和提示。search_prompts):根据关键词搜索所有可用的提示。show_prompt):显示特定提示的模板和参数。execute_prompt):使用指定来源和上下文执行给定的提示。git clone https://github.com/your-repository.git
cd amazon-vpc-lattice-mcp-server
npm install
npm run build
编辑 config.json 文件以配置您的设置:
{
"port": 3000,
"sources": [
{
"name": "AWS文档",
"url": "https://docs.aws.amazon.com",
"prompts": ["关键特性查询", "配置指南", "最佳实践"]
},
{
"name": "AWS网关API控制器",
"url": "https://github.com/aws/aws-application-networking-k8s",
"prompts": ["功能支持查询", "问题跟踪"]
}
]
}
curl http://localhost:3000/api/sources
curl http://localhost:3000/api/source/AWS文档
curl http://localhost:3000/api/prompts?search=错误排除
curl -X POST \
http://localhost:3000/api/prompt/创建目标组 \
-H "Content-Type: application/json" \
-d '{"context": "如何在VPC网关中创建目标组?", "source": "AWS文档"}'
该服务器包含以下来源:
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: '您的来源',
url: 'https://您的来源URL.com',
prompts: ['示例提示1 {占位符}', '示例提示2 {占位符}']
}
// ...现有来源
];
要添加新的提示模板,请修改 src/data/prompts.ts 中的 prompts 数组:
export const prompts = [
{
name: '您的提示模板',
description: '描述该提示的作用',
template: '您的提示模板,带有 {参数} 占位符',
parameters: ['参数']
}
// ...现有提示
];
npm run build:构建服务器并设置可执行权限npm run watch:开发模式运行npm test:运行测试(目前尚未实现)