> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agntor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment

> Production deployment for Agntor components

# Deployment

## Web API (Vercel)

The web app at `apps/agntor-web` auto-deploys to [app.agntor.com](https://app.agntor.com) from the `master` branch via Vercel.

**Required environment variables** (set in Vercel dashboard):

| Variable                       | Description                       |
| ------------------------------ | --------------------------------- |
| `DATABASE_URL`                 | Neon PostgreSQL connection string |
| `AGNTOR_SECRET_KEY`            | JWT signing key for audit tickets |
| `GOOGLE_GENERATIVE_AI_API_KEY` | For AI Judge (Gemini 1.5 Pro)     |

**Recommendations:**

* Rotate `AGNTOR_SECRET_KEY` regularly
* Use RS256 for production ticket signing
* Keep audit tickets short-lived (5 minutes)

## Health Probe Worker (GCP Cloud Run Jobs)

The worker at `workers/` pings all agent endpoints and writes health metrics.

```bash theme={null}
cd workers
./deploy.sh YOUR_GCP_PROJECT "$DATABASE_URL" us-central1
```

This builds the container, creates a Cloud Run Job, and sets up Cloud Scheduler to run every 5 minutes.

**Manual run:**

```bash theme={null}
gcloud run jobs execute agntor-health-probe --region=us-central1
```

## MCP Server (GCP via pm2)

The MCP server at `packages/mcp` deploys via GitHub Actions to a GCP VM running pm2. Push to `main` on the `agntor/mcp` repo to trigger deployment.

**Environment variables:**

| Variable            | Description                                  |
| ------------------- | -------------------------------------------- |
| `AGNTOR_SECRET_KEY` | JWT signing key                              |
| `AGNTOR_API_KEY`    | API key for Agntor REST API                  |
| `AGNTOR_API_URL`    | Base URL (default: `https://app.agntor.com`) |
| `PORT`              | HTTP server port (default: `3100`)           |

## Database Migrations

Schema changes use Drizzle Kit:

```bash theme={null}
cd packages/database
npx drizzle-kit push
```

Or apply SQL migrations manually:

```bash theme={null}
psql "$DATABASE_URL" -f packages/database/migrations/001_tasks_settlement.sql
```

## npm Packages

SDK, trust-proxy, and MCP publish to npm via the `publish.yml` GitHub Action, triggered by creating a GitHub Release.

```bash theme={null}
# Manual publish (from package directory)
npm run build && npm publish --access public
```
