- Go to Google Cloud Console
- Create a new project (or select existing)
- Enable Google Sheets API:
- Navigate to "APIs & Services" > "Library"
- Search for "Google Sheets API"
- Click "Enable"
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "Service Account"
- Fill in:
- Service account name:
foundries-devices-export(or any name) - Service account ID: auto-generated
- Click "Create and Continue"
- Service account name:
- Skip role assignment (click "Continue")
- Click "Done"
- Click on the service account you just created
- Go to "Keys" tab
- Click "Add Key" > "Create new key"
- Select JSON format
- Click "Create" - this downloads a JSON file
Option A: Place in project root
# Copy the downloaded JSON file to project root as credentials.json
cp ~/Downloads/your-service-account-key.json /path/to/mcp-remote-testing/credentials.json
Option B: Use environment variable
export GOOGLE_SHEETS_CREDENTIALS=/path/to/your-service-account-key.json
Option A: Create new spreadsheet (automatic)
- The script will create a new spreadsheet automatically
- You'll get the URL in the output
Option B: Use existing spreadsheet
- Create a Google Sheet manually
- Share it with the service account email (found in the JSON file, looks like
xxx@xxx.iam.gserviceaccount.com) - Give it "Editor" permissions
- Copy the Spreadsheet ID from the URL:
- URL format:
https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit - Use:
python3 export_to_google_sheets.py --spreadsheet-id SPREADSHEET_ID
- URL format:
python3 export_to_google_sheets.py --factory sentai
python3 export_to_google_sheets.py --factory sentai --spreadsheet-id YOUR_SPREADSHEET_ID
python3 export_to_google_sheets.py --factory sentai --sheet-name "Sentai Devices"
python3 export_to_google_sheets.py --factory sentai --title "My Foundries Devices"
Error: "Google Sheets credentials not found"
- Make sure
credentials.jsonis in the project root, OR - Set
GOOGLE_SHEETS_CREDENTIALSenvironment variable
Error: "Permission denied" or "Spreadsheet not found"
- Make sure you've shared the spreadsheet with the service account email
- Check that the service account email matches the one in your credentials JSON
Error: "API not enabled"
- Make sure Google Sheets API is enabled in your Google Cloud project