#!/bin/bash
# GCP MCP Server - One-command installer
set -e
echo "π Installing GCP MCP Server"
echo "=============================="
# Check Python
if ! command -v python3.11 &> /dev/null; then
echo "β Python 3 is required but not installed"
exit 1
fi
if ! python3 -c "import sys; exit(0 if sys.version_info >= (3, 8) else 1)" 2>/dev/null; then
echo "β Python 3.8+ is required"
exit 1
fi
echo "β
Python version check passed"
# Install in current directory or create new one
if [ ! -f "pyproject.toml" ]; then
echo "π This doesn't look like the gcp-mcp directory"
echo "π‘ Make sure you're in the gcp-mcp directory or clone it first:"
echo " git clone https://github.com/JayRajGoyal/gcp-mcp.git"
echo " cd gcp-mcp"
echo " ./install.sh"
exit 1
fi
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
echo "π¦ Creating virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
echo "π Activating virtual environment..."
source venv/bin/activate
# Install dependencies
echo "π Installing dependencies..."
pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
echo ""
echo "β
Installation complete!"
echo ""
echo "π― Quick Start:"
echo "1. Get your GCP service account key file"
echo "2. Run: python -m gcp_mcp.cli --credentials /path/to/your/credentials.json"
echo ""
echo "π For Claude Code integration, add this to your config:"
echo '{'
echo ' "mcpServers": {'
echo ' "gcp": {'
echo ' "command": "python",'
echo ' "args": ['
echo ' "-m", "gcp_mcp.cli",'
echo ' "--credentials", "/path/to/your/credentials.json"'
echo ' ],'
echo " \"cwd\": \"$(pwd)\""
echo ' }'
echo ' }'
echo '}'
echo ""
echo "π See QUICKSTART.md for detailed instructions"