Token导航 LogoToken导航TokenDH.com
Sample Ecs MCP Server logo
AI代理未说明官方级别未说明来源级核验

Sample Ecs MCP Server

MCP Server

一个使用AWS Fargate和Amazon ECS部署代理AI架构的工具,支持与MCP服务器通信和执行数学计算等任务。

工具数

0

提示词数

0

GitHub Stars

3

资源数

0
AI代理TypeScriptClaude数学计算Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

aws-samples

提供方

aws-samples

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

ECS MCP服务器示例

以下示例演示了如何使用AWS Fargate for Amazon ECS部署代理AI架构。使用 AWS CDK 部署架构组件。

高级体系结构

high-level-architecture

详情

该架构由以下组件组成:

  • 应用程序负载平衡器:接收传入的API调用并将其转发到AI服务
  • 人工智能服务:与两个MCP服务器连接以执行操作的简单AI代理
  • MCP服务器二:它承载现有的MCP服务器(AWS API MCP服务器).为了这个例子,此MCP服务器的角色仅限于在您的帐户中列出AWS Bucket

AWS Fargate服务之间的服务到服务通信是使用 服务连接The 人工智能服务 利用自定义DNS名称连接到此示例中可用的MCP服务器。

该示例还生成了一个AWS Secret,用作 x-api-key 调用应用程序负载平衡器URL时使用header。

先决条件

  • 安装在本地计算机上(版本>=20)
  • 码头工人 安装在您的计算机中
  • AWS-CLI 在本地计算机中配置
  • 基岩模型访问 到您帐户中配置的Anthropic Claude Sonnet 4

入门

要在您的帐户中部署此示例,请按照以下说明操作:

# install dependencies
$ npm install
# login to the public ECR registry to allow download base images
$ aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
# bootstrap your AWS environment (in case you haven't done it yet)
$ npm run cdk bootstrap
# deploy the CDK Stack into your account
$ npm run cdk deploy

测试

在您的帐户中完成部署后,您将从AWS CDK获得以下输出:

 ✅  EcsMcpServerSampleStack

✨  Deployment time: 362.32s

Outputs:
EcsMcpServerSampleStack.ALBLoadBalancerDNS6ED38D87 = [application-load-balancer-url]
EcsMcpServerSampleStack.AiServiceSecretARN2FB050DB = [secret-arn]

在调用应用程序负载平衡器URL之前,您需要使用以下命令检索密钥值:

$ aws secretsmanager get-secret-value --secret-id [secret-arn]
# or use the following to directly get the value
$ aws secretsmanager get-secret-value --secret-id [secret-arn] --output json | jq -r '.SecretString'

现在您已经掌握了所有信息,您可以调用应用程序负载均衡器URL来测试代理:

curl --location 'http://[ALB-URL]/chat' \
--header 'x-api-key: [secret-value]' \
--header 'Content-Type: application/json' \
--data '{
    "prompt": "what'\''s the command to list AWS Buckets"
}'
{
  "answer": "The command to list AWS S3 buckets is:\n\n```bash\naws s3 ls\n```\n\nThis command will display all S3 buckets in your AWS account, showing:\n- Creation date and time\n- Bucket name\n\nAs you can see from the output, it lists all the buckets with their creation timestamps and names. The command works across all regions and shows buckets from your entire AWS account.\n"
}

或执行AWS CLI命令:

curl --location 'http://[ALB-URL]/chat' \
--header 'x-api-key: [secret-value]' \
--header 'Content-Type: application/json' \
--data '{
    "prompt": "list all my AWS Buckets"
}'
{
  "answer": "Here are all your S3 buckets: [omissis]"
}

或者使用 自定义MCP服务器:

curl --location 'http://[ALB-URL]/chat' \
--header 'x-api-key: [secret-value]' \
--header 'Content-Type: application/json' \
--data '{
    "prompt": "what'\''s 2+2"
}'
{
  "answer": "2 + 2 = **4**\n"
}

安全

贡献 了解更多信息。

许可证

此库根据MIT-0许可证获得许可。请参阅LICENSE文件。

目录标签

目录标签

AI代理TypeScriptClaude数学计算本地部署AWSFargateMCP服务器服务部署

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明api-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP