# Quick Start Guide
Get up and running in 15 minutes!
## Prerequisites Checklist
- [ ] GCP account with billing enabled
- [ ] `gcloud` CLI installed and authenticated
- [ ] `terraform` installed (>= 1.0)
- [ ] `python3` installed (>= 3.9)
- [ ] `psql` PostgreSQL client installed
- [ ] Anthropic API key ([get one here](https://console.anthropic.com/))
## Step-by-Step Setup
### 1. Configure Environment (2 minutes)
```bash
cd /Users/matthewiames/Desktop/gcp_mcp
# Copy and edit environment file
cp .env.example .env
nano .env # Add your ANTHROPIC_API_KEY and verify GCP_PROJECT_ID
```
Required in `.env`:
- `ANTHROPIC_API_KEY` - Your Claude API key
- `GCP_PROJECT_ID` - Your GCP project ID (currently: iames-dq)
- `CLOUDSQL_PASSWORD` - Choose a strong password
### 2. Authenticate with GCP (1 minute)
```bash
gcloud auth login
gcloud auth application-default login
gcloud config set project iames-dq # or your project ID
```
### 3. Install Python Dependencies (2 minutes)
```bash
# Optional but recommended: create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
```
### 4. Deploy Everything (5-10 minutes)
```bash
./scripts/deploy.sh
```
This single command will:
- Deploy Cloud SQL with Terraform
- Create database schema
- Seed with 50 customers, 50 vendors, 50 orders
- Verify BigQuery access
You'll be prompted to confirm the Terraform deployment. Type `yes` to proceed.
### 5. Run the Agent (2 minutes)
```bash
python3 adk_agent/agent.py
```
Try these questions:
- "What are the total sales from Cloud SQL?"
- "How many customers do we have?"
- "Show me the schema for the orders table"
- "What tables are available in BigQuery?"
## Example Session
```
📊 You: What are the total sales from Cloud SQL?
🔧 Using tool: list_cloudsql_tables
✓ Tool executed successfully
🔧 Using tool: query_cloudsql
Arguments: {
"query": "SELECT SUM(total_amount) as total_sales FROM orders"
}
✓ Tool executed successfully
🤖 Agent: Based on the Cloud SQL database, the total sales amount
from all orders is $24,567.89. This represents 50 orders from our
customer base.
```
## Verify Everything Works
Run automated tests:
```bash
python3 scripts/test_agent.py
```
## What's Next?
1. **Explore the data**:
```sql
-- Connect to Cloud SQL
psql -h $DB_HOST -U salesuser -d salesdb
-- Try some queries
SELECT * FROM customers LIMIT 5;
SELECT status, COUNT(*) FROM orders GROUP BY status;
```
2. **Try the MCP server directly**:
```bash
python3 mcp_server/server.py
```
3. **Ask more complex questions**:
- "Compare sales by status"
- "Who are the top 5 customers by order volume?"
- "Show me product inventory from BigQuery"
## Troubleshooting
**Can't connect to Cloud SQL?**
```bash
# Check instance status
gcloud sql instances list
# Get IP address
cd terraform && terraform output public_ip_address
```
**Python import errors?**
```bash
# Make sure you're in the virtual environment
source venv/bin/activate
pip install -r requirements.txt
```
**Anthropic API errors?**
- Verify your API key in `.env`
- Check you have credits: https://console.anthropic.com/
**GCP permission errors?**
```bash
# Make sure you're authenticated
gcloud auth list
gcloud auth application-default login
```
## When You're Done
Don't forget to clean up to avoid charges:
```bash
./scripts/cleanup.sh
```
## Need Help?
- See full [README.md](README.md) for detailed documentation
- Check the troubleshooting section
- Review the code comments for implementation details