Connect while to Gemini CLI over MCP to deploy your apps
Gemini CLI already writes your app. Connected to while over MCP with one command, it also deploys it, with its database and its access rules, and it asks for your approval for what matters.
By Aloïs Oddon, co-founder of Nextmap. Facts checked on November 2, 2026.
Prerequisites
- Gemini CLI, installed on your computer.
- A browser, to authorize your agent once.
Step 1: Connect while to Gemini CLI
In a terminal, run this command1:
gemini mcp add --scope user --transport http while https://app.while.sh/mcp
Or let your agent do it: paste “Connect to while with my account (while.sh/agents), then deploy my app.” into it, and it connects itself.
Step 2: Authorize it in your browser
On the first call to while, a page opens in your browser. Choose “A new app”, then click Authorize.
What your agent does
Gemini CLI then sees while’s tools: deploy, create a database, read the logs, query the database, open a preview and roll back. It asks for your approval before it calls a tool.
Deploy your app
You, to your agent: Deploy my app with while.
Your agent writes while.yaml, sends the code, and gives you your app’s address, over HTTPS. The details are in the guides, from Next.js to Django.
Understand an error
You, to your agent: Why has the app been returning errors since this morning?
Your agent reads the logs and the grouped errors in while, finds the cause and fixes it.
Query your database
You, to your agent: How many people signed up this week?
Your agent reads your database in SQL over MCP, with your permissions on the data, and it can’t write to it.
See a new version before you deploy it
You, to your agent: Show me the new version before you deploy it.
Your agent opens a preview, at its own address, with its own data. You look at it, and then your agent puts it into production.
Go back to the previous version
You, to your agent: Go back to the previous version.
In the 30 minutes after a deployment, the previous version comes back in a second. After that, it takes a few seconds. Once the previous version is back, your agent reads what broke in while’s logs, fixes it and deploys again.
Connect all the agents on your computer
You, to your agent: Connect while to all my agents.
One command connects Claude Code, Codex, Cursor, Gemini CLI and VS Code at once. Read the script first, if you like:
curl -fsSL https://app.while.sh/install.sh | sh
In the docs: Previews and Versions and rollback.
Next steps
Sources
- Gemini CLI, MCP servers, accessed November 2, 2026