Leave Railway without rewriting your app, with your AI (2026)
Your customers want their data in France, or you want your AI to deploy for you? Connected to while over MCP, it takes over your Railway app as is, copies the database and deploys it.
By Aloïs Oddon, co-founder of Nextmap. Facts checked on November 19, 2026.
The short version. Over MCP, your AI takes over your Railway app, copies its PostgreSQL database and carries over its variables. Your app then runs in France. What matters, like deleting a database, waits for a person’s approval.
Prerequisites
- An app on Railway, in Node.js, Python or Go, or with its Dockerfile.
- The Railway command line, to read your variables and export the database.
- 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 app’s folder and paste this message into it:
Connect to while with my account (while.sh/agents), then put my app on while.
With your account, your AI adds while’s MCP server itself. On the first call to while, a page opens in your browser: choose “A new app”, then click Authorize.
Step 2: Open your app
Your AI gives you your app’s address, for example https://mon-appli.while.cloud, over HTTPS.
What your AI does
It reads your railway.json or railway.toml, if there is one1, and carries its settings over to while.yaml:
| In railway.json | In while.yaml |
|---|---|
startCommand | the service’s command, command |
healthcheckPath | the health path, health.path |
cronSchedule | a scheduled job, in crons |
dockerfilePath | the service’s Dockerfile, dockerfile |
apiVersion: while/v1
project: mon-appli
services:
- name: web
health:
path: /health
databases:
- name: main

Copy your Railway database
You, to your AI: Copy our Railway database to while.
Your AI exports the database with pg_dump, through the database’s public address (DATABASE_PUBLIC_URL) or through a Railway command-line tunnel, then loads it into while3.
Carry over your variables
You, to your AI: Carry over our Railway variables.
Your AI reads your variables with railway variable list2 and carries them over to while. Sealed variables don’t come out2: those, and your secret keys, you enter yourself in while, and your AI never sees them.
Move to your own domain
You, to your AI: Put the app on www.acme.com.
Your AI declares the domain, you add the DNS records it gives you, and the HTTPS certificate follows.
Go back to the previous version
You, to your AI: Go back to the previous version.
In the 30 minutes after a production release, the previous version comes back in a second. After that, it takes a few seconds.
In the docs: PostgreSQL databases, Scheduled jobs, Custom domain, Versions and rollback and Variables and secrets.
Next steps
Sources
- Railway, config as code (railway.json, railway.toml), accessed November 5, 2026
- Railway, the railway variable command, accessed November 5, 2026
- Railway, backing up and restoring Postgres, accessed November 5, 2026