Deploy from your AI agent
Deploy a site from Cursor with Layero
Open your project in Cursor and ask the agent to publish it on Layero. MCP provides account tools and static publishing; projects that need a build are uploaded through the CLI in the terminal.
Connect Layero Try the example1. Connect the platform
In the Cursor terminal, connect the MCP server with the command below and install the Layero skill. If add-mcp asks for a client, choose Cursor. Check the layero server under Customize → MCP. Folder deployment also needs access to the terminal and project files.
npx -y add-mcp https://mcp.layero.ru/mcpnpx skills add LayeroInfra/layero-agentsAlternatively, add the entry below to .cursor/mcp.json. Merge it with existing entries rather than replacing other servers. The URL is sufficient to connect; do not commit a token. Cursor offers OAuth sign-in for account operations.
{
"mcpServers": {
"layero": {
"url": "https://mcp.layero.ru/mcp"
}
}
}The Layero CLI needs Node.js 20 or newer and npm access. Model access, subscriptions and client availability are governed by the client provider and are not included in Layero plans.
2. Give the agent a task
Open the app root. In a monorepo, identify the app folder first. For a repository already connected to Layero, use the Git deployment workflow. Example request for a new project:
Read the Layero instructions and check the app root. Run deploy --dry-run --json in the correct folder. Publish the new project with the CLI, wait for ready and check its URL. If the build fails, read diagnose and fix the reported cause. Explain any change to an existing live site before deploying.3. Try a minimal example
Download a single HTML file and publish it from a new folder. No dependencies, build tool or layero.json file are required. The commands use Bash/zsh; on Windows, use WSL or Git Bash. Run them in the agent terminal or your own shell.
mkdir layero-agent-demo
cd layero-agent-demo
curl -fsS https://layero.ru/examples/agent-deploy/index.html -o index.html
npx layero@latest deploy --dry-run --json
npx layero@latest deploy --jsonThe dry-run plan uploads nothing. When sign-in is needed, the CLI emits auth_required: open its URL and authorize access. Wait for ready and open its URL rather than constructing an address from the project name.
Download the HTML example · Open the deployed resultChecked on October 25, 2026: CLI 0.11.10 detected static, completed a real deployment and returned ready. The published site responds with HTTP 200 and contains Hello from Layero. This validates the CLI workflow, not model performance or a deployment-time guarantee.
Deploying your own app
For Vite, Next.js, Astro, Node.js or Python, run the CLI from the source folder. Layero detects the project and builds it remotely. If dry-run returns confident: false, follow next_action: you may need a different folder or a layero.json setting.
MCP publish_site uploads prebuilt static files with index.html. Use the CLI for server apps or projects that still need a build. Update a connected Git repository by pushing to the appropriate branch.
Next.js support and limits · CLI for agentsLimits to check before publishing
| Repeat deployments | A direct CLI upload replaces the live CLI project. For an isolated preview, connect a repository and push a separate branch. Archive uploads do not support --branch. |
|---|---|
| Without an account | Explicit --claim only: a static site or SPA for one hour, with a random address and indexing disabled. SSR and server apps need an account. Give the person ready.url and claim_url. |
| Search and domains | Free does not include search indexing. A permanent indexed site and custom domain require Pro; enable indexing separately in project settings. |
| Secrets and permissions | Keep tokens and secret .env files out of published files. Set project environment variables separately and store LAYERO_TOKEN as a CI secret. The agent remains subject to client and Layero account permissions. |
Troubleshooting
If MCP is connected but source upload fails, check the workflow: publish_site accepts prebuilt static files. Vite, Next.js and server apps use the CLI build path. Enable the required tools or terminal in Cursor; uploading source code as HTML is not a substitute for a build.
npx layero@latest diagnose
npx layero@latest logs --runtimeCheck whether the failure happened during dependency installation, build or launch. Read diagnose first; runtime logs help with launch failures. A command that ended without ready has not confirmed a successful publication.
CLI events and error codes