# Bring in an existing project

A folder you built with Claude Code, Cursor, or Codex comes onto MainPath with one prompt, provided its tech stack is supported.

> Source: https://www.mainpath.ai/en/docs/import-existing-project/

An application built with an AI agent is brought onto MainPath by that same agent; there is no upload in the browser.

## What you need

- An account at [app.application-platform.com/register](https://app.application-platform.com/register) with an organization, see [Create your first project]({{< relref "getting-started" >}}).
- The mp CLI. Install it from the terminal with `curl -fsSL https://www.application-platform.com/install.sh | sh` (Windows, in PowerShell: `irm https://www.application-platform.com/install.ps1 | iex`); the [MainPath Toolbox]({{< relref "/downloads" >}}) ships it as well.
- Claude Code, Cursor, or Codex.
- A supported tech stack, see below.

## Open a terminal

You type the next commands into a terminal, in Cursor and VS Code via **Terminal** → **New Terminal**.

## Install the agent plugin and sign in

```bash
mp agent install
mp login
```

The CLI places skills and MCP configuration with the installed agents and opens the browser for signing in; afterwards `mp whoami` shows your account.

If `mp` is not found, the CLI is missing; if no browser opens, type `mp login` again. Finally, reload Cursor via "Reload Window" and restart Claude Code or Codex.

## Paste the prompt

Open the project folder in the agent, in Cursor via **File** → **Open Folder**, for Claude Code or Codex via `cd` in the terminal and `claude` or `codex`, and paste this prompt:

{{< agent-import-prompt >}}

The short version is the slash command `/import-existing-project` that comes with the plugin.

## What the agent does

The agent confirms the path, asks for the project name, and calls `platform_projects_import_local`, which detects the tech stacks, creates the project, waits for repositories and pipelines, clones them, lays your files over them, and pushes everything to `main`; `.gitlab-ci.yml` and `env/*.generated.env` are kept.

From now on you work in `~/Documents/MainPath/<organization>/<project>/` with one subfolder per repository plus `local-configuration`; the old folder is not connected to MainPath.

If the agent reports that you are not signed in or that the MCP server is missing, [When something does not work]({{< relref "get-help" >}}) helps.

## If your stack is not supported

Supported are apps with Flutter, React Native (Expo), Next.js, native iOS, and native Android, homepages with Hugo and Astro, backends with NestJS, FastAPI, and Laravel, and unambiguous packages such as an npm package, a Dart package, or a Docker image.

For other frameworks the agent stops and does not create a project with a different stack; report a missing stack on the [feedback page]({{< relref "/feedback" >}}).

The CLI command `mp platform projects import-local` for developers is described in [Import an existing repository]({{< relref "agent-project-import" >}}).

Continue with [Set up your computer or work in the browser]({{< relref "setup-your-computer" >}}).

