@@ -360,6 +360,7 @@ install_context7() {
360
360
# Install Database MCP Server (FreePeak version)
361
361
install_database () {
362
362
print_step " Installing Database MCP Server (FreePeak)..."
363
+ print_status " Note: Installing database MCP server globally (project-specific config handled later)"
363
364
364
365
if ! check_go; then
365
366
print_warning " Go installation failed. Skipping database MCP server."
@@ -534,10 +535,22 @@ parse_env() {
534
535
535
536
# Source the .env file safely
536
537
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
541
554
fi
542
555
543
556
# Get database connection details with defaults
@@ -550,7 +563,14 @@ parse_env() {
550
563
551
564
print_success " Environment variables parsed!"
552
565
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
554
574
print_status " Database name: $DB_DATABASE "
555
575
else
556
576
print_warning " No database name configured in .env file"
@@ -562,12 +582,14 @@ parse_env() {
562
582
# Generate database configuration for the MCP server
563
583
generate_database_config () {
564
584
print_step " Generating database configuration..."
585
+ print_status " Creating project-specific database MCP configuration..."
565
586
566
587
PROJECT_PATH=" $PWD "
567
588
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:"
571
593
print_status " 1. Set DB_DATABASE in your .env file (e.g., DB_DATABASE=your_project_name)"
572
594
print_status " 2. Create the database in MySQL/PostgreSQL"
573
595
print_status " 3. Run the setup script again to configure database MCP access"
@@ -785,10 +807,11 @@ configure_claude_mcp() {
785
807
print_warning " Database binary not found or not executable"
786
808
fi
787
809
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"
790
813
else
791
- print_warning " Database configuration file not found"
814
+ print_warning " Database configuration file not found (database-config.json missing) "
792
815
fi
793
816
fi
794
817
@@ -1663,7 +1686,7 @@ install_fluxui_and_volt() {
1663
1686
# Main installation function
1664
1687
main () {
1665
1688
echo " ================================================"
1666
- echo " Laravel Claude Code Setup Script v3.2 "
1689
+ echo " Laravel Claude Code Setup Script v3.3 "
1667
1690
echo " Laravel 12 + FluxUI + Playwright MCP Server"
1668
1691
echo " ================================================"
1669
1692
echo " "
0 commit comments