# Deploy a website from Cursor

Ask Cursor's agent to deploy and get a live URL: a project rule or the MCP server, one command, no prompts. No account needed to try it.

On the web at https://lobsite.com/hosting/cursor

```sh
npx -y lobsite --yes
```

Cursor's agent runs this in the terminal; it never stops to ask a question.

Cursor's agent can build a site and run commands, so it can deploy one too. Tell it "deploy this with Lobsite" and it runs `npx -y lobsite --yes` in the terminal: the built folder goes online and the agent comes back with the address and a link that keeps the site. A project rule makes that the default for every chat.

## How it works

1. **Ask the agent to deploy**, in Agent mode. It builds the project, then runs `npx -y lobsite --yes`.
2. **The CLI sees it's under Cursor** (from the `CURSOR_AGENT` variable), so it never waits for an answer that wouldn't come, and prints plain lines.
3. **The agent tells you the URL and the claim link.** The site lasts 6 hours; open the link and sign in to keep it at the same address.

## A project rule

Rules tell Cursor's agent how this project works. Save this as `.cursor/rules/deploy.mdc`:

```md
---
description: How to deploy this site
alwaysApply: false
---

This site deploys with Lobsite. Build it, then from the project folder run:

    npx -y lobsite --yes

- Tell the user the URL, and relay the "Tell the user:" line from the output word for word.
- lobsite.toml remembers the site, so the same command updates it. Use --preview to deploy
  without changing the live site.
- If a deploy fails, follow the fix in the error message. Never pass --include-secrets.
```

With `alwaysApply: false` the agent reads it when the chat is about deploying. Commit `lobsite.toml` after the first deploy, so the whole team's agents update the same site.

## Or the MCP server

Add the server to `.cursor/mcp.json` in the project (or to `~/.cursor/mcp.json` for every project):

```json
{ "mcpServers": { "lobsite": { "command": "npx", "args": ["-y", "lobsite@latest", "mcp"] } } }
```

Cursor then lists six tools: `deploy`, `list_sites`, `list_deploys`, `rollback`, `promote` and `whoami`. The agent calls them instead of the terminal, so there's no command to approve, and it can answer "what's live right now?" or "roll back the last deploy".

## Terminal, rule or MCP: which to use

| | Terminal command | Project rule | MCP server |
|---|---|---|---|
| Set-up | None | One file in `.cursor/rules/` | One entry in `.cursor/mcp.json` |
| Approval in Cursor | Each run, unless you allow the command | Each run, unless you allow the command | Per tool, the first time |
| Roll back, list deploys | Yes, with more commands | Yes, with more commands | Yes, as tools |
| Shared with the team | No | Yes, committed | Yes, if `.cursor/mcp.json` is committed |
| Needs Node | Yes | Yes | Yes |

All three deploy the same way and to the same site. Without Node, the agent can send a page with `curl` instead; see [AI agents](https://lobsite.com/docs/agents#curl).

## Frequently asked questions

### Does the agent get stuck on a prompt?

No. Under Cursor the CLI never asks anything: a first deploy prints its summary and carries on, and anything that can't be undone needs `--yes`. That's why the command includes it.

### Can it deploy to my account instead of a temporary site?

Yes. Run `npx lobsite login` once in Cursor's terminal yourself; it opens a browser to sign in. After that the agent's deploys go to your account, and `lobsite.toml` remembers the site.

### Which folder does it upload?

The first of `dist/`, `build/`, `out/`, `_site/` or `public/`, or the folder named in `lobsite.toml`. Secret files such as `.env` are never uploaded: they stop the deploy until they're ignored.

### Does every deploy upload the whole site again?

No. Files are compared by their hash, and only the ones that changed upload, so redeploying after a small change takes a moment.

### Is there a Cursor extension?

No extension is needed: the CLI and the MCP server are the whole integration.

