@@ -360,6 +360,7 @@ install_context7() {
360360# Install Database MCP Server (FreePeak version)
361361install_database () {
362362 print_step " Installing Database MCP Server (FreePeak)..."
363+ print_status " Note: Installing database MCP server globally (project-specific config handled later)"
363364
364365 if ! check_go; then
365366 print_warning " Go installation failed. Skipping database MCP server."
@@ -534,10 +535,22 @@ parse_env() {
534535
535536 # Source the .env file safely
536537 if [ -f " .env" ]; then
537- # Export variables that don't start with # and contain =
538- set -a
539- source <( grep -v ' ^#' .env | grep ' =' | sed ' s/^/export /' )
540- set +a
538+ # Parse .env more reliably
539+ while IFS=' =' read -r key value; do
540+ # Skip comments and empty lines
541+ [[ $key =~ ^[[:space:]]* # ]] && continue
542+ [[ -z $key ]] && continue
543+
544+ # Clean key and value
545+ key= $( echo " $key " | tr -d ' [:space:]' )
546+ # Remove surrounding quotes only (double or single)
547+ if [[ $value =~ ^\" .* \" $ ]]; then
548+ value=" ${value: 1: ${# value} -2} "
549+ elif [[ $value =~ ^\' .* \' $ ]]; then
550+ value=" ${value: 1: ${# value} -2} "
551+ fi
552+ export " $key =$value "
553+ done < .env
541554 fi
542555
543556 # Get database connection details with defaults
@@ -550,7 +563,14 @@ parse_env() {
550563
551564 print_success " Environment variables parsed!"
552565 print_status " Database: $DB_CONNECTION on $DB_HOST :$DB_PORT "
553- if [ ! -z " $DB_DATABASE " ]; then
566+
567+ # Debug: Show what we parsed for DB_DATABASE
568+ if [ -f " .env" ] && grep -q " ^DB_DATABASE=" .env; then
569+ local env_db_value=$( grep " ^DB_DATABASE=" .env | cut -d' =' -f2- | sed ' s/^["\x27]\|["\x27]$//g' )
570+ print_status " Found DB_DATABASE in .env: '$env_db_value '"
571+ fi
572+
573+ if [ ! -z " $DB_DATABASE " ] && [ " $DB_DATABASE " != " " ]; then
554574 print_status " Database name: $DB_DATABASE "
555575 else
556576 print_warning " No database name configured in .env file"
@@ -562,12 +582,14 @@ parse_env() {
562582# Generate database configuration for the MCP server
563583generate_database_config () {
564584 print_step " Generating database configuration..."
585+ print_status " Creating project-specific database MCP configuration..."
565586
566587 PROJECT_PATH=" $PWD "
567588
568- if [ -z " $DB_DATABASE " ]; then
569- print_warning " No database configured in .env file. Skipping database MCP configuration."
570- print_status " To enable database MCP integration:"
589+ if [ -z " $DB_DATABASE " ] || [ " $DB_DATABASE " = " " ]; then
590+ print_warning " No database name found. Skipping project-specific database MCP configuration."
591+ print_status " Note: Database MCP server is installed globally but won't be configured for this project"
592+ print_status " To enable database MCP integration for this project:"
571593 print_status " 1. Set DB_DATABASE in your .env file (e.g., DB_DATABASE=your_project_name)"
572594 print_status " 2. Create the database in MySQL/PostgreSQL"
573595 print_status " 3. Run the setup script again to configure database MCP access"
@@ -785,10 +807,11 @@ configure_claude_mcp() {
785807 print_warning " Database binary not found or not executable"
786808 fi
787809 else
788- if [ -z " $DB_DATABASE " ]; then
789- print_status " No database configured in .env file, skipping Database MCP server"
810+ if [ -z " $DB_DATABASE " ] || [ " $DB_DATABASE " = " " ]; then
811+ print_status " No database name in .env file, skipping project-specific Database MCP server"
812+ print_status " Note: Global database MCP server is still available for manual configuration"
790813 else
791- print_warning " Database configuration file not found"
814+ print_warning " Database configuration file not found (database-config.json missing) "
792815 fi
793816 fi
794817
@@ -1663,7 +1686,7 @@ install_fluxui_and_volt() {
16631686# Main installation function
16641687main () {
16651688 echo " ================================================"
1666- echo " Laravel Claude Code Setup Script v3.2 "
1689+ echo " Laravel Claude Code Setup Script v3.3 "
16671690 echo " Laravel 12 + FluxUI + Playwright MCP Server"
16681691 echo " ================================================"
16691692 echo " "
0 commit comments