# Deploy an app built with Cursor

You’ve built your app with Cursor’s agent and want it live. Add the **Salus MCP server** to Cursor and the agent can deploy the repository itself, under the rules your organization sets on Salus: it creates the project, follows the pipeline, adds a database and hands you the URL.

## Before you begin

-   A Salus account. [Start free](https://app.salus.cloud/register).
-   **GitHub or GitLab connected** to your Salus organization, with the code pushed. Salus builds from the repository and can’t create one for you. See [Git Management](https://salus.cloud/docs/getting-started/git-management/).
-   An app that serves HTTP on a fixed port. Salus sends traffic to the port in the release configuration (**8080** when an agent creates it) and doesn’t set a `PORT` variable, so an app that falls back to a default such as 3000 listens there.

### Install the Salus CLI

```bash
curl -fsSL https://download.salus.cloud/install.sh | bash
```

The MCP server is part of the `salus` binary, installed to `/usr/local/bin/salus`.

### Add Salus to Cursor

Create `.cursor/mcp.json` in the project to share the server with everyone who opens the repository, or `~/.cursor/mcp.json` to have it in every project:

```json
{
  "mcpServers": {
    "salus": {
      "command": "salus",
      "args": ["mcp"]
    }
  }
}
```

Open Cursor’s settings and check the MCP section: `salus` should show as enabled, with its tools listed.

### Sign in

In the agent chat, ask something about Salus, such as “list my Salus projects”. The first call opens your browser to sign in, and the session is reused after that.

### Ask the agent to deploy

Push the code, then ask in the agent chat:

```text
Deploy this repository to Salus, in the Production environment.
The app listens on port 3000. Watch the pipeline and give me the
URL when it's live. If the build fails, read the build logs and fix it.
```

The agent finds your organization, workspace, Git connection, repository and environment, then calls `deploy_repo`. That one call creates the project, attaches a release configuration for the environment and starts the first pipeline. It polls `get_pipeline` through build, tests, vulnerability scanning and deploy, and reads the URL from `list_deployments`.

Cursor asks you to approve each tool call unless you’ve turned on auto-run, so you see every Salus action before it happens. Keep approvals on for anything that deploys or deletes.

### Add a database

```text
Create a PostgreSQL database called orders-db in the same region as
this project's Production environment, link it to the project, and
update the app to read SALUS_DATABASE_ORDERS_DB_CONNECTION_STRING.
```

Linking injects the connection details as environment variables named after the database. See [Connect a Database](https://salus.cloud/docs/deployments/databases/connect/).

## What the agent can reach

Cursor’s agent acts **on your behalf, with your access**: it can’t reach a workspace, project or environment you can’t, and your organization’s release rules and pipeline gates apply to what it deploys. Its deploys appear in the organization’s audit log as made by Salus MCP acting as you.

## Make it the project’s default

Cursor’s agent reads `AGENTS.md` at the root of the repository, alongside any project rules. Add a deployment section so every session deploys the same way:

```markdown
## Deployment

This app deploys to Salus through the Salus MCP server (`salus mcp`).

- Salus builds from the Git repository, so push before you deploy.
- First deploy: `deploy_repo`. It always creates a NEW project, so check
  `list_projects` first; if one exists, use `start_deployment`.
- The app listens on port 8080 (set `port` if that changes).
- Poll `get_pipeline` until it settles; `list_deployments` has the URL.
- Ask a person before anything destructive.
```

## Troubleshooting

-   **The server shows an error in Cursor’s MCP settings.** Cursor couldn’t start the binary. Set `"command"` to the full path, `/usr/local/bin/salus`, and reload.
-   **The pipeline passed but the app won’t load.** The app listens on a different port from the one Salus routes to. Tell the agent the real port, or make the app listen on `8080`.
-   **The build failed and the agent can’t see why.** If `get_build_logs` comes back empty, open the pipeline in the Salus console: each stage has its own logs.
-   **The app keeps restarting.** Check its logs. If it’s running out of memory, ask the agent to raise `memorySize` on the release configuration; new deployments start with **128 MB**, the smallest size, which is enough for a small web app.
-   **Two projects for one repository.** `deploy_repo` always creates a new project. Delete the duplicate and redeploy the original with `start_deployment`.

More prompts to start from: [Use cases & sample prompts](https://salus.cloud/docs/mcp/use-cases/). Using another agent? See [Deploy with an AI coding agent](https://salus.cloud/docs/guides/deploy-with-an-ai-agent/).
