参考资料
- https://aws.amazon.com/cn/blogs/containers/accelerating-application-development-with-the-amazon-eks-model-context-protocol-server/
在vscode中安装cline后,为了避免高额模型费用和兼容性问题,通过litellm封装了自部署模型,并配置在cline中
http://litellm.example.com:4000
TLDR
日常万能配置如下
{"mcpServers": {"awslabs.aws-api-mcp-server": {"disabled": true,"timeout": 60,"type": "stdio","command": "docker","args": ["run","--rm","--interactive","--env","AWS_REGION=cn-north-1","--volume","/home/ec2-user/.aws:/app/.aws","public.ecr.aws/awslabs-mcp/awslabs/aws-api-mcp-server:latest"],"env": {}},"awslabs.aws-documentation-mcp-server": {"autoApprove": ["read_documentation","search_documentation","recommend","get_available_services"],"disabled": true,"timeout": 60,"type": "stdio","command": "docker","args": ["run","--rm","--interactive","--env","FASTMCP_LOG_LEVEL=ERROR","--env","AWS_DOCUMENTATION_PARTITION=aws-cn","mcp/aws-documentation:latest"],"env": {}},"aws-knowledge-mcp-server": {"autoApprove": ["aws___search_documentation","aws___read_documentation","aws___recommend"],"disabled": true,"timeout": 60,"type": "stdio","command": "uvx","args": ["fastmcp","run","https://knowledge-mcp.global.api.aws"]},"github.com/tavily-ai/tavily-mcp": {"autoApprove": [],"disabled": true,"timeout": 60,"type": "stdio","command": "npx","args": ["-y","tavily-mcp@latest"],"env": {"TAVILY_API_KEY": "tvly-dev-ecexxxxxxxxxxK"}},"web-search": {"timeout": 60,"type": "streamableHttp","url": "http://localhost:3000/mcp","autoApprove": ["search"]},"web-search-sse": {"timeout": 60,"type": "sse","url": "http://localhost:3000/sse","autoApprove": ["search"]}}
}
在线文档助手
使用如下mcp server配置,kb文档查询,document文档查询的功能,可以满足服务特性的答疑和总结功能。
{"mcpServers": {"awslabs.aws-documentation-mcp-server": {"autoApprove": ["read_documentation","search_documentation","recommend","get_available_services"],"disabled": false,"timeout": 60,"type": "stdio","command": "docker","args": ["run","--rm","--interactive","--env","FASTMCP_LOG_LEVEL=ERROR","--env","AWS_DOCUMENTATION_PARTITION=aws-cn","mcp/aws-documentation:latest"],"env": {}},"aws-knowledge-mcp-server": {"autoApprove": ["aws___search_documentation","aws___read_documentation","aws___recommend"],"disabled": false,"timeout": 60,"type": "stdio","command": "uvx","args": ["fastmcp","run","https://knowledge-mcp.global.api.aws"]}}
}
资源检索工具
如果需要查询账户资源,可以集成api mcp,cline会使用awscli工具查询具体的资源
{"mcpServers": {"awslabs.aws-api-mcp-server": {"timeout": 60,"type": "stdio","command": "docker","args": ["run","--rm","--interactive","--env","AWS_REGION=cn-north-1","--volume","/home/ec2-user/.aws:/app/.aws","public.ecr.aws/awslabs-mcp/awslabs/aws-api-mcp-server:latest"],"env": {},"disabled": true}
}
成本和定价助手
- https://awslabs.github.io/mcp/servers/aws-pricing-mcp-server
- https://awslabs.github.io/mcp/servers/billing-cost-management-mcp-server
- https://awslabs.github.io/mcp/servers/cost-explorer-mcp-server
比较常用的是查看账户中钱花在哪了
{"mcpServers": {"awslabs.billing-cost-management-mcp-server": {"command": "docker","args": ["run","--rm","--interactive","--env","FASTMCP_LOG_LEVEL=ERROR","awslabs/billing-cost-management-mcp-server:latest"],"env": {},"disabled": false,"autoApprove": []}}
}
特定领域工具
个人习惯还是倾向于手动维护资源,类似cdk等mcp操作过于繁琐不容易理解具体的内容,后续的trouble shooting反而费事。
对于一些重复性的但是比较简单的服务,可以考虑类似如下的iam-mcp-server,用来分析现有用户策略,进行安全性测试很方便
{"mcpServers": {"awslabs.iam-mcp-server": {"command": "uvx","args": ["awslabs.iam-mcp-server@latest","--readonly"],"env": {"AWS_PROFILE": "default","AWS_REGION": "cn-north-1","FASTMCP_LOG_LEVEL": "ERROR"}}}
}
使用support_mcp_server来更方便获取支持
{"mcpServers": {"awslabs_support_mcp_server": {"command": "uvx","args": ["-m", "awslabs.aws-support-mcp-server@latest","--debug","--log-file","./logs/mcp_support_server.log"],"env": {"AWS_PROFILE": "default"}}}
}
搜索功能
tavily需要申请apikey,一个月1000次免费额度
"github.com/tavily-ai/tavily-mcp": {"command": "npx","args": ["-y","tavily-mcp@latest"],"env": {"TAVILY_API_KEY": "tvly-xxxxxxxxxxx"},"disabled": false,"autoApprove": []}
自行部署open-web-search
docker run -d --name web-search -p 3000:3000 \-e ENABLE_CORS=true \-e CORS_ORIGIN=* \ghcr.io/aas-ee/open-web-search:latest
mcp配置如下
"web-search": {"timeout": 60,"type": "streamableHttp","url": "http://localhost:3000/mcp","autoApprove": ["search"]
},
"web-search-sse": {"timeout": 60,"type": "sse","url": "http://localhost:3000/sse","autoApprove": ["search"]
}