aws-mcp-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAWS MCP Server Configuration Guide
AWS MCP服务器配置指南
Overview
概述
This guide helps you configure AWS MCP tools for AI agents. Two options are available:
| Option | Requirements | Capabilities |
|---|---|---|
| Full AWS MCP Server | Python 3.10+, uvx, AWS credentials | Execute AWS API calls + documentation search |
| AWS Documentation MCP | None | Documentation search only |
本指南帮助你为AI Agent配置AWS MCP工具。提供两种选项:
| 选项 | 要求 | 功能 |
|---|---|---|
| 完整AWS MCP服务器 | Python 3.10+、uvx、AWS凭证 | 执行AWS API调用 + 文档搜索 |
| AWS Documentation MCP | 无 | 仅文档搜索 |
Step 1: Check Existing Configuration
步骤1:检查现有配置
Before configuring, check if AWS MCP tools are already available using either method:
在配置之前,可通过以下任一方法检查AWS MCP工具是否已可用:
Method A: Check Available Tools (Recommended)
方法A:检查可用工具(推荐)
Look for these tool name patterns in your agent's available tools:
- or
mcp__aws-mcp__*→ Full AWS MCP Server configuredmcp__aws__* - → AWS Documentation MCP configured
mcp__*awsdocs*__aws___*
How to check: Run command to list all active MCP servers.
/mcp在Agent的可用工具中查找以下工具名称模式:
- 或
mcp__aws-mcp__*→ 已配置完整AWS MCP服务器mcp__aws__* - → 已配置AWS Documentation MCP
mcp__*awsdocs*__aws___*
检查方式:运行命令列出所有活跃的MCP服务器。
/mcpMethod B: Check Configuration Files
方法B:检查配置文件
Agent tools use hierarchical configuration (precedence: local → project → user → enterprise):
| Scope | File Location | Use Case |
|---|---|---|
| Local | | Personal/experimental |
| Project | | Team-shared |
| User | | Cross-project personal |
| Enterprise | System managed directories | Organization-wide |
Check these files for containing , , or keys:
mcpServersaws-mcpawsawsdocsbash
undefinedAgent工具使用分层配置(优先级:本地 → 项目 → 用户 → 企业):
| 范围 | 文件位置 | 使用场景 |
|---|---|---|
| 本地 | 项目中的 | 个人/实验用途 |
| 项目 | 项目根目录的 | 团队共享 |
| 用户 | | 跨项目个人配置 |
| 企业 | 系统管理目录 | 组织范围配置 |
检查这些文件中是否包含带有、或键的:
aws-mcpawsawsdocsmcpServersbash
undefinedCheck project config
检查项目配置
cat .mcp.json 2>/dev/null | grep -E '"(aws-mcp|aws|awsdocs)"'
cat .mcp.json 2>/dev/null | grep -E '"(aws-mcp|aws|awsdocs)"'
Check user config
检查用户配置
cat ~/.claude.json 2>/dev/null | grep -E '"(aws-mcp|aws|awsdocs)"'
cat ~/.claude.json 2>/dev/null | grep -E '"(aws-mcp|aws|awsdocs)"'
Or use Claude CLI
或使用Claude CLI
claude mcp list
If AWS MCP is already configured, no further setup needed.claude mcp list
如果AWS MCP已配置,则无需进一步设置。Step 2: Choose Configuration Method
步骤2:选择配置方法
Automatic Detection
自动检测
Run these commands to determine which option to use:
bash
undefined运行以下命令确定要使用的选项:
bash
undefinedCheck for uvx (requires Python 3.10+)
检查uvx是否可用(需要Python 3.10+)
which uvx || echo "uvx not available"
which uvx || echo "uvx not available"
Check for valid AWS credentials
检查AWS凭证是否有效
aws sts get-caller-identity || echo "AWS credentials not configured"
undefinedaws sts get-caller-identity || echo "AWS credentials not configured"
undefinedOption A: Full AWS MCP Server (Recommended)
选项A:完整AWS MCP服务器(推荐)
Use when: uvx available AND AWS credentials valid
Prerequisites:
- Python 3.10+ with package manager
uv - AWS credentials configured (via profile, environment variables, or IAM role)
Required IAM Permissions:
json
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"aws-mcp:InvokeMCP",
"aws-mcp:CallReadOnlyTool",
"aws-mcp:CallReadWriteTool"
],
"Resource": "*"
}]
}Configuration (add to your MCP settings):
json
{
"mcpServers": {
"aws-mcp": {
"command": "uvx",
"args": [
"mcp-proxy-for-aws@latest",
"https://aws-mcp.us-east-1.api.aws/mcp",
"--metadata", "AWS_REGION=us-west-2"
]
}
}
}Credential Configuration Options:
-
AWS Profile (recommended for development):json
"args": [ "mcp-proxy-for-aws@latest", "https://aws-mcp.us-east-1.api.aws/mcp", "--profile", "my-profile", "--metadata", "AWS_REGION=us-west-2" ] -
Environment Variables:json
"env": { "AWS_ACCESS_KEY_ID": "...", "AWS_SECRET_ACCESS_KEY": "...", "AWS_REGION": "us-west-2" } -
IAM Role (for EC2/ECS/Lambda): No additional config needed - uses instance credentials
Additional Options:
- : Override AWS region
--region <region> - : Restrict to read-only tools
--read-only - : Set logging level (debug, info, warning, error)
--log-level <level>
Reference: https://github.com/aws/mcp-proxy-for-aws
适用场景:已安装uvx且AWS凭证有效
前置条件:
- 带有包管理器的Python 3.10+
uv - 已配置AWS凭证(通过配置文件、环境变量或IAM角色)
所需IAM权限:
json
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"aws-mcp:InvokeMCP",
"aws-mcp:CallReadOnlyTool",
"aws-mcp:CallReadWriteTool"
],
"Resource": "*"
}]
}配置(添加到你的MCP设置中):
json
{
"mcpServers": {
"aws-mcp": {
"command": "uvx",
"args": [
"mcp-proxy-for-aws@latest",
"https://aws-mcp.us-east-1.api.aws/mcp",
"--metadata", "AWS_REGION=us-west-2"
]
}
}
}凭证配置选项:
-
AWS配置文件(推荐用于开发环境):json
"args": [ "mcp-proxy-for-aws@latest", "https://aws-mcp.us-east-1.api.aws/mcp", "--profile", "my-profile", "--metadata", "AWS_REGION=us-west-2" ] -
环境变量:json
"env": { "AWS_ACCESS_KEY_ID": "...", "AWS_SECRET_ACCESS_KEY": "...", "AWS_REGION": "us-west-2" } -
IAM角色(适用于EC2/ECS/Lambda):无需额外配置 - 使用实例凭证
附加选项:
- :覆盖AWS区域
--region <region> - :限制为只读工具
--read-only - :设置日志级别(debug、info、warning、error)
--log-level <level>
Option B: AWS Documentation MCP Server (No Auth)
选项B:AWS Documentation MCP服务器(无需认证)
Use when:
- No Python/uvx environment
- No AWS credentials
- Only need documentation search (no API execution)
Configuration:
json
{
"mcpServers": {
"awsdocs": {
"type": "http",
"url": "https://knowledge-mcp.global.api.aws"
}
}
}适用场景:
- 无Python/uvx环境
- 无AWS凭证
- 仅需文档搜索(无需执行API)
配置:
json
{
"mcpServers": {
"awsdocs": {
"type": "http",
"url": "https://knowledge-mcp.global.api.aws"
}
}
}Step 3: Verification
步骤3:验证
After configuration, verify tools are available:
For Full AWS MCP:
- Look for tools: ,
mcp__aws-mcp__aws___search_documentationmcp__aws-mcp__aws___call_aws
For Documentation MCP:
- Look for tools: ,
mcp__awsdocs__aws___search_documentationmcp__awsdocs__aws___read_documentation
配置完成后,验证工具是否可用:
对于完整AWS MCP:
- 查找工具:、
mcp__aws-mcp__aws___search_documentationmcp__aws-mcp__aws___call_aws
对于Documentation MCP:
- 查找工具:、
mcp__awsdocs__aws___search_documentationmcp__awsdocs__aws___read_documentation
Troubleshooting
故障排除
| Issue | Cause | Solution |
|---|---|---|
| uv not installed | Install with |
| Missing IAM permissions | Add aws-mcp:* permissions to IAM policy |
| Credential issue | Check |
| Tools not appearing | MCP not started | Restart your agent after config change |
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 未安装uv | 使用 |
| 缺少IAM权限 | 为IAM策略添加 |
| 凭证问题 | 检查 |
| 工具未显示 | MCP未启动 | 修改配置后重启你的Agent |