# Nexlayer — Full Technical Reference > This file is a technical companion to /llms.txt. It contains the configuration schema, MCP tool list, deployment patterns, and everything an AI coding agent needs to deploy applications on Nexlayer. Website: https://nexlayer.com Dashboard: https://app.nexlayer.com MCP endpoint: https://mcp.nexlayer.ai/api/mcp Pricing JSON: GET https://nexlayer.com/api/pricing YAML schema: ask the MCP (nexlayer_get_schema) or the CLI (nexlayer call get_schema) --- ## Quick Start ```bash npx @nexlayer/mcp-install ``` Auto-detects and configures: Claude Code, Cursor, VS Code, Windsurf, Zed, Amazon Q, Lovable, JetBrains. After install, tell your AI assistant: "Deploy this project to Nexlayer." It will generate `nexlayer.yaml` and call `nexlayer_deploy`. --- ## MCP Configuration (manual) Add to your editor's MCP config file: ```json { "mcpServers": { "nexlayer-mcp": { "transport": "http", "url": "https://mcp.nexlayer.ai/api/mcp" } } } ``` Config file locations: - Claude Code: run `claude mcp add --transport http nexlayer https://mcp.nexlayer.ai/api/mcp` - Cursor: `~/.cursor/mcp.json` - VS Code: `~/.vscode/mcp.json` - Windsurf: `~/.codeium/windsurf/mcp_config.json` --- ## nexlayer.yaml — Full Schema ```yaml application: version: 2.0 # optional; needed for resources, replicas, resourceType, schedule, subdomain name: my-app # required; starts with a lowercase letter; lowercase letters, digits, hyphens, dots url: www.example.com # optional; your custom domain; omit to use the generated temporary URL pods: # required; the services that make up the application - name: web # required; service identifier used in internal DNS (.pod:) image: org/img:v1.0.0 # required; must include a tag (private registry: <% REGISTRY %> + registryLogin) path: / # public route; at least one pod needs one (no path = private to the app) servicePorts: # port(s) the container listens on - 3000 vars: # optional; plain environment variables NODE_ENV: production DATABASE_URL: postgresql://user:pass@postgres.pod:5432/db PUBLIC_URL: <% URL %> # the app's public URL; <% DOMAIN %> for the host only secrets: # optional; secrets in the file are mounted as FILES, not env vars - name: tls-cert data: # required; plain text or base64 fileName: cert.pem # required mountPath: /var/secrets/tls # optional; default /var/secrets/ volumes: # optional; persistent storage (survives restarts and redeploys) - name: db-data size: 2Gi mountPath: /var/lib/postgresql # Postgres: NOT /var/lib/postgresql/data # v2 fields (need application.version: 2.0) replicas: 1 # optional; copies of a stateless pod resources: # optional; omit for platform defaults requests: { cpu: 500m, memory: 512Mi } limits: { cpu: "1", memory: 1Gi } ``` **Secrets your app reads as environment variables** (API keys, tokens): never put the value in `nexlayer.yaml`. Write a `${NAME}` reference (e.g. `STRIPE_KEY: ${STRIPE_KEY}`); `nexlayer ship` fills it from `nexlayer vault set NAME` or the environment at deploy. Or, after the first deploy (the app only exists once it has deployed), add it in the dashboard under the app's **Secrets** tab, as a variable or a file, then click "Sync to cluster". Never paste a secret value into a chat or commit it to the repo. Live schema: `nexlayer_get_schema` (MCP). ### Service Discovery Pods communicate via internal DNS — no service mesh required: ``` .pod: ``` Examples: ```yaml DATABASE_URL: postgresql://user:pass@postgres.pod:5432/db REDIS_URL: redis://redis.pod:6379 API_URL: http://api.pod:3000 ``` --- ## Deployment Patterns ### Next.js + PostgreSQL ```yaml application: name: nextjs-app pods: - name: web image: myuser/nextjs:v1.0.0 path: / servicePorts: [3000] vars: DATABASE_URL: postgresql://postgres:pass@postgres.pod:5432/db - name: postgres image: postgres:16 servicePorts: [5432] vars: POSTGRES_PASSWORD: pass POSTGRES_DB: db volumes: - name: pgdata size: 2Gi mountPath: /var/lib/postgresql ``` ### React (SPA) + Express API + PostgreSQL ```yaml application: name: pern-app pods: - name: frontend image: myuser/react-app:v1.0.0 path: / servicePorts: [80] vars: REACT_APP_API_URL: /api - name: api image: myuser/express-api:v1.0.0 path: /api servicePorts: [3000] vars: DATABASE_URL: postgresql://postgres:pass@postgres.pod:5432/db - name: postgres image: postgres:16 servicePorts: [5432] vars: POSTGRES_PASSWORD: pass POSTGRES_DB: db volumes: - name: pgdata size: 2Gi mountPath: /var/lib/postgresql ``` ### FastAPI + PostgreSQL ```yaml application: name: fastapi-app pods: - name: api image: myuser/fastapi:v1.0.0 path: / servicePorts: [8000] vars: DATABASE_URL: postgresql://postgres:pass@postgres.pod:5432/db - name: postgres image: postgres:16 servicePorts: [5432] vars: POSTGRES_PASSWORD: pass POSTGRES_DB: db volumes: - name: pgdata size: 1Gi mountPath: /var/lib/postgresql ``` ### Django + PostgreSQL + Redis ```yaml application: name: django-app pods: - name: web image: myuser/django:v1.0.0 path: / servicePorts: [8000] vars: DATABASE_URL: postgresql://postgres:pass@postgres.pod:5432/db REDIS_URL: redis://redis.pod:6379 DJANGO_SETTINGS_MODULE: myapp.settings.production - name: postgres image: postgres:16 servicePorts: [5432] vars: POSTGRES_PASSWORD: pass POSTGRES_DB: db volumes: - name: pgdata size: 2Gi mountPath: /var/lib/postgresql - name: redis image: redis:7-alpine servicePorts: [6379] ``` ### Go API + PostgreSQL ```yaml application: name: go-api pods: - name: api image: myuser/go-api:v1.0.0 path: / servicePorts: [8080] vars: DATABASE_URL: postgresql://postgres:pass@postgres.pod:5432/db GIN_MODE: release - name: postgres image: postgres:16 servicePorts: [5432] vars: POSTGRES_PASSWORD: pass POSTGRES_DB: db volumes: - name: pgdata size: 1Gi mountPath: /var/lib/postgresql ``` --- ## AI models and inference Dedicated model serving is Nexlayer Inference, a separate product from application hosting: https://inference.nexlayer.com/ --- ## MCP Tools Install once: `npx @nexlayer/mcp-install` ### Deployment | Tool | Description | |------|-------------| | `nexlayer_deploy` | Deploy an application from nexlayer.yaml | | `nexlayer_get_deployment_workflow` | Explain the deployment process step by step | | `nexlayer_check_deployment_status` | Check if an app is healthy and running | | `nexlayer_get_deployment_logs` | Stream real-time logs from a running app | | `nexlayer_get_deployment_events` | View deployment events and failure reasons | | `nexlayer_delete_deployment` | Remove a deployment | | `nexlayer_list_projects` | List the apps already deployed | | `nexlayer_get_project_by_url` | Find an app by its URL | | `nexlayer_deployment_activity` | Recent deploy activity | | `nexlayer_remote_build` | Build images remotely | | `nexlayer_analyze_github_repo` | Analyze a GitHub repo before deploying | | `nexlayer_validate_yaml` | Validate nexlayer.yaml before deploying | | `nexlayer_get_schema` | Fetch the nexlayer.yaml JSON Schema | ### Domains | Tool | Description | |------|-------------| | `nexlayer_get_domain_setup_guide` | Get DNS setup instructions for a custom domain | | `nexlayer_check_domain_configuration` | Verify domain is configured correctly | | `nexlayer_add_domain_to_profile` | Register a domain on the account | | `nexlayer_verify_name_servers_configuration` | Confirm nameservers are pointing correctly | ### API Keys | Tool | Description | |------|-------------| | `nexlayer_generate_api_key` | Create a new API key | | `nexlayer_list_api_keys` | List all API keys on the account | | `nexlayer_revoke_api_key` | Revoke an API key | ### Billing | Tool | Description | |------|-------------| | `nexlayer_check_credits` | Check remaining credit balance | | `nexlayer_upgrade_plan` | Upgrade to Pro or Enterprise | | `nexlayer_apply_coupon` | Apply a coupon/promo code | ### Debugging — Shell | Tool | Description | |------|-------------| | `nexlayer_debug_shell_open` | Open an interactive shell into a running pod | | `nexlayer_debug_shell_send` | Execute a command in an open shell session | | `nexlayer_debug_shell_close` | Close a shell session | | `nexlayer_debug_shell_list` | List all open shell sessions | ### Debugging — Files | Tool | Description | |------|-------------| | `nexlayer_debug_file_list` | List files inside a running pod | | `nexlayer_debug_file_copy_from` | Read a file out of a running pod | | `nexlayer_debug_file_copy_to` | Write a file into a running pod | | `nexlayer_debug_file_edit` | Edit a file in-place without redeploying | ### Debugging — Pods & Network | Tool | Description | |------|-------------| | `nexlayer_debug_pod_describe` | Get full pod details (resources, events, status) | | `nexlayer_debug_pod_restart` | Restart a single pod | | `nexlayer_debug_pod_restart_deployment` | Restart all pods in a deployment | | `nexlayer_debug_pod_scale` | Change the replica count of a pod | | `nexlayer_debug_proxy_http` | Test HTTP connectivity to an internal service | | `nexlayer_debug_proxy_exec` | Execute a command in the pod's network namespace | | `nexlayer_debug_namespace_info` | Show all services and their internal addresses | | `nexlayer_debug_namespace_dns` | Test DNS resolution inside the cluster | | `nexlayer_debug_db_query` | Run a SQL query against a database pod | ### Debugging — Proxy Lifecycle | Tool | Description | |------|-------------| | `nexlayer_debug_deploy_proxy` | Set up a debug proxy to a running pod | | `nexlayer_debug_destroy_proxy` | Tear down a debug proxy | | `nexlayer_debug_fetch_result` | Retrieve a previously returned large result | | `nexlayer_fetch_result` | Retrieve a deferred large result by ID | ### AI Agent Templates | Tool | Description | |------|-------------| | `nexlayerAI_deploy_chatbot` | Deploy a pre-built chatbot template | | `nexlayerAI_deploy_code_copilot` | Deploy a code copilot template | | `nexlayerAI_deploy_code_reviewer` | Deploy a code reviewer template | | `nexlayerAI_deploy_content_guard` | Deploy a content moderation template | | `nexlayerAI_deploy_multi_agent` | Deploy a multi-agent orchestration template | | `nexlayerAI_deploy_translation_hub` | Deploy a translation service template | | `nexlayerAI_list_sandboxes` | List running AI sandbox environments | ### Skills & Misc | Tool | Description | |------|-------------| | `nexlayer_get_skills` | List available agent skill modules | | `nexlayer_get_skill_content` | Get the full content of a skill module | | `nexlayer_sync_skills` | Pull latest skill updates | | `nexlayer_check_updates` | Check if the MCP server has updates | | `nexlayer_list_models` | List available inference models | | `nexlayer_build_and_push_image` | Build and push a Docker image for deployment | | `nexlayer_feedback` | Send feedback to the Nexlayer team | | `nexlayer_submit_issue` | File a bug or support request | | `nexlayer_get_referral` | Get referral link for the account | --- ## DNS Setup Custom domains move the domain's DNS to Nexlayer (dashboard: Domains; or the MCP tools below): 1. `nexlayer_check_domain_configuration`, then `nexlayer_add_domain_to_profile` If the dashboard shows a TXT record for the domain (Pending Ownership Verification), the person adds it at their registrar to prove ownership. 2. At the registrar, set the domain's nameservers to: - `ns1.cluster-se1-us.nexlayer.ai` - `ns2.cluster-se1-us.nexlayer.ai` Then confirm with `nexlayer_verify_name_servers_configuration`. This hands the domain's DNS to Nexlayer: tell the person to copy existing records (email MX especially) first, then re-add them on the domain's page in Domains (A, AAAA, CNAME, MX, TXT, NS, SRV, CAA). 3. Deploy with `url: example.com` in `nexlayer.yaml`. SSL certificates are provisioned automatically. Full steps: `nexlayer_get_domain_setup_guide`. --- ## Pricing Machine-readable: `GET https://nexlayer.com/api/pricing` Applications and inference are priced differently because they are bought differently. ### Application hosting — flat, unmetered | Plan | $/mo | Apps | Workspaces | Application URL | |------------|--------|-----------|------------|-----------------| | Free | $0 (card on file, never charged) | 5 | 1 | Nexlayer URL | | Pro | $100 flat | Unlimited apps and deploys | 1 | Custom domain | | Enterprise | Contact sales | Unlimited | Unlimited | Custom domain | One fixed monthly price. No per-request, per-build or per-token meter, and no overage invoice. Builds, deploys and agent operations are always free. Egress is free. A plan is a capacity envelope sized for one team's work. If usage consistently exceeds it, Nexlayer makes contact directly rather than throttling or billing by surprise: https://nexlayer.com/docs/usage-limits Enterprise adds unlimited workspaces and teams, multi-region and reserved capacity, SSO, RBAC, audit logging, SOC 2 / BAA / HIPAA, SLAs and 24/7 incident response. ### Nexlayer Inference Fully-managed training & inference platform. Bring your model, open-weight or your own fine-tune: Nexlayer sizes capacity to your workload, serves it on OpenAI-compatible and gRPC endpoints, and operates it in production. Single-tenant, in the US, on an Enterprise agreement. Details and to start: https://inference.nexlayer.com/ ## Best Practices for AI Agents 1. **Validate before deploying** — call `nexlayer_validate_yaml` first; catches port mismatches and missing fields before consuming credits. 2. **Use `.pod` DNS** — never hardcode IPs. `postgres.pod:5432` always resolves correctly inside the cluster. 3. **Secrets for sensitive values** — never write API keys or passwords into the file; use `${NAME}` references (filled by `nexlayer ship` from `nexlayer vault`/env) or the dashboard Secrets tab after the first deploy. Yaml `secrets:` are mounted as files (certificates, key files). 4. **Keep pods stateless** — store sessions in Redis, uploads in object storage. Stateful pods should have a `volumes:` block. 5. **Expose `/health`** — a simple endpoint gives you and your agent a quick check that the service is up. 6. **Handle SIGTERM** — pods receive SIGTERM before shutdown; flush in-flight requests before exiting. 7. **Omit `replicas`** — auto-scaling is on by default. Set `replicas` only when you need a fixed count. 8. **Provide the live URL immediately** — once `nexlayer_deploy` returns `url`, surface it to the user. 9. **Check logs on failure** — call `nexlayer_get_deployment_logs` and `nexlayer_get_deployment_events` together for fast diagnosis. 10. **Custom domain last** — set up the domain after the app is running on its generated temporary URL; use `nexlayer_get_domain_setup_guide` for the nameserver steps.