#!/bin/bash
# GCP MCP Server - Local Development Startup Script
set -e
echo "🚀 GCP MCP Server - Local Development Setup"
echo "==========================================="
# Check if Python 3.8+ is available
if ! command -v python3.11 &> /dev/null; then
echo "❌ Python 3.11 is required but not installed"
echo "💡 Install Python 3.11 and try again"
exit 1
fi
PYTHON_VERSION=$(python3.11 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
echo "✅ Python $PYTHON_VERSION detected"
# Check if virtual environment exists
if [ ! -d "venv" ]; then
echo "📦 Creating virtual environment..."
python3.11 -m venv venv
fi
# Activate virtual environment
echo "🔄 Activating virtual environment..."
source venv/bin/activate
# Install dependencies if needed
if [ ! -f "venv/pyvenv.cfg" ] || [ ! -f "venv/lib/python*/site-packages/gcp_mcp.egg-link" 2>/dev/null ]; then
echo "📚 Installing dependencies..."
pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
fi
# Check for configuration
if [ ! -f "config.local.json" ]; then
echo "⚙️ Creating local configuration..."
cp config.local.json config.json 2>/dev/null || echo "⚠️ Please create config.local.json"
fi
# Check for .env file
if [ ! -f ".env" ]; then
echo "🔧 Creating .env file from template..."
cp .env.example .env
echo "⚠️ Please edit .env file with your GCP project ID and credentials path"
fi
# Load environment variables
if [ -f ".env" ]; then
echo "📋 Loading environment variables..."
export $(cat .env | grep -v '^#' | xargs)
fi
# Check for GCP credentials
if [ -z "$GOOGLE_APPLICATION_CREDENTIALS" ]; then
echo "⚠️ GOOGLE_APPLICATION_CREDENTIALS not set"
echo "💡 Please set this in your .env file or export it manually"
elif [ ! -f "$GOOGLE_APPLICATION_CREDENTIALS" ]; then
echo "⚠️ Credentials file not found: $GOOGLE_APPLICATION_CREDENTIALS"
echo "💡 Please check the path in your .env file"
else
echo "✅ Credentials found: $GOOGLE_APPLICATION_CREDENTIALS"
fi
# Check for GCP project
if [ -z "$GCP_PROJECT" ]; then
echo "⚠️ GCP_PROJECT not set"
echo "💡 Please set this in your .env file"
else
echo "✅ GCP Project: $GCP_PROJECT"
fi
echo ""
echo "🎯 Starting GCP MCP Server in local development mode..."
echo "💡 Press Ctrl+C to stop the server"
echo "🔗 Configure Claude Code to use this server (see QUICKSTART.md)"
echo ""
# Start the server
python3.11 -m gcp_mcp.cli --local --debug
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JayRajGoyal/gcp-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server