claude-docker/scripts/setup-env.sh
Vishal Jain 6cb57c9dc6 Fix Twilio MCP integration with baked-in credentials
- Add proper type and env sections to mcp-config.json
- Remove dynamic MCP add command, use pre-configured MCP
- Bake .env credentials into Docker image at build time
- Remove runtime .env volume mount - true one-time setup
- Auto-rebuild image when .env file changes
- Export Twilio env vars for MCP server subprocess
- Remove conflicting .mcp.json file
2025-06-13 09:53:43 +01:00

51 lines
1.6 KiB
Bash

#!/bin/bash
# ABOUTME: Setup script to create ~/.claude-docker/.env with Twilio credentials
# ABOUTME: Run this once on your host machine to configure Twilio for all projects
CLAUDE_DOCKER_DIR="$HOME/.claude-docker"
ENV_FILE="$CLAUDE_DOCKER_DIR/.env"
# Create directory if it doesn't exist
mkdir -p "$CLAUDE_DOCKER_DIR"
# Check if .env already exists
if [ -f "$ENV_FILE" ]; then
echo "⚠️ $ENV_FILE already exists!"
read -p "Do you want to update it? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 0
fi
fi
echo "Setting up Twilio credentials for Claude Docker..."
echo "You'll need your Twilio account information."
echo
# Collect Twilio credentials
read -p "Enter your Twilio Account SID: " TWILIO_ACCOUNT_SID
read -p "Enter your Twilio API Key: " TWILIO_API_KEY
read -sp "Enter your Twilio API Secret: " TWILIO_API_SECRET
echo
read -p "Enter your Twilio phone number (with country code, e.g., +1234567890): " TWILIO_FROM_NUMBER
read -p "Enter the phone number to receive SMS (with country code): " TWILIO_TO_NUMBER
# Create .env file
cat > "$ENV_FILE" << EOF
# Twilio credentials for Claude Docker
TWILIO_ACCOUNT_SID=$TWILIO_ACCOUNT_SID
TWILIO_API_KEY=$TWILIO_API_KEY
TWILIO_API_SECRET=$TWILIO_API_SECRET
TWILIO_FROM_NUMBER=$TWILIO_FROM_NUMBER
TWILIO_TO_NUMBER=$TWILIO_TO_NUMBER
EOF
# Set restrictive permissions
chmod 600 "$ENV_FILE"
echo
echo "✅ Twilio credentials saved to $ENV_FILE"
echo "These credentials will be available to all Claude Docker sessions."
echo
echo "To test, run claude-docker from any project directory and use:"
echo " node /workspace/test-twilio.js"