Supabase MCP HTTP Server
README.md
# š Supabase MCP HTTP Server
Production-ready HTTP MCP server for Supabase with **43 tools** for complete database control.
## Features
- ā
**No hardcoded credentials** - Pass credentials per request
- ā
**43 Supabase tools** - Complete database, storage, auth, admin control
- ā
**HTTP API** - Ready for n8n integration
- ā
**Railway ready** - One-click deploy
- ā
**Production ready** - Health checks, CORS enabled
## š All 43 Tools
### Database (13)
- query, list_tables, get_table_schema, create_table, alter_table
- drop_table, insert_data, query_table, update_data, delete_data
- list_views, list_triggers, list_indexes
### RPC (2)
- call_rpc, list_functions
### Storage (8)
- list_buckets, create_bucket, delete_bucket, list_files
- upload_file, download_file, delete_file, get_public_url
### Auth (7)
- list_users, get_user, create_user, update_user
- delete_user, invite_user, reset_password
### Edge Functions (3)
- list_edge_functions, invoke_edge_function, get_function_logs
### Monitoring (3)
- get_table_stats, get_database_size, get_connection_info
### Admin (7)
- execute_migration, list_policies, create_policy
- list_extensions, enable_extension
## š Deploy to Railway
1. Push to GitHub
2. Connect Railway to your repo
3. Deploy - Railway will auto-detect Node.js app
4. Your MCP server will be available at `https://your-app.railway.app`
## š§ n8n Integration
Use in n8n AI Agent as MCP Tool:
1. Add MCP Tools node
2. Set endpoint: `https://your-app.railway.app`
3. Pass credentials in each request:
```json
{
"supabase_url": "https://your-project.supabase.co",
"supabase_key": "your-service-role-key"
}
```
## š” API Usage
### List Tools
```bash
curl -X POST https://your-app.railway.app/ \
-H "Content-Type: application/json" \
-d '{"method": "tools/list"}'
```
### Call Tool
```bash
curl -X POST https://your-app.railway.app/ \
-H "Content-Type: application/json" \
-d '{
"method": "tools/call",
"params": {
"name": "supabase:list_tables",
"arguments": {},
"supabase_url": "YOUR_URL",
"supabase_key": "YOUR_KEY"
}
}'
```
### Health Check
```bash
curl https://your-app.railway.app/health
```
## šļø Local Development
```bash
# Install
npm install
# Build
npm run build
# Run
npm start
```
Server runs on `http://localhost:3000`
## š Security
- No credentials stored in code
- Each request requires credentials
- Service role key for full admin access
- CORS enabled for browser usage
## š¦ Repository Structure
```
āāā src/
ā āāā server.ts # Main HTTP server
āāā dist/ # Compiled JS
āāā package.json
āāā tsconfig.json
āāā railway.json # Railway config
āāā README.md
```
## ⨠Ready for Production
This server is production-ready:
- Health checks at `/health`
- Error handling
- TypeScript types
- No hardcoded secrets
- Railway optimized
---
Built for n8n AI Agents š¤