---
title: "Connect while to Cursor over MCP to deploy your apps"
url: https://while.sh/en/guides/connect-cursor/
author: "Aloïs Oddon, co-founder of Nextmap"
updated: 2026-11-02
---

# Connect while to Cursor over MCP to deploy your apps

Cursor's agent already writes your app. Connected to while over MCP, it also deploys it, with its database and who can open it, and asks for your approval on what matters.

## Prerequisites

- Cursor, installed on your computer.
- A browser, to authorize your agent once.

## Step 1: Connect while to Cursor

Add while to Cursor's list of MCP servers (source 1):

```json titre="~/.cursor/mcp.json"
{
  "mcpServers": {
    "while": { "url": "https://app.while.sh/mcp" }
  }
}
```

If the file already exists, just add the "while" line inside `mcpServers`.

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

Cursor's agent then sees while's tools: deploy, create a database, read the logs, query the database, open a preview, roll back. Cursor shows you each call before it runs.

## 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, 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:

```sh titre="Terminal"
curl -fsSL https://app.while.sh/install.sh | sh
```

## Next steps

- [Deploy a Node.js API and its PostgreSQL database](/en/guides/deploy-node-api-postgresql/)
- [Deploy a Next.js app](/en/guides/deploy-nextjs/)
- [Compare the hosts that have an MCP server](/en/comparisons/mcp-hosting-claude-code/)

## Sources

1. [Cursor, MCP servers](https://cursor.com/docs/mcp), 2026-11-02

## Questions

### Do I need a token?

No: your agent gets authorized in your browser, once. For a CI without a browser, a token takes its place: your agent creates it, and you confirm it in one click.

### Does my agent see my keys?

No: your keys stay in while, and calls to an external API go through while, which adds the key.

### What can my agent do without me?

It can deploy, and read the logs and the database. Sensitive actions, like deleting a production database, wait for your approval.
