Skip to content

Run a script at a set time with your AI, with no server (2026)

A report every morning, an import every night? Tell your AI the time: connected to while over MCP, it schedules your script, and you always know whether it ran.

By Aloïs Oddon, co-founder of Nextmap. Facts checked on November 19, 2026.

View as Markdown

Run a script at a set time with your AI, with no server: a script at a set time with Claude Code, Cursor or Codex, on while, hosted in France

The short version. Over MCP, your AI schedules your script for whatever time you want. Every run is tracked, and a failure alerts your AI. No server. What matters, like deleting a database, waits for a person’s approval.

Prerequisites

  • A Python, Node.js or Go script, with its requirements.txt, its package.json or its go.mod: your AI adds it if it’s missing.
  • An AI that works in a terminal: Claude Code, Codex, Cursor or Gemini CLI.

Step 1: Give your AI this message

Open your AI in your script’s folder, and paste this message into it:

The message to give your AI
Connect to while with my account (while.sh/agents), then put my app on while.

Your AI adds while’s MCP server itself. If it asks you to, restart it. On the first call to while, a page opens in your browser. In Claude Code, if it doesn’t open, type /mcp, choose while, then Authenticate. On that page, choose “A new app”, then click Authorize.

Step 2: Follow the runs

Your AI tells you when the script will run, and gives you the result of each run.

What your AI does

It writes while.yaml next to your script:

while.yaml
apiVersion: while/v1
project: mon-script
crons:
  - name: rapport
    schedule: "0 7 * * *"
    timezone: Europe/Paris
    command: [python, rapport.py]
    source: .

The schedule reads in one line: 0 7 * * * means every day at 7 am1. A run that ends with exit code 0 has succeeded.

A script at a set time with while: credentials kept out of the AI's reach, every call logged in the history, a person's approval for what matters and a daily backup, in France
Around every app, while keeps the credentials, the history, the approvals and the backups.

Run the script right now

You, to your AI: Run the report now.

Your AI starts a run without waiting for the scheduled time, and gives you its result.

Know whether everything went well

You, to your AI: Did this morning’s report go out?

Every run is recorded with its duration, its exit code and the last lines of its log. A run that fails or is missed alerts your AI.

Catch up on a missed period

You, to your AI: Rerun the import for the last three days.

Your AI reruns the job over that period: your script receives its start and end dates, and your AI writes it to process only those dates.

Add a database

You, to your AI: Add a PostgreSQL database.

Your AI declares the database in while.yaml, and its address reaches your code in DATABASE_URL. The database is backed up every day, with a way back to a precise moment over 14 days.

In the docs: Scheduled jobs, Data projects, PostgreSQL databases and Valkey cache (Redis).

Next steps

Sources

  1. The Linux manual, crontab(5), the five fields of a cron line, accessed November 1, 2026

Questions

Can my script read my app’s database?

Yes, it receives the same variables as your app, database address included.

Who can open my script from the internet?

Nobody: a scheduled job has no public address.

In which time zone?

The one you choose, Paris time by default.

Where do my app and its data run?

In France, at Nextmap. The database is backed up every day, with a way back over 14 days, once a person approves.

Does my AI see my credentials?

No. You paste them into while, the app uses them, and your AI never sees them. Every call is logged.

Give your AI the message, and it takes care of the rest

Give this to your AI

Read while.sh/agents and help me get started with while.

Copy the message

In 3 minutes, with no sign-up, the tool has its own address. To keep it, create your account.

For a company project, write to the while team: hello@while.sh