Deploy from Claude Code to a live URL

Claude Code writes the app. The database, public URL, backups, and rollback come after. Connect one MCP server, sign in once, and the same agent that wrote the code deploys it to a live HTTPS URL with Postgres.

By NEXUS AI Team • • AI Deployments

# Deploy from Claude Code to a live URL

**Published:** September 2, 2026
**Category:** AI Deployments ยท MCP
**Reading time:** 6 minutes
**Author:** NEXUS AI Team

---

**Claude Code can write a working app in a session. The gap is everything after the agent stops generating: a database, secrets, a public URL, backups, and a rollback path.**

NEXUS AI is the deploy layer for that session. You add one MCP server, sign in once, and paste one prompt. The same agent that wrote the code calls `nexusai_deploy_source`. About five minutes later you have a live URL.

This is the Claude Code path. Cursor, Claude Desktop, and Codex use the same MCP server and the same sign-in. See [Connect NEXUS AI MCP in your editor](https://nexusai.run/docs#mcp-claude-cursor-codex-setup).

## What you need

- A NEXUS AI account ([start free](https://nexusai.run/pricing))
- Claude Code installed and signed in
- An app in a Git repo Claude Code can see (GitHub is the usual case)

No API key to copy. Claude Code runs an OAuth sign-in the first time it connects, and you approve exactly the access you want the agent to have.

## 1. Add the NEXUS AI MCP server

In the project directory:

```bash
claude mcp add --transport http nexus-ai https://mcp.nexusai.run/mcp
```

`--transport http` has to come before the server name. Without it, Claude Code treats the entry as a stdio command and the connection fails.

The first time an agent session uses the server, Claude Code opens a browser tab on `mcp.nexusai.run`, you sign in to NEXUS AI, and you approve the scopes. Claude Code stores the token locally, not in your repo, and refreshes it for you (access tokens last an hour). You can also start the sign-in by hand: run `/mcp` in a session, select `nexus-ai`, then **Authenticate**.

**Approve only what the agent needs.** To watch first, `deployments:read` and `deployments:logs` are enough. For the deploy in step 2, add `deployments:create`. Add `secrets:manage` when you want the agent to write secrets, and `db:admin` for database backups, restores, and applied schema fixes. Leave the delete scopes (`deployments:delete`, `buckets:delete`, `volumes:delete`, `db:source:delete`) off unless you specifically want them.

**Share the server with a team.** Add `--scope project` and Claude Code writes `.mcp.json` at the repo root:

```json
{
  "mcpServers": {
    "nexus-ai": {
      "type": "http",
      "url": "https://mcp.nexusai.run/mcp"
    }
  }
}
```

Commit that file. No token goes in it. Each teammate does the OAuth sign-in once on their own machine.

**Confirm it connected.** Inside a session, `/mcp` should show `nexus-ai` as connected, not failed. Then check the identity:

> Call `nexusai_whoami` and tell me which tenant I am connected to.

If it shows as failed, the usual causes are a missing `--transport http`, the wrong host, or a declined or expired sign-in. Re-run `/mcp` and choose Authenticate. To disconnect entirely, `claude mcp remove nexus-ai`.

## 2. Paste this prompt

Open Claude Code in the repo and send:

> Deploy this repo to NEXUS AI with Postgres and Redis. Detect the framework and start command from the project. Wait until the deployment is healthy, then give me the public HTTPS URL, the deployment ID, and the masked database host. Do not write a Dockerfile unless the build fails.

What the agent should call:

1. `nexusai_projects_list` (or create a project)
2. `nexusai_deploy_source` with the Git URL, the detected framework, and `services: ["postgresql", "redis"]`
3. `nexusai_deploy_status` until healthy
4. `nexusai_deploy_logs` if the build fails

You did not open a cloud console. You did not write compose YAML. The agent already has the repo context.

Postgres and Redis run as sidecars on the NEXUS managed container platform, with `DATABASE_URL` and `REDIS_URL` injected automatically. If you target a single-container cloud runtime instead (App Runner, Cloud Run, Container Apps), Postgres becomes a managed instance and Redis is not available there.

If the app needs uploads, follow with:

> Create a bucket called `user-uploads`, attach it to this deployment, and redeploy so the app gets `S3_ENDPOINT`, `S3_BUCKET`, `S3_ACCESS_KEY`, and `S3_SECRET_KEY`.

That is `nexusai_bucket_create`, `nexusai_bucket_attach`, then `nexusai_deploy_redeploy`. The attach step needs `buckets:manage`.

## 3. Operate from the same session

These are the next prompts worth saving.

**Snapshot before a migration**

> Before you run the migration, take a Postgres backup of this deployment. If the migration fails, restore that backup and roll back the deploy.

**Triage a 500**

> Tail the last 200 log lines for this deployment, name the failure, and fix it. If it is a missing secret, create it in the vault and redeploy.

**Roll back**

> Snapshot Postgres, then roll this deployment back to the previous release. Confirm it is healthy.

Backups and rollback are safe operations. The tools that overwrite or delete data (`nexusai_db_restore`, `nexusai_db_apply_fix`, `nexusai_deploy_delete`, bucket and volume delete) carry a destructive hint, so Claude Code asks you to confirm each call before it runs. SQL that writes rows or changes schema also needs an explicit `confirmed: true`.

## 4. Optional: preview in the builder first

If you want a live preview link before production, ask Claude Code to push the current files with `nexusai_builder_push`, open the preview, then deploy. Pull builder-side edits back with `nexusai_builder_pull`. Same MCP server, no extra install.

## Frequently asked questions

### Does this work if the app was generated in this Claude Code session?

Yes. Push or commit so `nexusai_deploy_source` has a Git URL, or deploy from local source if you use that path. The agent already knows the framework, port, and start command.

### How does authentication work? Is there an API key?

No static key. The MCP server uses OAuth with PKCE. Claude Code registers itself, opens a browser sign-in the first time it connects, and stores a short-lived token locally that it refreshes on its own. You approve the scopes during sign-in and can re-approve a wider set later by running `/mcp` and authenticating again. The personal access tokens at `nexusai.run/settings/tokens` are for the REST API, not the MCP server.

### Is this an MCP gateway?

No. NEXUS AI is an app deploy platform that agents drive over MCP. It is not a gateway for hosting other MCP servers.

### What does the live stack include?

App container, optional Postgres, MySQL, or Mongo, Redis, workers, volumes, S3-compatible buckets, HTTPS, logs, backups, and rollback. Full-stack deploys run on the NEXUS managed container platform. Single-container apps can target AWS App Runner, Google Cloud Run, or Azure Container Apps.

### Can I do this from Cursor or Claude Desktop instead?

Yes. Same MCP URL, same OAuth sign-in. See [Connect NEXUS AI MCP in your editor](https://nexusai.run/docs#mcp-claude-cursor-codex-setup).

### How do I cut off access?

`claude mcp remove nexus-ai` deletes the server and its stored token from that machine. Manage account tokens at [nexusai.run/settings/tokens](https://nexusai.run/settings/tokens).

## Related reading

- [MCP deployment platform](https://nexusai.run/mcp-deployment-platform)
- [Deploy a full-stack app with a database](https://nexusai.run/deploy-full-stack-app)
- [MCP-driven deploys: 5 tasks your Claude agent should be running for you](https://nexusai.run/blog/mcp-driven-deploys-5-tasks-your-claude-agent-should-run)
- [Connect NEXUS AI MCP over OAuth](https://nexusai.run/docs#mcp-oauth-flow)