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.

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 as a custom MCP chat connector. The connector is personal to you and helps during the build; it is not bundled into the published app. This guide uses Lovable chat for read-only schedule previews and verification, then gives a clear Crontap UI fallback because Lovable's current custom MCP documentation describes reading live context, not arbitrary write-tool execution.

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, and Lovable Jobs on 2026-09-15.

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 the plus button 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 custom MCP page says a connected server can provide live context while you build. It does not currently promise that custom connector write tools execute. If Lovable presents Crontap's create_schedule tool and asks you to confirm the write, review the exact URL, method, timezone, and cadence before approving it. If the tool is unavailable or Lovable declines the write, use this documented fallback instead of changing clients.

Step 5

Create in Crontap when writes are unavailable

Open the Crontap schedule form and create prune expired invites. Set the copied Supabase function URL, method POST, cron 30 3 * * 0, and timezone UTC. Add the endpoint secret as X-Cleanup-Key in the Crontap UI, save, and perform a test request. Return to Lovable chat and list schedules again to verify the saved fields.

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?

Use Lovable Cloud Jobs when the app uses Lovable's built-in Cloud backend and the task should run there. Ask Lovable in chat to create or change a job. Review it under More, Cloud, Jobs, where you can inspect history and enable or disable it.

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.

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 Cloud Job and a Crontap schedule for the same function.

Next steps

Ready to schedule the published function? Free forever tier. No credit card. Create your Crontap account →

Verified against current official Lovable documentation on 2026-09-15. Sources: Lovable custom MCP, 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?
Lovable's custom MCP page documents live read context but does not promise arbitrary write execution. If create_schedule is unavailable or declined, create the schedule in the Crontap UI and verify it from Lovable chat.
Does Lovable have native scheduled jobs?
Yes. Lovable Cloud Jobs can run recurring backend tasks and expose run history under More, Cloud, Jobs. Use them when the work should stay entirely in Lovable Cloud.
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 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.