Skip to content

Commit cfa7623

Browse files
fidgetcodingruvnet
andcommitted
feat(step-6): add GitHub MCP as option 7
Adds @modelcontextprotocol/server-github as option 7 in the interactive menu. Covers flag, auto-detect, install_github() function (with PAT validation hint), self-test, summary block, and main() dispatch. Co-Authored-By: claude-flow <ruv@ruv.net>
1 parent 9d86dd7 commit cfa7623

1 file changed

Lines changed: 70 additions & 1 deletion

File tree

step-6/step-6-install.sh

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -uo pipefail
33

44
# =============================================================================
55
# Step 6 — Productivity Tools
6-
# Installs Notion, Granola, n8n, Google Calendar, Morgen, and Motion Calendar
6+
# Installs Notion, Granola, n8n, Google Calendar, Morgen, Motion Calendar, and GitHub
77
# MCP servers. Interactive — pick the tools you actually use.
88
# Obsidian MCP lives in Step 7 alongside the rest of the Obsidian vault setup.
99
# Run this in your terminal after completing Steps 1-5.
@@ -30,6 +30,7 @@ INSTALLED_N8N=false
3030
INSTALLED_GCAL=false
3131
INSTALLED_MORGEN=false
3232
INSTALLED_MOTION=false
33+
INSTALLED_GITHUB=false
3334
# Pre-existing installs (credentials managed outside this script).
3435
# Only Motion tracks this because Motion persists credentials to a local .env
3536
# the self-test checks for; Morgen/Notion/n8n credentials live inside Claude's
@@ -97,6 +98,10 @@ choose_tools() {
9798
INSTALLED_MOTION=true
9899
MOTION_PREEXISTING=true
99100
fi
101+
if claude mcp list 2>/dev/null | grep -q "github" 2>/dev/null; then
102+
CHOICES="$CHOICES 7"
103+
INSTALLED_GITHUB=true
104+
fi
100105

101106
if [ -n "$CHOICES" ]; then
102107
info "Found already-installed tools — verifying configuration"
@@ -123,6 +128,7 @@ choose_tools() {
123128
echo " 4) Google Calendar — calendar events via Google OAuth"
124129
echo " 5) Morgen — unified calendar + tasks (recommended)"
125130
echo " 6) Motion Calendar — Motion events, availability, scheduling"
131+
echo " 7) GitHub — repos, issues, PRs, code search (requires PAT)"
126132
echo ""
127133
echo -e "${YELLOW} Note: Morgen (5) is the recommended calendar+task tool.${NC}"
128134
echo -e "${YELLOW} Motion (6) and Google Calendar (4) are secondary —${NC}"
@@ -502,6 +508,61 @@ install_motion_calendar() {
502508
fi
503509
}
504510

511+
# -----------------------------------------------------------------------------
512+
# Install GitHub MCP
513+
# -----------------------------------------------------------------------------
514+
install_github() {
515+
info "Installing GitHub MCP server..."
516+
517+
if claude mcp list 2>/dev/null | grep -q "github"; then
518+
success "GitHub MCP already installed"
519+
INSTALLED_GITHUB=true
520+
return
521+
fi
522+
523+
echo ""
524+
echo -e "${BLUE} GitHub MCP gives Claude read/write access to your repos,${NC}"
525+
echo -e "${BLUE} issues, pull requests, and code search via the GitHub API.${NC}"
526+
echo ""
527+
echo -e "${BLUE} You need a Personal Access Token (PAT). Create one at:${NC}"
528+
echo -e "${BLUE} https://github.com/settings/tokens/new${NC}"
529+
echo ""
530+
echo " Suggested settings:"
531+
echo " - Token name: claude-github-mcp"
532+
echo " - Expiration: No expiration (or 1 year)"
533+
echo " - Scopes: repo, read:org, gist"
534+
echo ""
535+
echo -e "${YELLOW} Use a classic token (not fine-grained) for full repo access.${NC}"
536+
echo ""
537+
538+
read -sp " GitHub Personal Access Token (ghp_...): " GITHUB_TOKEN
539+
echo " [saved]"
540+
echo ""
541+
542+
if [ -z "$GITHUB_TOKEN" ]; then
543+
warn "No GitHub token provided. Skipping GitHub setup."
544+
warn "Re-run Step 6 when you have a token ready."
545+
return
546+
fi
547+
548+
if [[ ! "$GITHUB_TOKEN" =~ ^gh[ps]_ ]]; then
549+
warn "Token doesn't look like a GitHub PAT (expected ghp_ or ghs_ prefix)."
550+
warn "Proceeding anyway — registration will fail if the token is invalid."
551+
echo ""
552+
fi
553+
554+
claude mcp add --scope user \
555+
-e GITHUB_PERSONAL_ACCESS_TOKEN="$GITHUB_TOKEN" \
556+
github -- npx -y @modelcontextprotocol/server-github 2>/dev/null
557+
558+
if claude mcp list 2>/dev/null | grep -q "github"; then
559+
success "GitHub MCP installed"
560+
INSTALLED_GITHUB=true
561+
else
562+
soft_fail "GitHub MCP installation could not be verified"
563+
fi
564+
}
565+
505566
# -----------------------------------------------------------------------------
506567
# Self-test — check each installed tool is registered
507568
# -----------------------------------------------------------------------------
@@ -534,6 +595,7 @@ run_self_test() {
534595
if $INSTALLED_GCAL; then check_registered "Google Calendar" "google-calendar"; else info "TEST: Google Calendar — skipped"; TEST_SKIP=$((TEST_SKIP + 1)); fi
535596
if $INSTALLED_MORGEN; then check_registered "Morgen" "morgen"; else info "TEST: Morgen — skipped"; TEST_SKIP=$((TEST_SKIP + 1)); fi
536597
if $INSTALLED_MOTION; then check_registered "Motion Calendar" "motion-calendar"; else info "TEST: Motion Calendar — skipped"; TEST_SKIP=$((TEST_SKIP + 1)); fi
598+
if $INSTALLED_GITHUB; then check_registered "GitHub" "github"; else info "TEST: GitHub — skipped"; TEST_SKIP=$((TEST_SKIP + 1)); fi
537599

538600
# Credential-file checks for tools that persist a local .env
539601
if $INSTALLED_GCAL; then
@@ -587,6 +649,7 @@ print_summary() {
587649
if $INSTALLED_GCAL; then echo " Google Calendar — calendar events via Google OAuth"; INSTALLED_COUNT=$((INSTALLED_COUNT + 1)); fi
588650
if $INSTALLED_MORGEN; then echo " Morgen — unified calendar + tasks (single API key)"; INSTALLED_COUNT=$((INSTALLED_COUNT + 1)); fi
589651
if $INSTALLED_MOTION; then echo " Motion Calendar — Motion events, availability, scheduling"; INSTALLED_COUNT=$((INSTALLED_COUNT + 1)); fi
652+
if $INSTALLED_GITHUB; then echo " GitHub — repos, issues, PRs, code search"; INSTALLED_COUNT=$((INSTALLED_COUNT + 1)); fi
590653

591654
if [ "$INSTALLED_COUNT" -eq 0 ]; then
592655
echo " No tools were installed."
@@ -618,6 +681,11 @@ print_summary() {
618681
echo " - Ask Claude \"who on my team has a conflict at 3pm?\""
619682
echo " - Ask Claude to search events across all your Motion calendars"
620683
fi
684+
if $INSTALLED_GITHUB; then
685+
echo " - Ask Claude to list open PRs or issues on any of your repos"
686+
echo " - Ask Claude to search code across your GitHub organizations"
687+
echo " - Ask Claude to create issues, review PRs, or push commits"
688+
fi
621689
fi
622690

623691
echo ""
@@ -656,6 +724,7 @@ main() {
656724
4) if ! $INSTALLED_GCAL; then install_google_calendar; else success "Google Calendar already configured"; fi ;;
657725
5) if ! $INSTALLED_MORGEN; then install_morgen; else success "Morgen already configured"; fi ;;
658726
6) if ! $INSTALLED_MOTION; then install_motion_calendar; else success "Motion Calendar already configured"; fi ;;
727+
7) if ! $INSTALLED_GITHUB; then install_github; else success "GitHub already configured"; fi ;;
659728
*) warn "Unknown choice: $CHOICE (skipping)" ;;
660729
esac
661730
done

0 commit comments

Comments
 (0)