config.cron + isCron guard + secrets for external connections.
index.ts
Configure secrets
Why it works this way
config.crondefines when it runs. You can have multiple schedules with different timezones.- The guard
if (!ctx.isCron)prevents someone from running the cleanup via HTTP accidentally. config.mcp: false— a maintenance task is not an AI tool.ctx.trigger.crontells you which schedule triggered the execution.