Back to MCP

MCP guides · Sep 15, 2026

Schedule a Lovable Supabase function with Crontap MCP

Let Lovable deploy an idempotent cleanup function, connect Crontap directly, and verify its weekly HTTP schedule from chat.
crontap.com / mcp guides
Build a Supabase Edge Function in Lovable, connect Crontap as a custom OAuth MCP chat connector, and create and verify its weekly HTTP schedule.

As of 2026-11-11, Lovable schedules work natively with Jobs, but only for apps on its built-in backend; on your own Supabase project, Lovable's docs say you set up scheduled work in Supabase. Neither gives you a hosted, recurring HTTP request to your own endpoint with retries, run history and failure alerts. Crontap's MCP server fills that gap as a custom chat connector: Lovable chat previews, creates and checks a Crontap schedule while you build, and Crontap then calls your deployed function on its own clock.

Your Lovable app stores invitation rows in Supabase, and expired invitations need a weekly cleanup. Lovable can build the Edge Function and connect directly to Crontap. The connector is personal to you and helps during the build; it is not bundled into the published app. This guide previews and creates the schedule from Lovable chat, with a Crontap UI fallback if the write tool is not offered.

Before you start

  • Connect a Supabase project to Lovable and create a Crontap account.
  • Custom MCP servers are available on all Lovable plans. A workspace admin can disable them under Connectors, Admin settings, Chat connectors.
  • Store CLEANUP_KEY in Supabase and add the matching request header in the Crontap UI. Do not put its value in chat.
  • Verified against Lovable custom MCP, Lovable Supabase, Lovable Jobs, and Lovable chat connectors on 2026-11-11.

Build the cleanup endpoint in Lovable

Step 1

Create an idempotent Edge Function

In your Lovable project chat, request a Supabase Edge Function named prune-expired-invites. It should accept POST, compare X-Cleanup-Key with the CLEANUP_KEY environment value, delete only rows whose expires_at is in the past, and return scanned and deleted counts. The date predicate makes a repeated request safe.

Create and deploy a Supabase Edge Function named prune-expired-invites. Accept POST only, require X-Cleanup-Key to match CLEANUP_KEY, delete invitation rows where expires_at is in the past, and return JSON with scanned and deleted counts. Make repeated calls safe.

Step 2

Set the function secret and test

Add CLEANUP_KEY to the connected Supabase project as an Edge Function secret. Copy the deployed URL ending in /functions/v1/prune-expired-invites. Call it from a terminal with curl: expect 401 without X-Cleanup-Key, then expect JSON counts when the header value matches. Check the Edge Function logs for both requests.

Connect Crontap in Lovable

Step 3

Add the custom MCP chat connector

Open Connectors, select Add custom in the top right of the catalog, and choose MCP server. Name it Crontap, keep Direct connection, and enter https://mcp.crontap.com/mcp as the Server URL. OAuth is the default authentication choice. Select Add & authorize, complete Crontap consent in the browser, and return to Lovable.

Lovable custom MCP chat connector
Crontap
Connected
Authentication
OAuth 2.1

Lovable static IPs are not needed for Crontap's public MCP server. That option is Enterprise-only and is useful when a custom server sits behind an IP allowlist. The normal Direct connection works here.

Step 4

Confirm read access in Lovable chat

Ask the Crontap connector to list schedules, then preview Sundays at 03:30 in UTC. These calls inspect account data and calculate future times without creating a resource. Check that the connector returns current schedules and three upcoming Sunday occurrences.

Using the Crontap connector, list my schedules. Then preview Sundays at 03:30 in UTC and show the three upcoming runs. Do not create, update, or delete anything.

Create the weekly schedule

Lovable's chat connector docs now say it reads first and, where the tool supports it, can take limited actions such as creating or updating items. Tools the server marks as read-only run without asking. Before any other tool runs, Lovable shows an approval card, so Crontap's create_schedule call waits for you. Review the exact URL, method, timezone, and cadence on that card before approving. Keep the per-tool Always allow option off for writes.

Using the Crontap connector, create one active schedule named "prune expired invites" that POSTs to my deployed prune-expired-invites function URL on the Sunday 03:30 UTC cadence we previewed. Do not add headers or secret values. Show the fields before calling create_schedule.

Step 5

Add the secret, or create in Crontap if needed

Open the new schedule in Crontap and add the endpoint secret as X-Cleanup-Key in the Crontap UI, then perform a test request. If Lovable did not offer create_schedule, create prune expired invites in the same form: the copied Supabase function URL, method POST, cron 30 3 * * 0, and timezone UTC. Return to Lovable chat and list schedules again.

Using the Crontap connector, list schedules and find "prune expired invites". Report its URL, method, timezone, active state, and next run. Do not modify it.

Verify Lovable, Crontap, and Supabase

