39525-vm/OAUTH_ROUTES_SETUP.md

52 lines
1.5 KiB
Markdown

# Supabase MCP OAuth Setup
## OAuth Callback Routes erstellt
Ich habe die notwendigen OAuth Routes für den MCP Server erstellt:
### 📁 Neue Dateien:
1. **`/app/oauth/consent/route.ts`** - OAuth Callback Handler
2. **`/app/oauth/consent/page.tsx`** - Consent UI
3. **`/app/oauth/success/page.tsx`** - Success Seite
4. **`/app/oauth/error/page.tsx`** - Error Seite
### 🔧 Was diese Routes tun:
#### 1. OAuth Callback (`/oauth/consent`)
- Empfängt den Authorization Code von Supabase
- Tauscht Code gegen Access Tokens
- Leitet auf Success/Error weiter
#### 2. Consent UI (`/oauth/consent`)
- Zeigt den OAuth-Flow Status
- Bestätigt die MCP Konfiguration
- Leitet zurück zur App
#### 3. Success/Error Pages
- Erfolgsmeldung bei erfolgreicher Konfiguration
- Fehlermeldung bei Problemen
- Navigation zurück zur App
### 🎯 Nächste Schritte:
1. **Supabase OAuth App erstellen:**
- Gehe zu: https://supabase.com/dashboard/project/ekbpexbhuochrplzorce/authentication/oauth-apps
- Erstelle neue OAuth App
- Redirect URL: `http://localhost:3000/oauth/consent`
2. **MCP Konfiguration aktualisieren:**
- Client ID und Secret eintragen
- OAuth Callback URL verwenden
3. **Testen:**
- MCP Server sollte sich verbinden können
- Automatische Datenbank-Verwaltung möglich
### 🔐 Sicherheit:
- OAuth 2.1 statt Service Keys
- Scoped Permissions
- Row Level Security respektiert
- Development Branch sicher
Nach der OAuth App Erstellung im Supabase Dashboard sollte der MCP Server voll funktionsfähig sein!