Nexlayer MCP — Better Docs
All MCP tools, parameters, and guides in one place. The reference the official docs should have been.
Nexlayer is an AI-native deployment platform. It exposes a Model Context Protocol (MCP) server so your AI coding assistant (Claude Code, Cursor, etc.) can deploy and manage containerized applications directly from conversation.
The official docs describe what tools exist. This reference tells you exactly how to call them — parameters, types, responses, and copy-paste examples.
Quick Install
Auto-detects all installed AI coding tools and configures them simultaneously.
npx @nexlayer/mcp-install
Claude Code — Manual Setup
Add the Nexlayer MCP server to your Claude Code settings:
{
"mcpServers": {
"nexlayer": {
"type": "http",
"url": "https://mcp.nexlayer.ai/api/mcp"
}
}
}
WebSocket Bridge (for Claude Code ≤ native ws)
Claude Code supports stdio, sse, and http transports. If you need WebSocket:
npx nexlayer-mcp-ws@latest install
Or manually:
# Install bridge globally npm install -g nexlayer-mcp-ws # Register with Claude Code claude mcp add nexlayer-mcp -- nexlayer-mcp-ws # With auth token claude mcp add -e NEXLAYER_MCP_TOKEN=your-token nexlayer-mcp -- nexlayer-mcp-ws
Claude Code ↔ stdio ↔ nexlayer-mcp-ws ↔ WebSocket ↔ wss://mcp.nexlayer.ai/api/ws. Auto-reconnects with exponential backoff. Keep-alive pings every 30s.
Verify Installation
After setup, ask your AI assistant: "List my Nexlayer deployments". If the MCP is connected, it will call the tools and respond with your deployment list.
Quickstart
Deploy a containerized app to a live URL in under 60 seconds.
1. Write nexlayer.yaml
application: name: my-app pods: - name: web image: nginx:alpine path: / servicePorts: [80]
2. Ask Claude to deploy
# In your Claude Code session:
Deploy my-app using this nexlayer.yaml
Claude calls deploy_application and returns a live URL like jolly-tapir-my-app.cloud.nexlayer.ai.
3. Check status & logs
# Ask Claude:
What's the status of my-app?
Show me logs for my-app
MCP Tools Reference
The Nexlayer MCP server exposes these tools to AI assistants. Each tool maps to an action on your deployments.
| Parameter | Type | Required | Description |
|---|---|---|---|
| yaml_config | string | required | Full nexlayer.yaml content as a string |
| session_token | string | optional | Existing session token to associate the deployment with your account. Omit for anonymous/preview deployments. |
Returns
{
"message": "Deployment started successfully",
"url": "https://jolly-tapir-my-app.cloud.nexlayer.ai",
"sessionToken": "dCf0NdAQ64j6",
"applicationName": "my-app",
"environment": "jolly-tapir",
"status": "starting"
}
The sessionToken in the response is required for all subsequent management calls. Store it securely — you'll need it to update, extend, or delete this deployment.
Example — Claude prompt
# Claude will read your nexlayer.yaml and call deploy_application automatically
Deploy the application defined in my nexlayer.yaml
Example — API equivalent
curl -X POST https://app.nexlayer.com/startUserDeployment \
-H "Content-Type: text/x-yaml" \
--data-binary @nexlayer.yaml
| Parameter | Type | Required | Description |
|---|---|---|---|
| application_name | string | required | Name of the application (from nexlayer.yaml application.name) |
| session_token | string | required | Session token from the deploy response |
Returns
{
"applicationName": "my-app",
"status": "running", // starting | running | error | stopped
"url": "https://jolly-tapir-my-app.cloud.nexlayer.ai",
"pods": [
{
"name": "web",
"status": "running",
"image": "nginx:alpine"
}
]
}
Example prompt
What's the deployment status of my-app?
| Parameter | Type | Required | Description |
|---|---|---|---|
| application_name | string | required | Application name |
| session_token | string | required | Session token |
| pod_name | string | optional | Filter logs to a specific pod. Omit to get logs from all pods. |
| tail | number | optional | Number of recent log lines to return. Default: 100. |
Example prompts
# All pods Show me logs for my-app # Specific pod Show logs for the api pod in my-app # Debug: look for errors Get the last 200 log lines from my-app and look for errors
| Parameter | Type | Required | Description |
|---|---|---|---|
| application_name | string | required | Application name |
| domain | string | required | Custom domain (e.g., www.mysite.com or mysite.com) |
| session_token | string | required | Session token |
DNS Records Required
For subdomains (www.example.com):
Type: CNAME Name: www Value: cname.nexlayer.dev
For root domains (example.com):
Type: A | Name: @ | Value: 76.76.21.21 Type: CNAME | Name: www | Value: cname.nexlayer.dev
Let's Encrypt certificates are provisioned and renewed automatically. No manual configuration needed.
Alternative — nexlayer.yaml
application: name: my-app url: www.mysite.com # custom domain goes here
| Parameter | Type | Required | Description |
|---|---|---|---|
| application_name | string | required | Application name |
| session_token | string | required | Session token |
| key | string | required | Environment variable name (e.g., DATABASE_URL) |
| value | string | required | Value to set. The deployment restarts automatically. |
| pod_name | string | optional | Target a specific pod. Omit to set across all pods. |
Example prompts
# Set a secret Set DATABASE_URL to postgres://user:[email protected]:5432/mydb for my-app # Update API key Update the OPENAI_API_KEY env var for the api pod in my-app
Setting or updating an env var triggers a rolling restart of the affected pods.
Inline in nexlayer.yaml
pods: - name: api vars: DATABASE_URL: "postgres://user:[email protected]:5432/mydb" REDIS_URL: "redis://redis.pod:6379" NODE_ENV: production
| Parameter | Type | Required | Description |
|---|---|---|---|
| application_name | string | required | Application name |
| pod_name | string | required | Pod to scale |
| replicas | number | required | Target replica count. Setting a fixed value disables auto-scaling for this pod. |
| session_token | string | required | Session token |
Example prompts
# Scale up API tier Scale the api pod in my-app to 3 replicas # Scale back down Set my-app api pod to 1 replica
In nexlayer.yaml
pods: - name: api replicas: 3 # fixed — disables auto-scale resources: cpu: "2" # 2 CPU cores memory: "4Gi" # 4 GB RAM
| Parameter | Type | Required | Description |
|---|---|---|---|
| session_token | string | required | Session token to list deployments for |
Returns
[
{
"applicationName": "my-app",
"status": "running",
"url": "https://jolly-tapir-my-app.cloud.nexlayer.ai",
"createdAt": "2026-04-25T10:00:00Z",
"expiresAt": "2026-04-27T10:00:00Z"
}
]
Example prompt
List all my Nexlayer deployments
nexlayer.yaml Schema
The single config file that defines your entire deployment. Nexlayer keeps it intentionally minimal.
Top-level fields
www.mysite.com). Omit for preview deployments.
Pod fields
<name>.pod:<port>
nginx:alpine), GHCR (ghcr.io/org/image:tag), and private registries.
/ for the main app, /api for an API service.
[80], [3000], [5432].
<pod-name>.pod.
name, size (e.g., "2Gi"), and mountPath.
cpu (e.g., "2") and memory (e.g., "4Gi").
YAML Examples
Minimal — static site
application: name: my-site pods: - name: web image: nginx:alpine path: / servicePorts: [80]
Full-stack app (Next.js + PostgreSQL + Redis)
application: name: myapp url: www.myapp.com pods: - name: web image: ghcr.io/myorg/myapp:latest path: / servicePorts: [3000] vars: DATABASE_URL: "postgres://app:[email protected]:5432/myapp" REDIS_URL: "redis://redis.pod:6379" NODE_ENV: production - name: postgres image: postgres:16-alpine path: /db servicePorts: [5432] vars: POSTGRES_USER: app POSTGRES_PASSWORD: secret POSTGRES_DB: myapp volumes: - name: pg-data size: "10Gi" mountPath: "/var/lib/postgresql/data" - name: redis image: redis:7-alpine path: /cache servicePorts: [6379]
AI inference (LLM serving)
application: name: llm-server pods: - name: ollama image: ollama/ollama:latest path: / servicePorts: [11434] resources: cpu: "4" memory: "16Gi" volumes: - name: models size: "50Gi" mountPath: "/root/.ollama"
Multi-path API gateway
application: name: gateway pods: - name: web image: myorg/frontend:latest path: / servicePorts: [3000] - name: api image: myorg/api:latest path: /api servicePorts: [8080] replicas: 3 vars: BACKEND_URL: "http://web.pod:3000"
Environment Variables
Set in the vars block per pod, or via the set_environment_variable MCP tool at runtime.
Inter-pod references
Pods communicate internally using the <pod-name>.pod:<port> format:
vars: DATABASE_URL: "postgres://user:[email protected]:5432/mydb" REDIS_URL: "redis://redis.pod:6379" API_URL: "http://api.pod:8080"
Nexlayer creates internal DNS entries for each pod. postgres.pod resolves to the postgres pod's internal IP. Traffic stays within the cluster — no external exposure.
Volumes (Persistent Storage)
volumes: - name: my-data # identifier size: "2Gi" # storage capacity mountPath: "/data" # where it mounts inside the container
Pods with persistent volumes don't auto-scale by default (stateful workloads need careful coordination). For high-availability databases, use a managed DB service.
API — Authentication
Base URL: https://app.nexlayer.com
Nexlayer uses session tokens generated when you first deploy. Provide the token as a query parameter or in the request body.
# Query parameter GET /getReservations?sessionToken=dCf0NdAQ64j6 # Request body POST /extendDeployment { "sessionToken": "dCf0NdAQ64j6", "applicationName": "my-app" }
API — Deploy Endpoints
Content-Type: text/x-yaml
Query params: sessionToken (optional)
curl -X POST https://app.nexlayer.com/startUserDeployment \
-H "Content-Type: text/x-yaml" \
--data-binary @nexlayer.yaml
Response: { message, url, sessionToken, applicationName, environment, status }
Query params: sessionToken (required)
curl -X POST \
"https://app.nexlayer.com/updateUserDeployment?sessionToken=TOKEN" \
-H "Content-Type: text/x-yaml" \
--data-binary @nexlayer.yaml
curl -X POST https://app.nexlayer.com/extendDeployment \ -H "Content-Type: application/json" \ -d '{ "sessionToken": "TOKEN", "applicationName": "my-app" }'
Free deployments have a limited number of extensions available.
curl -X POST https://app.nexlayer.com/claimDeployment \ -H "Content-Type: application/json" \ -d '{ "sessionToken": "TOKEN", "applicationName": "my-app" }'
Response: { claimUrl, claimToken }
API — Manage Endpoints
curl "https://app.nexlayer.com/getReservations?sessionToken=TOKEN"
Response: Array of { applicationName, status, url, createdAt, expiresAt }
curl -X POST https://app.nexlayer.com/addDeploymentReservation \
-d '{ "sessionToken": "TOKEN", "applicationName": "my-app" }'
curl -X POST https://app.nexlayer.com/removeDeploymentReservation \
-d '{ "sessionToken": "TOKEN", "applicationName": "my-app" }'
curl -X POST https://app.nexlayer.com/removeReservations \
-d '{ "sessionToken": "TOKEN" }'
Guide — Custom Domains
Step 1: Add domain to nexlayer.yaml
application: name: my-app url: www.mysite.com
Step 2: Configure DNS
At your DNS provider (Cloudflare, Route 53, etc.):
For www subdomain:
CNAME www cname.nexlayer.dev
For root apex domain:
A @ 76.76.21.21 CNAME www cname.nexlayer.dev
Step 3: Deploy
SSL is automatically provisioned on first request to the domain. No further action needed.
Tell Claude: "Configure www.mysite.com as the domain for my-app". It will update nexlayer.yaml and guide you through the DNS setup.
Guide — Scaling & Resources
Nexlayer auto-scales by default based on CPU/memory. Set replicas to fix the count (disables auto-scale).
Auto-scaling (default)
pods: - name: api # no replicas field → Nexlayer auto-scales
Fixed replicas
pods: - name: api replicas: 3
Custom resources
pods: - name: heavy-worker resources: cpu: "2" memory: "8Gi"
Best practices for scale
- Stateless design — store sessions in Redis, files in object storage
- Health endpoint — expose
/healthreturning HTTP 200 when ready - Graceful shutdown — handle SIGTERM to drain in-flight requests
- Databases — use a managed service for stateful, high-availability data
Guide — Service Discovery
Pods within the same deployment communicate via internal DNS: <pod-name>.pod:<port>.
# From any pod in the deployment: postgres.pod:5432 # PostgreSQL redis.pod:6379 # Redis api.pod:8080 # Internal API worker.pod:9000 # Background worker
Service discovery addresses are only resolvable within the deployment. They are not exposed externally. Only pods with a path accessible externally receive public traffic.
Guide — Health Checks
Expose a /health endpoint from your app. Nexlayer uses it to determine if a pod should receive traffic.
Node.js / Express
app.get('/health', (req, res) => res.json({ status: 'ok' }));
Python / FastAPI
@app.get("/health") def health(): return {"status": "ok"}
Go
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) w.Write([]byte(`{"status":"ok"}`)) })
Unhealthy instances are automatically removed from the load balancer and replaced.