@cloudagent/aws-deploy v1.0.2
Amplify Deploy
One-click deployment from your IDE to AWS Amplify. Deploy your web applications without leaving your code editor!
Features
- π One-Click Deployment: Deploy to AWS Amplify with a single command
- π€ AI-Powered: Integrates with Cursor IDE via MCP (Model Context Protocol)
- π§ Zero Config: Automatically detects framework and generates build settings
- π Secure: Uses AWS IAM and GitHub OAuth for authentication
- π¦ Framework Support: React, Next.js, Vue, Angular, and static sites
- π Local or SaaS: Run locally with your AWS account or use our managed service (coming soon)
- β‘ Environment Variables: Automatically syncs .env files during deployment with smart filtering
Quick Start
# Run the setup wizard
npx @cloudagent/aws-deploy setup
# Start the MCP server
npx @cloudagent/aws-deploy start
# Or deploy directly from CLI
npx @cloudagent/aws-deploy deploy
Installation
Prerequisites
- Node.js 18+
- Git
- AWS CLI (for local mode)
- AWS Account (for local mode)
- GitHub Account
Setup
Run the setup wizard:
npx @cloudagent/aws-deploy setup
Follow the interactive setup to configure:
- AWS credentials
- GitHub authentication
- Deployment mode (local/SaaS)
Start the MCP server:
npx @cloudagent/aws-deploy start
Configure your IDE (Cursor) to connect to
http://localhost:3456
Usage
In Cursor IDE
Once the MCP server is running, you can use natural language commands:
- "Deploy this project to AWS Amplify"
- "Check my deployment status"
- "Generate amplify config"
- "Check prerequisites"
Important: The AI will ask for your project's absolute path to ensure deployment from the correct directory. For best results, open your project folder in Cursor before requesting deployment.
File Paths with Spaces: Use literal spaces in file paths (e.g., /Users/username/My Project
), not URL-encoded paths (e.g., /Users/username/My%20Project
).
For AI Developers: See AI_AGENT_GUIDE.md for detailed guidance on using the MCP tools effectively.
CLI Commands
# Initialize in a project
aws-deploy init
# Start MCP server
aws-deploy start [--port 3456] [--mode local|saas]
# Deploy directly
aws-deploy deploy [--name myapp] [--branch main] [--region us-east-1]
# Check all prerequisites and project readiness
aws-deploy check [--path /path/to/project]
# Validate project structure only
aws-deploy validate [--path /path/to/project]
# Check deployment status
aws-deploy status --app <appId>
# Run setup wizard
aws-deploy setup
How It Works
- Project Detection: Automatically detects your framework (React, Next.js, Vue, etc.)
- Config Generation: Creates optimized
amplify.yml
build configuration - GitHub Integration: Ensures your code is in a GitHub repository
- AWS Amplify: Creates and configures an Amplify app
- Deployment: Triggers build and deployment
- Monitoring: Tracks deployment progress and returns your live URL
Configuration
AWS Credentials
The tool supports multiple ways to provide AWS credentials, in order of priority:
1. Environment Variables (Recommended)
Set these environment variables in your shell:
export AWS_ACCESS_KEY_ID="your-access-key-id"
export AWS_SECRET_ACCESS_KEY="your-secret-access-key"
export AWS_REGION="us-east-1" # Optional, defaults to us-east-1
# For temporary credentials (STS/SSO)
export AWS_SESSION_TOKEN="your-session-token"
2. MCP Server Configuration (For Cursor Users)
Add credentials to your ~/.cursor/mcp.json
:
{
"mcpServers": {
"amplify-deploy": {
"command": "node",
"args": ["/path/to/amplify-deploy.js", "start", "--stdio"],
"env": {
"AWS_ACCESS_KEY_ID": "your-access-key-id",
"AWS_SECRET_ACCESS_KEY": "your-secret-access-key",
"AWS_REGION": "us-east-1",
"GITHUB_TOKEN": "your-github-personal-access-token"
}
}
}
}
3. AWS CLI Profile
aws configure
GitHub Setup (AWS Amplify GitHub App)
AWS Amplify now requires the GitHub App approach for new deployments. This is a 2-step process:
Step 1: Choose Your AWS Region
First, decide which AWS region you'll deploy to:
- US East (N. Virginia):
us-east-1
β (recommended if unsure) - US West (Oregon):
us-west-2
- EU (Ireland):
eu-west-1
- EU (Frankfurt):
eu-central-1
- Asia Pacific (Sydney):
ap-southeast-2
- Asia Pacific (Tokyo):
ap-northeast-1
Step 2: Install AWS Amplify GitHub App for Your Region
The GitHub App installation is region-specific. Use the URL for your chosen region:
Region | GitHub App Installation URL |
---|---|
us-east-1 | https://github.com/apps/aws-amplify-us-east-1/installations/new |
us-west-2 | https://github.com/apps/aws-amplify-us-west-2/installations/new |
eu-west-1 | https://github.com/apps/aws-amplify-eu-west-1/installations/new |
eu-central-1 | https://github.com/apps/aws-amplify-eu-central-1/installations/new |
ap-southeast-2 | https://github.com/apps/aws-amplify-ap-southeast-2/installations/new |
ap-northeast-1 | https://github.com/apps/aws-amplify-ap-northeast-1/installations/new |
Installation steps: 1. Open the URL for your chosen region 2. Select repositories you want to deploy (or "All repositories") 3. Click "Install"
Step 3: Create Personal Access Token
- Create Token: Go to GitHub Settings > Tokens
- Token Type: Select "Tokens (classic)" - NOT fine-grained tokens
- Description: "AWS Amplify Deploy Access"
- Scopes: Select
admin:repo_hook
(Repository webhook and hook administration) - Generate: Click "Generate token" and copy it
Add to MCP Configuration:
"env": {
"GITHUB_TOKEN": "your-github-token-here"
}
Or set as environment variable:
export GITHUB_TOKEN="your-github-token-here"
Requirements:
- β GitHub App installed for your AWS region
- β
Classic token (starts with
ghp_
) - β
admin:repo_hook
scope (notrepo
) - β Fine-grained tokens will NOT work
Getting AWS Credentials
- Go to AWS Console β IAM β Users β Your User β Security credentials
- Click "Create access key"
- Copy the Access Key ID and Secret Access Key
- Set environment variables or configure AWS CLI
For better security, consider using:
- AWS SSO for temporary credentials
- AWS STS for assume role scenarios
- IAM roles for EC2/container deployments
amplify.yml
The tool automatically generates an amplify.yml
file based on your project type. You can customize it:
version: 1
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
Project Configuration
Create .amplify-deploy.json
in your project root:
{
"appName": "my-custom-app-name",
"region": "eu-west-1",
"branch": "production"
}
Deployment Modes
Local Mode (Default)
- Uses your AWS credentials
- Deploys to your AWS account
- Full control over resources
- No external dependencies
SaaS Mode (Coming Soon)
- No AWS account needed
- Managed deployments
- Simplified authentication
- Usage-based pricing
Security
- GitHub tokens are stored in system keychain (via keytar)
- AWS credentials use standard AWS CLI configuration
- No credentials are sent to external services in local mode
- All communications are encrypted
Troubleshooting
Common Issues
"AWS credentials not found"
aws configure
"Git repository not initialized"
git init git remote add origin https://github.com/username/repo.git
"No amplify.yml found"
- Run
amplify-deploy init
or let the tool auto-generate one
- Run
"GitHub authentication failed"
- Ensure your token has
repo
scope - Try creating a new token via setup wizard
- Run comprehensive check:
amplify-deploy check
- Ensure your token has
"Unable to determine project directory" or "Looking at root directory (/)"
When using Cursor, the MCP server might not detect your project directory correctly. Solutions:
Method 1: Open project folder in Cursor
# Make sure you open your project folder, not individual files cursor /path/to/your/project
Method 2: Set environment variable
export AMPLIFY_PROJECT_PATH="/path/to/your/project" # Then restart Cursor
Method 3: Specify path in the request
Deploy my project to AWS Amplify using project_path="/path/to/my/project"
Debug Mode
# Run with debug logging
DEBUG=aws-deploy:* aws-deploy start
Architecture
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Cursor IDE ββββββΆβ MCP Server ββββββΆβ AWS Amplify β
β β β (Local Node) β β β
β β’ User writes β β β’ Handles MCP β β β’ Builds app β
β "deploy this" β β protocol β β β’ Hosts app β
β β’ AI triggers β β β’ Runs deploy β β β’ Provides URL β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β GitHub β
β β
β β’ Stores code β
β β’ Provides repo β
β integration β
βββββββββββββββββββ
API Reference
MCP Tools
The MCP server exposes these tools to the IDE:
deploy_to_amplify
Deploys the current project to AWS Amplify.
Parameters:
project_name
(string, optional): Name for the Amplify appbranch
(string, default: "main"): Git branch to deployregion
(string, default: "us-east-1"): AWS region
Returns: Deployment URL and app ID
check_deployment_status
Checks the status of an Amplify deployment.
Parameters:
app_id
(string, required): Amplify app ID
Returns: Deployment status and details
generate_amplify_config
Generates an amplify.yml configuration file.
Parameters:
framework
(string): One of: react, nextjs, vue, angular, static
Returns: Generated configuration
check_prerequisites
Checks if all required tools are installed.
Returns: List of prerequisites and their status
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
# Clone the repository
git clone https://github.com/rachcorp/aws-deploy-mcp.git
cd aws-deploy-mcp
# Install dependencies
npm install
# Run tests
npm test
# Start in development mode
npm run dev
Testing
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test
npm test -- --testNamePattern="deployment"
Roadmap
- Local deployment mode
- MCP server implementation
- Auto-detection of frameworks
- GitHub OAuth integration
- Environment variables management
- Custom domain support
- Multi-branch deployments
- Deployment rollbacks
- SaaS deployment mode
- Team collaboration features
Support
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Documentation: Check the README and inline code documentation
License
MIT License - see LICENSE file for details.
Acknowledgments
- Built with Model Context Protocol (MCP)
- Powered by AWS Amplify
- Integrates with Cursor IDE
Star β this repo if you find it useful!
4 months ago