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 (recommended)
npx @nexlayer/mcp-install

Claude Code — Manual Setup

Add the Nexlayer MCP server to your Claude Code settings:

~/.claude/settings.json
{
  "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
How the bridge works

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.

🚀
deploy_application
Deploy a containerized application using a nexlayer.yaml configuration
ParameterTypeRequiredDescription
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"
}
Save your session token

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
💚
get_deployment_status
Check the health and current state of a running deployment
ParameterTypeRequiredDescription
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?
📋
get_logs
Stream real-time logs from a deployment or specific pod
ParameterTypeRequiredDescription
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
🌐
configure_domain
Attach a custom domain to a deployment (auto-provisions SSL)
ParameterTypeRequiredDescription
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
SSL is automatic

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
⚙️
set_environment_variable
Set or update environment variables on a running deployment
ParameterTypeRequiredDescription
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:pass@postgres.pod:5432/mydb for my-app

# Update API key
Update the OPENAI_API_KEY env var for the api pod in my-app
Restarts on change

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:pass@postgres.pod:5432/mydb"
      REDIS_URL:    "redis://redis.pod:6379"
      NODE_ENV:     production
📈
update_replicas
Scale a pod up or down by adjusting replica count
ParameterTypeRequiredDescription
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
📦
list_deployments
List all active deployments for your session
ParameterTypeRequiredDescription
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

application* object Application metadata
application.name* string Unique identifier for your app. Used in URLs and API calls. Lowercase, hyphens ok.
application.url string Custom domain (e.g., www.mysite.com). Omit for preview deployments.
pods* array Array of container definitions. Each pod is a service in your application.

Pod fields

name* string Pod identifier. Used for service discovery: <name>.pod:<port>
image* string Docker image reference. Supports Docker Hub (nginx:alpine), GHCR (ghcr.io/org/image:tag), and private registries.
path* string URL route this pod handles. Use / for the main app, /api for an API service.
servicePorts* number[] Ports the container listens on. E.g., [80], [3000], [5432].
vars object Environment variables as key-value pairs. Supports inter-pod refs via <pod-name>.pod.
volumes array Persistent storage. Each volume has name, size (e.g., "2Gi"), and mountPath.
replicas number Fixed replica count. Setting this disables auto-scaling. Omit to let Nexlayer auto-scale.
resources object CPU and memory limits. Fields: 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:secret@postgres.pod: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:pass@postgres.pod:5432/mydb"
  REDIS_URL:    "redis://redis.pod:6379"
  API_URL:      "http://api.pod:8080"
Inter-pod DNS

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
Volumes and auto-scaling

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

POST /startUserDeployment Start a new deployment

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 }

POST /updateUserDeployment Update running deployment config

Query params: sessionToken (required)

curl -X POST \
  "https://app.nexlayer.com/updateUserDeployment?sessionToken=TOKEN" \
  -H "Content-Type: text/x-yaml" \
  --data-binary @nexlayer.yaml
POST /extendDeployment Extend deployment lifetime
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.

POST /claimDeployment Make a deployment permanent
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

GET /getReservations List all deployments
curl "https://app.nexlayer.com/getReservations?sessionToken=TOKEN"

Response: Array of { applicationName, status, url, createdAt, expiresAt }

POST /addDeploymentReservation Reserve a deployment (Scale/Conquer plan)
curl -X POST https://app.nexlayer.com/addDeploymentReservation \
  -d '{ "sessionToken": "TOKEN", "applicationName": "my-app" }'
POST /removeDeploymentReservation Remove a specific reservation
curl -X POST https://app.nexlayer.com/removeDeploymentReservation \
  -d '{ "sessionToken": "TOKEN", "applicationName": "my-app" }'
POST /removeReservations Remove all reservations for a session
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.

Ask Claude to set it up

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 /health returning 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
Internal only

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.