AWS SAM
MCP Tools
- sam_init - Create new SAM app
- sam_build - Build SAM app
- sam_deploy - Deploy SAM app
- sam_logs - Fetch deployed app logs
- sam_local_invoke - Locally invoke Lambda function
Project Structure
├── infrastructure/
│ ├── cloudformation/
│ └── lambda/
│ └── api/
│ ├── app.py
│ └── requirements.txt
└── template.yaml
Key Rules
- ALWAYS use SAM resource types (AWS::Serverless::Function, etc.)
- ALWAYS use Lambda Powertools via Layers, NEVER add to dependencies
- ALWAYS use version locking for dependencies
- ALWAYS create separate Lambda functions for each API
- Do NOT add boto3/botocore to dependencies (included in runtime)
- Use SAM policy templates for IAM permissions
- Add
.aws-samto.gitignore
Create New App Workflow
- sam_init with chosen runtime
- Restructure: move functions to
infrastructure/lambda/ - Update CodeUri paths in template.yaml
- sam_build to verify
MCP Server Config
{
"mcpServers": {
"aws-sam": {
"command": "uvx",
"args": ["awslabs.aws-serverless-mcp-server@latest"],
"env": {
"AWS_PROFILE": "default",
"AWS_REGION": "us-east-1"
}
}
}
}
Prerequisites: SAM CLI installed, optionally Docker/Finch.