# Create environments from the API and MCP

> Coding tools and scripts can create staging and preview environments for web and API applications.

Source: https://qa.tech/changelog/2026-11-12-create-environments-api-mcp · Published: 2026-11-12

---
Use `POST /v1/applications/{applicationShortId}/environments` or the matching `create_environment` MCP tool to add a named environment with a public URL and an `isProduction` flag. Web and API applications are supported, matching the environments you add under Settings → Applications & Envs.

Calls are idempotent: sending the same name again returns the existing environment with `created: false` instead of adding a duplicate. An agent can set up an application and its environments in one workflow.

More on this: [create environment API reference](https://docs.qa.tech/api-reference/applications/create-environment), [MCP for coding agents](https://qa.tech/product/mcp) and [multi-environment testing](https://qa.tech/use-cases/multi-environment-testing).
