deploy.shβ’3.01 kB
#!/bin/bash
# Personal Resume MCP Server - AWS Deployment Script
set -e
# Configuration - Update these with your AWS details
AWS_REGION="${AWS_REGION:-us-east-1}"
AWS_ACCOUNT_ID="${AWS_ACCOUNT_ID:-181179258793}"
ECR_REPOSITORY="personal-resume-mcp"
IMAGE_TAG="${IMAGE_TAG:-latest}"
CLUSTER_NAME="personal-resume-cluster"
SERVICE_NAME="personal-resume-service"
echo "π Deploying Personal Resume MCP Server to AWS"
echo "Region: $AWS_REGION"
echo "Account: $AWS_ACCOUNT_ID"
echo "Repository: $ECR_REPOSITORY"
# Check if AWS CLI is configured
if ! aws sts get-caller-identity > /dev/null 2>&1; then
echo "β AWS CLI not configured. Please run 'aws configure'"
exit 1
fi
# Create ECR repository if it doesn't exist
echo "π¦ Setting up ECR repository..."
aws ecr describe-repositories --repository-names $ECR_REPOSITORY --region $AWS_REGION > /dev/null 2>&1 || \
aws ecr create-repository --repository-name $ECR_REPOSITORY --region $AWS_REGION
# Get ECR login token
echo "π Logging into ECR..."
aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com
# Build Docker image
echo "ποΈ Building Docker image..."
cd ..
docker build -t $ECR_REPOSITORY:$IMAGE_TAG .
# Tag and push image to ECR
echo "β¬οΈ Pushing image to ECR..."
docker tag $ECR_REPOSITORY:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPOSITORY:$IMAGE_TAG
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPOSITORY:$IMAGE_TAG
# Update task definition with actual values
echo "π Updating ECS task definition..."
cd deploy
sed -e "s/YOUR_ACCOUNT_ID/$AWS_ACCOUNT_ID/g" \
-e "s/YOUR_REGION/$AWS_REGION/g" \
aws-ecs-task-definition.json > aws-ecs-task-definition-updated.json
# Create log group if it doesn't exist
echo "π Setting up CloudWatch log group..."
aws logs create-log-group --log-group-name "/ecs/personal-resume-mcp-server" --region $AWS_REGION > /dev/null 2>&1 || true
# Register task definition
echo "π Registering ECS task definition..."
aws ecs register-task-definition --cli-input-json file://aws-ecs-task-definition-updated.json --region $AWS_REGION
# Create ECS cluster if it doesn't exist
echo "ποΈ Setting up ECS cluster..."
aws ecs describe-clusters --clusters $CLUSTER_NAME --region $AWS_REGION > /dev/null 2>&1 || \
aws ecs create-cluster --cluster-name $CLUSTER_NAME --region $AWS_REGION
echo "β
Deployment preparation complete!"
echo ""
echo "Next steps:"
echo "1. Create an ECS service using the AWS Console or CLI"
echo "2. Configure Application Load Balancer (ALB) for HTTP access"
echo "3. Update Claude Desktop config with the ALB endpoint"
echo ""
echo "Example Claude Desktop config:"
echo '{'
echo ' "mcpServers": {'
echo ' "personal-resume": {'
echo ' "command": "curl",'
echo ' "args": ["-X", "POST", "https://your-alb-endpoint.com/mcp", "-H", "Content-Type: application/json", "-d", "@-"]'
echo ' }'
echo ' }'
echo '}'