1. Install the CLI locally
Install the npm package first. You will use the CLI both for local smoke tests and for generating the final MCP URL with the deployed key.
npm install -g @amxv/agentbox agentbox --version
Deploy your own instance
This guide covers the split-service deployment flow in this repo: npm CLI install, Go backend deploy, Postgres migrations, tenant-scoped API keys, optional dashboard deploy, and the final ChatGPT MCP connection.
The Go backend is the core Agentbox service. The Next.js dashboard is optional and deploys separately when you want a browser inbox.
Full workflow
The commands below follow the current repo deployment shape. Backend and dashboard deploy separately, and the dashboard needs the backend URL wired through AGENTBOX_BACKEND_URL.
1. Install the CLI locally
Install the npm package first. You will use the CLI both for local smoke tests and for generating the final MCP URL with the deployed key.
npm install -g @amxv/agentbox agentbox --version
2. Create your backend inputs
Before deploying, gather a Postgres connection string and Cloudflare R2 credentials. Agentbox stores threads in Postgres and assets in R2.
DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DB?sslmode=require R2_ACCOUNT_ID=<your-r2-account-id> R2_ACCESS_KEY_ID=<your-r2-access-key-id> R2_SECRET_ACCESS_KEY=<your-r2-secret-access-key> R2_BUCKET=<your-r2-bucket>
3. Create the admin key
The backend starts with one admin credential. It is used only for setup and key management, not for normal Agentbox API or MCP traffic.
openssl rand -hex 32 AGENTBOX_ADMIN_KEY="ADMIN_KEY_FROM_OPENSSL"
4. Deploy the Go backend
The backend project owns /api/*, /api/mcp, Postgres, R2, migrations, and the CLI implementation. Use the checked-in Vercel config for the backend project.
vercel link --yes --project agentbox-go vercel --prod --yes -A deploy/vercel/backend/vercel.json
5. Configure backend environment variables
Set the required production environment on the backend project. Optional values can be added only if you need them.
vercel env add DATABASE_URL production vercel env add AGENTBOX_ADMIN_KEY production vercel env add R2_ACCOUNT_ID production vercel env add R2_ACCESS_KEY_ID production vercel env add R2_SECRET_ACCESS_KEY production vercel env add R2_BUCKET production vercel env add AGENTBOX_ENV production
6. Run the migration once
Production should run the explicit migration command instead of relying on AGENTBOX_AUTO_MIGRATE by default.
bun run db:migrate
7. Provision a tenant admin
Use the deployment admin key once to create a tenant, initial tenant admin user, and local tenant-scoped CLI key. The local key is saved to your profile and shown only once.
agentbox provision tenant \ --base-url https://youragentbox.vercel.app \ --admin-key "$AGENTBOX_ADMIN_KEY" \ --tenant-slug default \ --tenant-name Default \ --user-email you@example.com \ --user-name "Your Name" \ --create-cli-key \ --key-name local \ --profile-name prod agentbox doctor agentbox list
8. Deploy the optional web dashboard
The dashboard owns /, /threads, and same-origin proxy routes under app/api/*. It is optional; the Go backend is the required service.
vercel link --yes --project agentbox vercel env rm AGENTBOX_BACKEND_URL production --yes printf 'https://youragentbox.vercel.app' | vercel env add AGENTBOX_BACKEND_URL production vercel --prod --yes -A deploy/vercel/dashboard/vercel.json
9. Manage keys later
Key management normally uses the tenant profile created by provisioning or browser login. The CLI does not rewrite Vercel environment variables.
agentbox login --base-url https://youragentbox.vercel.app --profile-name prod agentbox keys list agentbox keys create worker agentbox raycast-key
10. Save it in ChatGPT
Use the tenant-scoped ChatGPT MCP URL printed by agentbox connect chatgpt. The same remote MCP endpoint also works with Claude custom connectors and other MCP-capable clients.
Apps -> Advanced settings -> turn on developer mode -> Create app -> select no auth -> paste the MCP URL
Backend env
Optional env
On the dashboard project, set AGENTBOX_BACKEND_URL to the deployed Go backend URL so same-origin /api/* requests proxy correctly.
Practical notes
MCP behavior
Agentbox returns the same useful payload in visible JSON text and native structured output so ChatGPT, Claude custom connectors, and simpler MCP clients can all recover IDs, messages, and attachment metadata.
After deploy