Lovable should show Crontap in the chat connector list. The first list_schedules call proves OAuth and account access. The preview proves that the Sunday cadence resolves before you save anything. After creation, the second list confirms that Lovable can read the schedule regardless of whether Lovable or the Crontap UI performed the write.

In Crontap, verify POST, the full Supabase production URL, UTC, the Sunday cron, and the active state. The test request should add one successful history entry. Crontap records the HTTP result and duration, not your secret header value.

Finally, open the Supabase Edge Function logs and find the same invocation. Check the invitations table to confirm expired rows disappeared while current rows remained. Perform one more test: a safe cleanup should report no additional deletions instead of touching unrelated data.

Lovable Jobs or Crontap?

Lovable Jobs run scheduled background work for apps on Lovable's built-in backend. Ask Lovable in chat to create or change a job, then review it under More → Database → Manage → Jobs, where you can inspect run history and enable or disable it. In new apps created from 2026-05-13 (TanStack Start), a job calls an API route protected by a LOVABLE_CRON_SECRET project secret; older apps call an Edge Function. This guide's app uses its own Supabase project, where Lovable's docs send you to Supabase for scheduled work.

QuestionLovable JobsCrontap schedule
Which backendBuilt-in backend onlyAny public HTTPS endpoint
Own SupabaseNo, schedule it in SupabaseYes, calls the function URL
How you set it upAsk Lovable in chatLovable chat via MCP, or the UI
Run recordRun history in JobsStatus, code, duration, error
Retries and alertsFailure alerts, no retries documentedPer-schedule retries, email alerts

Last verified 2026-11-11 against Lovable docs. Use Crontap when the operation already has a stable HTTP endpoint, when several deployment providers need one scheduling dashboard, or when you want external HTTP history. Crontap calls the deployed Supabase function; it does not run Lovable chat or make the connector part of your app.

Troubleshooting

MCP server is greyed out

A workspace admin has disabled custom MCP servers. Ask them to enable the Custom MCP row under Connectors, Admin settings, Chat connectors. Remote MCP connectors must also be enabled under Privacy & security.

Add & authorize does not finish

Confirm that OAuth remains selected and the URL is exactly https://mcp.crontap.com/mcp. Remove a failed connection and add it again before repeating browser consent.

Lovable can read but does not offer create

Use the Crontap UI fallback in Step 5, then verify the saved schedule from Lovable chat. If the approval card appeared and you declined it, ask again and approve only the reviewed call.

The function returns 404 or 401

For 404, use the deployed Supabase function URL, not a project preview URL. For 401, compare the Edge Function secret with the request header saved in Crontap.

The cleanup runs twice

Keep the expiry predicate idempotent and avoid enabling both a Lovable Job and a Crontap schedule for the same function.

Next steps

If prune-expired-invites already returns counts from curl, paste its URL into a Sunday 03:30 UTC schedule, add X-Cleanup-Key, and run a test. Schedule your first job →

Verified against current official Lovable documentation on 2026-11-11. Sources: Lovable custom MCP, Lovable chat connectors, Lovable Supabase, and Lovable Jobs.

FAQ

Lovable scheduling questions

Can Lovable connect to a custom OAuth MCP server?
Yes. Lovable documents remote custom MCP chat connectors with OAuth on all plans. The connection is personal and available while building, not inside the published app.
Can Lovable create the Crontap schedule through MCP?
Usually, yes. Lovable's chat connector docs say it can take limited actions such as creating or updating items, and it shows an approval card before any tool the server does not mark as read-only. Review that card for create_schedule. If the tool is not offered, create the schedule in the Crontap UI and verify it from Lovable chat.
Does Lovable have native scheduled jobs?
Yes, for apps on Lovable's built-in backend. Jobs run scheduled background work and show run history under More, Database, Manage, Jobs. On a project connected to your own Supabase project, Lovable's docs say to set up scheduled work in Supabase.
Can the published Lovable app use the chat connector?
No. Lovable says chat connections are build-time context and are not part of the published app. The deployed function receives Crontap's HTTP request directly.

From the blog

Read the blog

Guides, patterns and product updates.

Tutorials on scheduling API calls, webhooks and automations, plus deep dives into cron syntax, timezones and reliability.

Product

Introducing Crontap status pages

Publish uptime monitors and heartbeats on a public page at crontap.page, pick a template from Clean to a split-flap departures board, and add incidents, maintenance and a badge.

Product Updates

Introducing AI Integrations

Transform a schedule's HTTP response with a plain-English prompt, return text or JSON, and forward it to Slack, Make, n8n, or your own endpoint. Test on any tier; saving is a Pro feature.

Alternatives

Vercel cron jobs: the Hobby once-per-day limit and how to beat it

Vercel Cron caps Hobby at one run per day, only guarantees timing within the hour, is UTC only, and ties every schedule change to a redeploy. Here is the external cron pattern teams use to ship per-minute, timezone-aware schedules and one dashboard across projects without paying $20/mo per user for Pro.