-
-
Notifications
You must be signed in to change notification settings - Fork 158
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·97 lines (84 loc) · 2.65 KB
/
setup.sh
File metadata and controls
executable file
·97 lines (84 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
# Google Workspace Setup for Claude Code
# Created by Sterling Chin
#
# This sets up Google Workspace MCP with the correct scopes
# (excludes Tasks API which has a bug)
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
echo ""
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE} Google Workspace Setup for Claude${NC}"
echo -e "${BLUE}========================================${NC}"
echo ""
# Get client ID
if [ -z "$GOOGLE_OAUTH_CLIENT_ID" ]; then
echo -e "${YELLOW}Enter the Google OAuth Client ID${NC}"
echo "(Get this from Google Cloud Console)"
echo ""
read -p "Client ID: " GOOGLE_CLIENT_ID
echo ""
else
GOOGLE_CLIENT_ID="$GOOGLE_OAUTH_CLIENT_ID"
fi
if [ -z "$GOOGLE_CLIENT_ID" ]; then
echo -e "${RED}Error: Client ID is required${NC}"
exit 1
fi
# Get client secret
if [ -z "$GOOGLE_OAUTH_CLIENT_SECRET" ]; then
echo -e "${YELLOW}Enter the Google OAuth Client Secret${NC}"
echo "(Get this from Google Cloud Console)"
echo ""
read -s -p "Client Secret: " GOOGLE_CLIENT_SECRET
echo ""
else
GOOGLE_CLIENT_SECRET="$GOOGLE_OAUTH_CLIENT_SECRET"
fi
if [ -z "$GOOGLE_CLIENT_SECRET" ]; then
echo -e "${RED}Error: Client secret is required${NC}"
exit 1
fi
# Check prerequisites
echo ""
echo -e "${BLUE}Checking prerequisites...${NC}"
if command -v uvx &> /dev/null; then
echo -e "${GREEN} uv/uvx installed${NC}"
else
echo -e "${YELLOW} Installing uv...${NC}"
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.cargo/bin:$PATH"
fi
if command -v claude &> /dev/null; then
echo -e "${GREEN} Claude Code installed${NC}"
else
echo -e "${RED} Claude Code not found${NC}"
echo " Install: npm install -g @anthropic-ai/claude-code"
exit 1
fi
# Remove existing MCP if present
echo ""
echo -e "${BLUE}Configuring Google Workspace MCP...${NC}"
claude mcp remove google-workspace 2>/dev/null || true
# Add MCP with specific tools (excludes tasks which has scope bug)
claude mcp add google-workspace -s user \
--env GOOGLE_OAUTH_CLIENT_ID="$GOOGLE_CLIENT_ID" \
--env GOOGLE_OAUTH_CLIENT_SECRET="$GOOGLE_CLIENT_SECRET" \
-- uvx workspace-mcp --tools gmail drive calendar docs sheets slides
echo ""
echo -e "${GREEN}========================================${NC}"
echo -e "${GREEN} Setup Complete!${NC}"
echo -e "${GREEN}========================================${NC}"
echo ""
echo "Next steps:"
echo ""
echo " 1. Start Claude Code: ${YELLOW}claude${NC}"
echo ""
echo " 2. First Google request will open browser for login"
echo ""
echo " 3. Try: ${YELLOW}\"What's on my calendar today?\"${NC}"
echo ""