Paretofilm/amplify-pipeline-mcp
If you are the rightful owner of amplify-pipeline-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server that automates the setup of custom CI/CD pipelines for AWS Amplify Gen 2 applications with a single command.
AWS Amplify Pipeline MCP Server
๐ v1.2.0 Update: Dynamic App ID Resolution
Workflows now automatically detect your Amplify app ID based on repository name!
- No more hardcoded app IDs in workflows
- Same workflow works across all your projects
- Automatic fallback with helpful error messages
๐ฏ Smart Deployment Mode Detection
This MCP server automatically detects whether your Amplify app is:
- Repository-Connected (most common) - App connected to GitHub via AWS Amplify
- Manual Deployment (rare) - App not connected to any repository
Repository-Connected Apps (95% of cases)
โ Automatic detection and configuration โ No webhooks or manual triggers needed โ Optimized for Git-based deployments โ Monitors automatic Amplify builds
Manual Deployment Apps (5% of cases)
โ Uses webhooks and create-deployment API โ Full control over deployment timing โ Suitable for apps without Git connection
A Model Context Protocol (MCP) server that automates the setup of custom CI/CD pipelines for AWS Amplify Gen 2 applications with intelligent deployment mode detection.
๐ - Comprehensive guide for all features ๐ - Upcoming features and enhancements ๐ค - Deep dive into auto-fix system
Overview
This MCP server intelligently detects your Amplify app's deployment mode and configures the optimal pipeline setup. With just one command - pipeline-deploy
- everything is configured automatically based on whether your app is repository-connected or uses manual deployment.
Features
Core Capabilities
- ๐ Dynamic App ID Lookup: Workflows automatically find app ID by repository name
- ๐ Automatic Deployment Mode Detection: Intelligently detects repository-connected vs manual apps
- ๐ฏ Dual Workflow Templates: Generates appropriate GitHub Actions based on deployment mode
- ๐ Smart Pipeline Setup: Configures optimal CI/CD for your specific app configuration
- ๐ฆ Framework Detection: Automatically detects Next.js, React, Vue, Angular, etc.
- ๐ง Platform Configuration: Sets correct platform (WEB_COMPUTE for SSR, WEB for SPA)
Repository-Connected Features
- โ No Manual Triggers: Leverages Amplify's automatic builds
- ๐ Build Monitoring: Tracks automatic builds triggered by Git pushes
- ๐ Simplified Workflow: Backend deploy โ Git push โ Auto frontend build
- โก Faster Deployments: Optimized for the common case
Manual Deployment Features
- ๐ Webhook Management: Creates webhooks for manual triggering
- ๐ฎ Full Control: Complete control over deployment timing
- ๐ฆ Bundle Creation: Packages and deploys build artifacts
- ๐ Auto-Build Disable: Turns off automatic builds for manual control
Error Handling & Recovery
- ๐ค Auto-Fix System: Automatically fixes common deployment issues
- ๐ Error Detection: Identifies wrong deployment mode usage
- ๐ Smart Suggestions: Provides actionable fixes for failures
- ๐ Retry Logic: Automatic retries with fixes applied
The New Workflow
Step 1: Manual Setup (One Time)
- Create your Amplify app in AWS Console
- Connect your GitHub repository using the AWS Amplify GitHub App (for repository-connected mode)
- This establishes the secure connection between Amplify and GitHub
Step 2: Automated Pipeline Setup
From your repository directory, just say:
- "pipeline deploy" or
- "set up pipeline" or
- "p-deploy"
That's it! The MCP server automatically detects your deployment mode and configures everything accordingly.
What Happens Automatically
When you run pipeline-deploy
with your app ID, the server:
- โ Generates workflows with dynamic app ID lookup (no hardcoding!)
- โ Detects deployment mode (repository-connected or manual)
- โ Detects framework (Next.js, React, Vue, etc.)
- โ Configures appropriate workflow based on mode
- โ Auto-detects your current Git branch
- โ For repository-connected: Ensures auto-build is enabled
- โ For manual: Disables auto-build and creates webhooks
- โ Generates optimal GitHub Actions workflow
- โ Creates auto-fix scripts for error recovery
- โ
Sets up proper
amplify.yml
with Node.js 20
Prerequisites
- AWS CLI configured with appropriate credentials
- AWS Amplify App created in AWS Console
- GitHub Repository (connected for repository mode)
- Python 3.9+ installed
- Node.js 20+ for Amplify Gen 2
- MCP-compatible client (like Claude Code)
Quick Start
1. Install Dependencies
pip install mcp pyyaml
2. Add to Claude Code
# Using the shell script (recommended)
claude mcp add amplify-pipeline /Users/kjetilge/mcp-servers/amplify-pipeline-mcp/run_server.sh -s local
# Or using Python directly
claude mcp add amplify-pipeline "python /Users/kjetilge/mcp-servers/amplify-pipeline-mcp/server.py" -s local
3. Configure Your App
# The tool will auto-detect your deployment mode and configure accordingly
pipeline-deploy --app-id YOUR_APP_ID
# Example output:
# ๐ Detecting deployment mode...
# โ
Repository-connected app detected
# ๐ฆ Framework: Next.js SSR (WEB_COMPUTE)
# ๐ฟ Branch: main
# ๐ Setting up repository-connected pipeline...
What Gets Created
For Repository-Connected Apps (Most Common)
- Optimized GitHub Actions Workflow - Deploys backend, monitors automatic frontend build
- amplify.yml - Build configuration with Node.js 20
- Auto-Fix Scripts - Handles common errors
- Build Monitoring - Tracks automatic Amplify builds
For Manual Deployment Apps (Rare)
- Manual Deployment Workflow - Full control over deployments
- Webhook Configuration - For triggering deployments
- Build Bundle Creation - Packages artifacts for deployment
- Deployment Monitoring - Tracks manual deployment status
Common Issues & Solutions
"Operation not supported" Error
Problem: Using manual deployment on a repository-connected app Solution: The MCP server now automatically detects this and uses the correct workflow
Missing amplify_outputs.json
Problem: Frontend can't find backend configuration Solution: Automatically generated during backend deployment
Package-lock.json Out of Sync
Problem: Dependencies mismatch between package.json and lock file Solution: Automatically detected and fixed before deployment
Architecture
Repository-Connected Apps (Automatic Detection)
โโโโโโโโโโโโโโโโโโโ
โ GitHub Push โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ GitHub Actions โ
โ Workflow โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Backend Deploy โ
โ (pipeline-deploy)โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Git Push with โ
โ amplify_outputs โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Amplify Auto โ
โ Build (Triggeredโ
โ by Git Push) โ
โโโโโโโโโโโโโโโโโโโ
Manual Deployment Apps (Automatic Detection)
โโโโโโโโโโโโโโโโโโโ
โ GitHub Push โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ GitHub Actions โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Backend Deploy โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Create Bundle โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Manual Deploy โ
โ (create-deploy) โ
โโโโโโโโโโโโโโโโโโโ
Required GitHub Setup
After running pipeline-deploy
, you need to:
-
Add GitHub Secrets:
AWS_ACCESS_KEY_ID
- AWS access key for deploymentsAWS_SECRET_ACCESS_KEY
- AWS secret key for deployments
-
Ensure Repository Permissions:
- GitHub Actions needs write permissions (added automatically to workflow)
- Verify
amplify_outputs.json
is NOT in.gitignore
-
Commit and Push:
git add -A
git commit -m "Add custom pipeline configuration"
git push
Auto-Fix Features
What Gets Fixed Automatically
Issue Type | Auto-Fix Action | When Applied |
---|---|---|
Wrong deployment mode | Use correct workflow | Detection phase |
Linting errors | ESLint --fix | Before deployment |
Formatting | Prettier --write | Before deployment |
TypeScript errors | Add missing types/imports | On failure |
Security vulnerabilities | npm audit fix | On failure |
Missing dependencies | npm install | On failure |
Missing amplify_outputs.json | Generate from app ID | On failure |
Package-lock sync | npm install | Before deployment |
Usage Examples
With Claude Code (Natural Language)
"Set up pipeline for my amplify app"
"Why is my build failing?"
"Is my app repository-connected?"
"Fix deployment errors"
Direct Command
"pipeline deploy d1234abcd5678"
The app ID can be found in your Amplify Console URL:
- Go to AWS Amplify Console
- Click on your app
- The URL will be:
.../apps/d1234abcd5678/...
- Copy the ID:
d1234abcd5678
Benefits
- Intelligent Detection: Automatically uses the right deployment strategy
- Zero Configuration: Works out of the box with auto-detection
- Error Prevention: Prevents "Operation not supported" errors
- Full Control: Complete control over build and deployment process
- Custom Steps: Add testing, linting, security scans, etc.
- Integration: Works with existing CI/CD systems
- Auto-Fix: Automatically resolves common deployment errors
- Time Saving: No manual fixing of deployment mode mismatches
Documentation
- ๐ - Step-by-step instructions for all features
- ๐ค - How the self-healing system works
- ๐ - What's coming next
- ๐ก - Sample configurations and use cases
Support
With Claude Code
Simply ask:
- "Help with pipeline setup"
- "Debug my failing build"
- "What deployment mode is my app using?"
- "Fix repository connection issues"
Manual Support
- Check the
- Review workflow logs in GitHub Actions
- Check AWS Amplify Console for frontend logs
- Ensure all prerequisites are met
Development
Project Structure
amplify-pipeline-mcp/
โโโ server.py # Main MCP server implementation
โโโ deployment_detector.py # Deployment mode detection logic
โโโ deployment_monitor.py # Enhanced monitoring capabilities
โโโ workflow_templates.py # Dual workflow templates
โโโ README.md # User documentation
โโโ pyproject.toml # Python package configuration
Testing Checklist
- Test with repository-connected app
- Test with manual deployment app
- Test deployment mode detection
- Test framework detection
- Verify correct workflow generation
- Confirm error handling for wrong mode
- Check auto-fix capabilities
License
MIT