Skip to main content
Glama
README.md•3.25 kB
# Supabase MCP Server Full-featured MCP (Model Context Protocol) server for Supabase with CRUD operations, SQL queries, RPC functions, and storage management. ## šŸš€ Features - āœ… **CRUD Operations**: Query, Insert, Update, Delete, Upsert - āœ… **Raw SQL Queries**: Execute custom SQL - āœ… **RPC Functions**: Call stored procedures - āœ… **Storage Management**: Upload and list files - āœ… **Claude Desktop Compatible**: Full MCP protocol support - āœ… **n8n Compatible**: REST API endpoints - āœ… **Universal**: Works with any Supabase project ## šŸ“¦ Installation ### Local Development ```bash pip install -r requirements.txt python server.py ``` ### Railway Deployment 1. Create new project on Railway 2. Connect your GitHub repository or deploy directly 3. Railway will auto-detect and deploy using the Procfile ## šŸ”§ Usage ### MCP Protocol (Claude Desktop) **List Tools:** ```bash POST /mcp/tools/list ``` **Call Tool:** ```json POST /mcp/tools/call { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "supabase_query", "arguments": { "credentials": { "url": "https://your-project.supabase.co", "anon_key": "your-anon-key", "service_key": "your-service-key" }, "table": "users", "select": "*", "filters": {"status": "active"}, "limit": 10 } } } ``` ### REST API (n8n, Postman, etc.) **Query:** ```json POST /api/query { "credentials": { "url": "https://your-project.supabase.co", "service_key": "your-service-key" }, "table": "users", "select": "*", "limit": 10 } ``` ## šŸ› ļø Available Tools ### 1. supabase_query Query data with filters, pagination, and ordering. ### 2. supabase_insert Insert single or multiple rows. ### 3. supabase_update Update rows matching filters. ### 4. supabase_delete Delete rows matching filters. ### 5. supabase_upsert Insert new or update existing rows. ### 6. supabase_sql Execute raw SQL queries (requires service_key). ### 7. supabase_rpc Call Supabase RPC functions. ### 8. supabase_storage_upload Upload files to Supabase Storage. ### 9. supabase_storage_list List files in storage bucket. ## šŸ” Authentication You can provide either: - `anon_key`: For public/authenticated access - `service_key`: For admin access (bypasses RLS) ## šŸ“ Examples ### Filter Examples ```json // Simple equality {"filters": {"id": "1"}} // Greater than {"filters": {"age": {"gt": "18"}}} // Like pattern {"filters": {"name": {"like": "*John*"}}} // In list {"filters": {"status": {"in": "(active,pending)"}}} // Multiple filters {"filters": { "age": {"gte": "18"}, "status": "active" }} ``` ### Ordering ```json {"order": "created_at.desc"} {"order": "name.asc,age.desc"} ``` ### RPC Call ```json { "credentials": {...}, "function_name": "get_user_stats", "params": {"user_id": "123"} } ``` ## 🌐 Endpoints - `GET /` - Server info - `GET /health` - Health check - `POST /mcp/tools/list` - List MCP tools - `POST /mcp/tools/call` - Execute MCP tool - `POST /api/query` - REST query - `POST /api/insert` - REST insert - `POST /api/update` - REST update - `POST /api/delete` - REST delete - `POST /api/rpc` - REST RPC call ## šŸ“„ License MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/romankonoplinai-arch/mcp_supabase'

If you have feedback or need assistance with the MCP directory API, please join our Discord server