{
  "markdown": "# Supabase MCP Server - Self-Hosted Edition\r\n\r\n🗄️ **Serveur MCP Supabase Self-Hosted** - Gestion complète de votre instance Supabase privée\r\n\r\n## 🌟 Fonctionnalités\r\n\r\n- 🔐 **Gestion complète** de votre instance Supabase privée\r\n- 🛠️ **54+ outils MCP** pour l'administration Supabase\r\n- 📊 **Monitoring** et métriques en temps réel\r\n- 🚀 **Déploiement automatique** sur Railway\r\n- 🔒 **Sécurité renforcée** avec prévention SQL injection\r\n- ⚡ **Performance optimisée** pour la production\r\n\r\n## 🏗️ Architecture\r\n\r\nCe repository contient **uniquement** le serveur MCP Supabase pur, sans interface web ni hub central.\r\n\r\n```\r\nSupabase MCP Server (Port 8000)\r\n├── 🗄️ Gestion de base de données\r\n├── 🔐 Authentification et autorisation\r\n├── 📁 Stockage et fichiers\r\n├── 🔄 Temps réel et subscriptions\r\n├── 🛠️ Migrations et schémas\r\n├── 📊 Monitoring et logs\r\n└── 🚀 Déploiement automatique\r\n```\r\n\r\n## 🚀 Démarrage Rapide\r\n\r\n### Prérequis\r\n- Python 3.11+\r\n- Instance Supabase (self-hosted ou cloud)\r\n- Variables d'environnement Supabase\r\n\r\n### Option A — SDK Smithery (recommandé)\r\n\r\n```bash\r\n# Cloner le repository\r\ngit clone https://github.com/MisterSandFR/Supabase-MCP-SelfHosted.git\r\ncd Supabase-MCP-SelfHosted\r\n\r\n# Installer les dépendances\r\npip install -r requirements.txt\r\n\r\n# (Facultatif) Installer la CLI Smithery si besoin\r\nnpm i -g @smithery/cli\r\n\r\n# Lancer le dev SDK (selon votre environnement)\r\nsmithery dev   # ou: smithery playground\r\n```\r\n\r\n- Le serveur SDK est défini dans `pyproject.toml` via:\r\n  - `[tool.smithery] server = \"supabase_mcp_server.server:create_server\"`\r\n- Lors du déploiement dans l’interface Smithery, configurez le Test Profile puis lancez le Scan.\r\n\r\n### Option B — HTTP self-hosted (compat)\r\n\r\n```bash\r\n# Cloner le repository\r\ngit clone https://github.com/MisterSandFR/Supabase-MCP-SelfHosted.git\r\ncd Supabase-MCP-SelfHosted\r\n\r\n# Installer les dépendances Python\r\npip install -r requirements.txt\r\n\r\n# Configurer les variables d'environnement\r\nexport SUPABASE_URL=\"https://your-project.supabase.co\"\r\nexport SUPABASE_ANON_KEY=\"your-anon-key\"\r\nexport SUPABASE_SERVICE_KEY=\"your-service-key\"  # Optionnel\r\n\r\n# Démarrer le serveur HTTP externe\r\npython src/supabase_server.py\r\n```\r\n\r\n### Avec Docker (Railway / self-hosted)\r\n\r\n```bash\r\n# Build et démarrage (utilisez Dockerfile.railway si besoin)\r\ndocker build -f Dockerfile.railway -t supabase-mcp-server .\r\ndocker run -p 8000:8000 \\\r\n  -e SUPABASE_URL=\"https://your-project.supabase.co\" \\\r\n  -e SUPABASE_ANON_KEY=\"your-anon-key\" \\\r\n  supabase-mcp-server\r\n```\r\n\r\n## ⚙️ Configuration\r\n\r\n### Variables d'Environnement\r\n\r\n```bash\r\n# Supabase Configuration\r\nSUPABASE_URL=https://your-project.supabase.co\r\nSUPABASE_ANON_KEY=eyJ... (votre clé anonyme)\r\nSUPABASE_SERVICE_KEY=eyJ... (optionnel, pour opérations privilégiées)\r\n\r\n# Server Configuration\r\nPORT=8000\r\nPYTHONUNBUFFERED=1\r\n```\r\n\r\n## 🛠️ Outils MCP Disponibles\r\n\r\n### Base de Données (15 outils)\r\n- `execute_sql` - Exécution de requêtes SQL\r\n- `list_tables` - Liste des tables\r\n- `inspect_schema` - Inspection du schéma\r\n- `apply_migration` - Application de migrations\r\n- `backup_database` - Sauvegarde de base\r\n- `restore_database` - Restauration de base\r\n- `vacuum_analyze` - Optimisation de base\r\n- `get_database_stats` - Statistiques de base\r\n- `create_index` - Création d'index\r\n- `drop_index` - Suppression d'index\r\n- `list_extensions` - Liste des extensions\r\n- `manage_extensions` - Gestion des extensions\r\n- `execute_psql` - Commandes psql\r\n- `check_health` - Vérification de santé\r\n- `get_database_connections` - Connexions de base\r\n\r\n### Authentification (8 outils)\r\n- `list_auth_users` - Liste des utilisateurs\r\n- `create_auth_user` - Création d'utilisateur\r\n- `update_auth_user` - Mise à jour d'utilisateur\r\n- `delete_auth_user` - Suppression d'utilisateur\r\n- `get_auth_user` - Récupération d'utilisateur\r\n- `verify_jwt_secret` - Vérification JWT\r\n- `manage_roles` - Gestion des rôles\r\n- `manage_rls_policies` - Gestion des politiques RLS\r\n\r\n### Stockage (6 outils)\r\n- `list_storage_buckets` - Liste des buckets\r\n- `list_storage_objects` - Liste des objets\r\n- `manage_storage_policies` - Gestion des politiques\r\n- `upload_file` - Upload de fichier\r\n- `download_file` - Téléchargement de fichier\r\n- `delete_file` - Suppression de fichier\r\n\r\n### Temps Réel (4 outils)\r\n- `list_realtime_publications` - Liste des publications\r\n- `manage_realtime` - Gestion du temps réel\r\n- `create_subscription` - Création de subscription\r\n- `delete_subscription` - Suppression de subscription\r\n\r\n### Migrations (8 outils)\r\n- `create_migration` - Création de migration\r\n- `list_migrations` - Liste des migrations\r\n- `push_migrations` - Push des migrations\r\n- `validate_migration` - Validation de migration\r\n- `smart_migration` - Migration intelligente\r\n- `auto_migrate` - Migration automatique\r\n- `sync_schema` - Synchronisation de schéma\r\n- `import_schema` - Import de schéma\r\n\r\n### Monitoring (5 outils)\r\n- `get_logs` - Récupération des logs\r\n- `metrics_dashboard` - Tableau de bord métriques\r\n- `analyze_performance` - Analyse de performance\r\n- `analyze_rls_coverage` - Analyse couverture RLS\r\n- `audit_security` - Audit de sécurité\r\n\r\n### Utilitaires (8 outils)\r\n- `generate_typescript_types` - Génération de types TS\r\n- `generate_crud_api` - Génération d'API CRUD\r\n- `cache_management` - Gestion du cache\r\n- `environment_management` - Gestion d'environnement\r\n- `manage_secrets` - Gestion des secrets\r\n- `manage_functions` - Gestion des fonctions\r\n- `manage_triggers` - Gestion des triggers\r\n- `manage_webhooks` - Gestion des webhooks\r\n\r\n## 🔧 API Endpoints\r\n\r\n### Serveur MCP (HTTP self-hosted)\r\n- `GET /health` - Health check\r\n- `POST /mcp` - Endpoint JSON-RPC principal\r\n- `GET /.well-known/mcp-config` - Configuration MCP\r\n- `GET /mcp/tools.json` - Découverte des outils (JSON)\r\n\r\n### Outils Spécialisés\r\n- `GET /api/tools` - Liste des outils disponibles\r\n- `POST /api/execute` - Exécution d'outils\r\n\r\n## 🚀 Déploiement\r\n\r\n### Smithery (SDK Python) — Recommandé\r\n1. Vérifiez que `pyproject.toml` contient:\r\n   - `[tool.smithery] server = \"supabase_mcp_server.server:create_server\"`\r\n2. Dans Smithery → Deploy, sélectionnez SDK Python\r\n3. Configurez le Test Profile puis lancez le Scan\r\n   - Requis: `SUPABASE_URL`, `SUPABASE_ANON_KEY`\r\n\r\n### Railway (Self-hosted)\r\n```bash\r\n# Déployer sur Railway\r\nrailway login\r\nrailway init\r\nrailway up\r\n```\r\n\r\n### Docker\r\n```bash\r\n# Build et déploiement\r\ndocker build -t supabase-mcp-server .\r\ndocker run -p 8000:8000 supabase-mcp-server\r\n```\r\n\r\n### Intégration avec Hub Central\r\n\r\nCe serveur est conçu pour être intégré avec le [MCP Hub Central](https://github.com/coupaul/mcp-hub-central) :\r\n\r\n```json\r\n{\r\n  \"servers\": {\r\n    \"supabase\": {\r\n      \"name\": \"Supabase MCP Server\",\r\n      \"host\": \"supabase.mcp.coupaul.fr\",\r\n      \"port\": 8000,\r\n      \"path\": \"/\",\r\n      \"categories\": [\"database\", \"auth\", \"storage\", \"realtime\", \"security\", \"migration\", \"monitoring\", \"performance\"]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n## 🧪 Test Profile (Smithery)\r\n\r\nLors de la connexion côté Smithery, fournissez les clés suivantes dans le Test Profile:\r\n\r\n```json\r\n{\r\n  \"SUPABASE_URL\": \"https://your-project.supabase.co\",\r\n  \"SUPABASE_ANON_KEY\": \"eyJ...\"\r\n}\r\n```\r\n\r\nEn cas de cache, re-sauvegardez le profil et relancez le Scan.\r\n\r\n## 🔒 Sécurité\r\n\r\n- **Validation des entrées** pour prévenir les injections SQL\r\n- **Rate limiting** par IP et utilisateur\r\n- **Audit logs** de toutes les opérations\r\n- **Chiffrement HTTPS** obligatoire en production\r\n- **Gestion des secrets** sécurisée\r\n- **Politiques RLS** pour la sécurité des données\r\n\r\n## 📊 Monitoring\r\n\r\nLe serveur fournit un monitoring complet :\r\n\r\n- **Métriques de performance** en temps réel\r\n- **Logs structurés** avec niveaux configurables\r\n- **Health checks** automatiques\r\n- **Alertes** en cas de problème\r\n- **Tableau de bord** métriques\r\n- **Analyse de performance** détaillée\r\n\r\n## 🤝 Contribution\r\n\r\n1. Fork le repository\r\n2. Créer une branche feature (`git checkout -b feature/amazing-feature`)\r\n3. Commit vos changements (`git commit -m 'Add amazing feature'`)\r\n4. Push vers la branche (`git push origin feature/amazing-feature`)\r\n5. Ouvrir une Pull Request\r\n\r\n## 📄 Licence\r\n\r\nCe projet est sous licence MIT. Voir le fichier [LICENSE](LICENSE) pour plus de détails.\r\n\r\n## 🙏 Remerciements\r\n\r\n- [Supabase](https://supabase.com/) pour la plateforme\r\n- [Smithery](https://smithery.ai) pour l'écosystème MCP\r\n- La communauté Supabase pour les contributions\r\n\r\n## 📞 Support\r\n\r\n- 📧 Email : contact@coupaul.fr\r\n- 💬 Discord : [Serveur MCP Community](https://discord.gg/mcp)\r\n- 🐛 Issues : [GitHub Issues](https://github.com/MisterSandFR/Supabase-MCP-SelfHosted/issues)\r\n\r\n---\r\n\r\n**Fait avec ❤️ par [coupaul](https://github.com/coupaul)**",
  "bytes": 8746,
  "sha": "6c962882f89f23a245448d32a78e178c7bdb6445aa2f408573585f22c5f2d109",
  "repo_slug": "mistersandfr/supabase-mcp-selfhosted",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_ai_smithery_mistersandfr_supabase_mcp_se_3fe4c2dd/readme"
}