Build time vs. runtime
The single most useful thing to understand before you start: the three methods do not compete, they solve different halves of the problem.- The MCP Server is how the Lovable agent understands your data while it builds. It reads your schemas, previews rows, and generates an app grounded in tables that actually exist. It is not used by your app’s end users.
- The Data API and the Supabase destination are how the deployed app gets data at runtime, when a real user opens a page.
Choosing a runtime method
Before you start
Create a Lovable project
Know your plan requirements
Step 1: Shape app-ready tables in Nekt
Whichever method you choose, do this first. An app should read tables that are already shaped the way the screen displays them: one row per data point, columns already named and typed, no joins or heavy aggregation left for runtime. Precomputing in Nekt makes the app faster, keeps the business logic in one governed place, and means you can change what the app shows without touching the app. Paste this into Claude, Codex, or any agent connected to the Nekt MCP Server:app_* table exists and holds the expected rows.
Method 1: Connect the MCP Server
This gives the Lovable agent direct, read-only access to your Catalog while it builds. Instead of inventing a schema, it lists your real tables, previews rows, and writes the UI against columns that exist.Setup
Enable the MCP Server in Nekt
Create a scoped token
app_* tables from Step 1 rather than granting full access, since this token defines everything the agent can read.Add Nekt as a connector in Lovable
- Server name:
Nekt - Server URL: the Endpoint you copied
Confirm the connection
app_* tables come back.Build the app
Paste this into Lovable:Method 2: Query the Data API at runtime
The app calls a small server-side function, that function queries Nekt with SQL, and the results come back as JSON. Your Nekt API key never leaves the server. In a Lovable project, that server-side function is a Supabase Edge Function, which every Lovable project can create.Architecture
Setup
Create a Nekt API key
Ask Lovable to build the Edge Function
NEKT_API_KEY, never as a plain value in the code.Reference: the Data API call and the function Lovable builds
Reference: the Data API call and the function Lovable builds
What to watch out for
- Cache aggressively. The Data API is powered by Athena or BigQuery, so a query takes seconds, not milliseconds. Without caching, every page load pays that cost and requeries data that only changes daily.
- Keep the SQL server-side. The Edge Function should expose a fixed set of named datasets. Accepting SQL from the browser hands any visitor full read access to your Catalog.
- All CSV values are strings. Ask Lovable to cast numbers and dates when parsing. Or use
parquetmode, reviewing the known limitations first. - This is not a transactional API. Filtering and pagination against the Data API on every keystroke will feel slow. That is what Method 3 is for.
Method 3: Send data to Supabase
Nekt writes your tables directly into the Postgres database your Lovable app already uses. The app queries them with its normal Supabase client, with no Nekt-specific code anywhere, and Nekt refreshes them on a schedule. This is the best fit for real applications: filters, search, pagination, and joins against your app’s own tables all work at Postgres speed.Architecture
Setup
Get your Supabase connection details
Whitelist Nekt's IP if needed
203.0.113.42/32. The IP is shown on the connector configuration page in Nekt.Add a Supabase destination in Nekt
Select tables, keys, and schedule
app_* tables from Step 1, define a primary key for each, pick a load method (upsert is the usual choice for app tables), and set how often the data should refresh.See the full Supabase destination guide for load methods, SSL, and record metadata.Run the pipeline
Secure the tables
Tables loaded by Nekt arrive without row level security. If they sit in an API-exposed schema, anyone with your app’s public key can read every row. Paste this into Lovable:Build the app
What to watch out for
- The tables are read-only. Anything the app writes into them is lost on the next sync. Keep app-generated data (user preferences, comments, statuses) in separate tables your app owns, and join to the Nekt tables.
- Match the schedule to the need. The app is exactly as fresh as the last destination run. Hourly for operational screens, daily for reporting is a reasonable starting point.
- Set a primary key you trust. Upsert matches on it. An unstable key produces duplicates.
- Mind the size. Supabase is a Postgres instance, not a warehouse. Aggregate and filter in Nekt in Step 1 rather than syncing raw tables of tens of millions of rows.
Putting it together
For most projects, the full flow looks like this:Shape the tables in Nekt
app_* tables (Step 1).Connect MCP so Lovable builds on real schemas
Pick a runtime path
Secure and publish
Keeping it fresh
Your app now updates itself. Scheduled Queries refresh the tables in Nekt, and the destination or the Edge Function carries the new data to the app.- Change what it shows: update the Nekt Query. The app picks up the new values with no redeploy.
- Change the shape of a table: update the Query, then tell Lovable which columns changed.
- Change how it looks: prompt Lovable and republish.