Skip to content

AWS MCP Integration

Add the AWS Documentation MCP server to your cloud-ops agent so Kiro CLI can search and read AWS documentation automatically.

Prerequisite: Complete Custom Agents and MCP Overview. The uvx command requires uv — see the prerequisite callout in MCP Servers.

Edit the agent JSON with /agent edit or your editor:

Terminal window
vi ~/.kiro/agents/cloud-ops.json

Parts to modify:

  1. Replace "mcpServers": {} with the MCP server block below
  2. Add four @awslabs... entries to the allowedTools array
"mcpServers": {
"awslabs.aws-documentation-mcp-server": {
"command": "uvx",
"args": ["awslabs.aws-documentation-mcp-server@latest"],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR",
"AWS_DOCUMENTATION_PARTITION": "aws"
}
}
}
"allowedTools": [
"fs_read",
"fs_write",
"execute_bash",
"use_aws",
"web_fetch",
"web_search",
"@awslabs.aws-documentation-mcp-server/read_documentation",
"@awslabs.aws-documentation-mcp-server/search_documentation",
"@awslabs.aws-documentation-mcp-server/recommend",
"@awslabs.aws-documentation-mcp-server/read_sections"
]

If editor-based editing is difficult, overwrite the entire file:

Terminal window
cat > ~/.kiro/agents/cloud-ops.json << 'EOF'
{
"name": "cloud-ops",
"description": "AWS cloud operations dedicated agent",
"prompt": "You are an AWS cloud operations expert.",
"mcpServers": {
"awslabs.aws-documentation-mcp-server": {
"command": "uvx",
"args": ["awslabs.aws-documentation-mcp-server@latest"],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR",
"AWS_DOCUMENTATION_PARTITION": "aws"
}
}
},
"tools": ["*"],
"allowedTools": [
"fs_read",
"fs_write",
"execute_bash",
"use_aws",
"web_fetch",
"web_search",
"@awslabs.aws-documentation-mcp-server/read_documentation",
"@awslabs.aws-documentation-mcp-server/search_documentation",
"@awslabs.aws-documentation-mcp-server/recommend",
"@awslabs.aws-documentation-mcp-server/read_sections"
],
"resources": [],
"hooks": {},
"model": null
}
EOF

Adding MCP tools to allowedTools allows documentation searches to run automatically without needing approval each time.

Restart Kiro CLI:

Terminal window
kiro-cli chat --agent cloud-ops

Inside the session:

/mcp
/tools

Confirm the AWS Documentation MCP server appears and its tools are listed.

Search the AWS documentation for scaling policies in Amazon EC2 Auto Scaling

Since the search tools are registered in allowedTools, they run immediately without an approval request.

Step 4: Custom MCP Prompt Server (Optional)

Section titled “Step 4: Custom MCP Prompt Server (Optional)”

This step is optional — it demonstrates MCP Prompts, not required for the rest of the guide.

Create a project and write the MCP server code:

Terminal window
mkdir -p ~/mcp-prompts && cd ~/mcp-prompts
uv init && uv add mcp "mcp[cli]"
Terminal window
cat > ~/mcp-prompts/mcp-server.py << 'EOF'
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("MyPromptServer")
@mcp.prompt()
def cloud_diagnosis() -> str:
"""Checklist prompt for AWS infrastructure diagnostics"""
return """Please diagnose the AWS infrastructure in the following order:
1. Check EC2 instance status
2. Review Security Group rules
3. Verify VPC routing tables
4. Check CloudWatch alarms
"""
EOF

Add MyPromptServer to the mcpServers section in ~/.kiro/agents/cloud-ops.json:

"MyPromptServer": {
"command": "uv",
"args": ["--directory", "$HOME/mcp-prompts", "run", "--with", "mcp", "mcp", "run", "mcp-server.py"]
}

Restart the agent and list prompts:

/prompts list

An UnauthorizedOperation error may occur when running @cloud_diagnosis without AWS permissions — that is expected. The prompt loading and execution attempt confirms successful MCP Prompt server configuration.

You have completed this step if you have confirmed all of the following:

  1. AWS Documentation MCP server loaded (confirmed with /mcp)
  2. Documentation search tools visible in /tools
  3. AWS documentation search runs without approval prompt
  4. (Optional) @cloud_diagnosis prompt loads from custom MCP Prompt server

Next: Hooks and Permissions — automate context injection and fine-grained tool control.