> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lovable.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Lovable MCP server

> Connect AI agents and developer tools to Lovable using the Model Context Protocol. Build, iterate, and deploy apps programmatically.

## What is the Lovable MCP server?

Lovable exposes itself as a [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server at `https://mcp.lovable.dev`. This lets an AI client manage your Lovable projects through natural language.

When connected, your AI agent can create projects, send messages to Lovable, inspect code, deploy apps, and more, all without leaving the client you're already working in. The Lovable MCP server is available on all plans.

<Note>
  This is different from [chat connectors (MCP servers)](/integrations/chat-connectors), which let the Lovable agent connect to your tools. The Lovable MCP server lets external agents connect to Lovable.
</Note>

### What MCP is

MCP (Model Context Protocol) is an open standard that lets AI agents discover and call external tools. When an agent connects to an MCP server, it can see what tools are available and decide when to use them. Lovable's MCP server makes Lovable one of those tools: findable, invokable, and composable.

### Supported AI clients

The Lovable MCP server's OAuth flow is currently restricted to the following clients:

* **ChatGPT**
* **Claude** (Claude Desktop on macOS and Windows, and claude.ai)
* **Claude Code**
* **Cursor**
* **VS Code**

Other MCP clients cannot complete the OAuth flow at this time. The rest of this page refers to these supported apps as "the client" or "your client."

### The flow

1. An agent connects to the Lovable MCP server
2. The agent calls a tool (for example, `create_project`) with a description of what to build
3. Lovable builds the project and returns a preview URL
4. You can open the preview, review what was built, and continue iterating by sending more messages
5. The agent keeps building as you refine, adding features, fixing issues, and changing the design
6. When you're happy with it, publish with `deploy_project`. Or don't, publishing is always optional.

## Who this is for

* **Developers using ChatGPT, Claude Code, Cursor, or VS Code** who want to spin up and iterate on Lovable projects without leaving their AI client or editor
* **Teams** who want Lovable as a step in a larger agent flow: generate content, scaffold a UI, deploy it, and hand off the URL

## Why use the Lovable MCP server

* **Agent-driven development:** Let your client scaffold and iterate on Lovable projects using natural language.
* **Code inspection:** Read project files, diff changes, and browse edit history programmatically.
* **Cross-tool workflows:** Combine Lovable with other MCP-connected tools in a single agent session.

## Common use cases

| Scenario                       | Example prompt to your agent                                                                                                                    | Outcome                                             |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| Scaffold a new app             | *Create a Lovable project called 'Feedback Hub' with a form for collecting user feedback*                                                       | Project created and first build completed           |
| Iterate on an existing project | *Add a dark mode toggle to my project \[ID]*                                                                                                    | Agent sends message and waits for Lovable to finish |
| Review recent changes          | *Show me what changed in the last three edits to my project*                                                                                    | Unified diff of recent commits                      |
| Deploy an app                  | *Deploy my project \[ID] and give me the live URL*                                                                                              | Project published; live URL returned                |
| Inspect the codebase           | *List all files in my project and read the main App.tsx*                                                                                        | File tree and file content returned                 |
| Compare multiple variants      | *Build 3 versions of a landing page for \[product], each with a different layout and visual style. Deploy all three and give me the live URLs.* | Three deployed projects with live URLs to compare   |

## Prerequisites

* A Lovable account on any plan.
* Third-party MCP client access enabled for your workspace, which allows external clients to connect to the Lovable MCP server
  * Enabled by default on Free, Pro, and Business workspaces
  * Disabled by default on Enterprise workspaces. On Enterprise, a workspace admin or owner can enable it in **Settings → Security → Privacy & security**, under [**Third-party MCP clients**](/features/privacy-and-security-settings#third-party-mcp-clients)
* One of the [supported AI clients](#supported-ai-clients) installed

## Before you connect

<Warning>
  When you connect a client to the Lovable MCP server, it has the same account access you do. A few things to know before connecting:

  * **Scope is your full account, not one project.** Whatever client you connect can list, read, and edit every project you have access to in Lovable.
  * **Calls run live on your account.** Tool calls use real credits and edit real projects.
  * **`deploy_project` deploys the app and returns a live URL.** On Free and Pro plans, anyone with the link can reach the app. On Business and Enterprise plans, website access follows the workspace default. The URL may be restricted to workspace members only if internal publishing is configured.
  * **`query_database` runs SQL with your full database permissions.** Read, write, and schema changes.
</Warning>

## How to connect

The Lovable MCP server uses OAuth for authentication. When you connect for the first time, your client opens a browser window to authenticate with your Lovable account.

<Note>
  Workspace admins and owners can also find everything on this page inside Lovable: **Settings → Build & deploy → MCP server** shows the server URL, setup steps for common clients, and a **Manage access** shortcut to the workspace's [**Third-party MCP clients** setting](/features/privacy-and-security-settings#third-party-mcp-clients).
</Note>

Pick your client below.

<AccordionGroup>
  <Accordion title="ChatGPT">
    Add the Lovable MCP server in ChatGPT using this URL:

    ```text theme={null}
    https://mcp.lovable.dev
    ```

    ChatGPT prompts you to authenticate via OAuth when you connect.
  </Accordion>

  <Accordion title="Claude">
    Add Lovable through Claude's connector settings. Works in Claude Desktop (macOS and Windows) and on [claude.ai](https://claude.ai).

    <Steps>
      <Step title="Open the connector picker">
        In Claude, click the **+** sign.
      </Step>

      <Step title="Browse connectors">
        Click **Connectors** → **Browse Connectors**, then search for **Lovable**.
      </Step>

      <Step title="Connect and authenticate">
        Click **Connect**, then sign in to Lovable when Claude prompts you.
      </Step>
    </Steps>

    The Lovable tools appear in the composer's tool menu once authentication is complete.
  </Accordion>

  <Accordion title="Claude Code">
    Run this command in your terminal:

    ```bash theme={null}
    claude mcp add --transport http lovable "https://mcp.lovable.dev"
    ```

    Alternatively, install the Lovable plugin, which also adds slash commands for common tasks:

    ```bash theme={null}
    /plugin install lovable@claude-plugins-official
    ```

    The first time a Lovable tool runs, Claude Code opens a browser window to sign in to Lovable.

    Verify with `/mcp` (look for the `lovable` server) or ask Claude Code to "list my Lovable workspaces."
  </Accordion>

  <Accordion title="Claude Desktop (config file)">
    If you prefer editing the config directly, add the following to your MCP configuration:

    * **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
    * **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

    ```json theme={null}
    {
      "mcpServers": {
        "lovable": {
          "type": "http",
          "url": "https://mcp.lovable.dev"
        }
      }
    }
    ```

    <Note>
      If your config file already has an `mcpServers` object with other servers in it, add the `"lovable"` entry **inside** the existing object. Don't paste a second `mcpServers` block, the file won't be valid JSON.
    </Note>

    Restart Claude Desktop after saving. The Lovable tools will appear in your agent's tool list.
  </Accordion>

  <Accordion title="Cursor">
    Install the **Lovable** plugin in Cursor for a guided setup that connects the MCP server for you and adds slash commands for common tasks: `/lovable-new`, `/lovable-iterate`, `/lovable-db`, and `/lovable-deploy`. Sign in with your Lovable account when prompted on the first tool call.

    To connect the server manually instead, add the following to your MCP configuration (`~/.cursor/mcp.json` globally, or `.cursor/mcp.json` in your project root):

    ```json theme={null}
    {
      "mcpServers": {
        "lovable": {
          "type": "http",
          "url": "https://mcp.lovable.dev",
          "auth": {
            "CLIENT_ID": "6d465f583e1e4ce5801b1616f735670c"
          }
        }
      }
    }
    ```

    <Note>
      If your `mcp.json` already has an `mcpServers` object with other servers in it, add the `"lovable"` entry **inside** the existing object. Don't paste a second `mcpServers` block, the file won't be valid JSON.
    </Note>

    Reload your Cursor window after saving.
  </Accordion>

  <Accordion title="VS Code">
    Add the Lovable MCP server through VS Code's MCP settings, or add the following to your MCP configuration file:

    ```json theme={null}
    {
      "servers": {
        "lovable": {
          "type": "http",
          "url": "https://mcp.lovable.dev"
        }
      }
    }
    ```

    VS Code prompts you to authenticate via OAuth in your browser.
  </Accordion>
</AccordionGroup>

## Available tools

The Lovable MCP server exposes the following tools. Tool calls run with your Lovable account's permissions and operate on your real projects.

<Note>
  A machine-readable version of this reference, including tool parameters, lives at [mcp.lovable.dev/skill.md](https://mcp.lovable.dev/skill.md). It is maintained alongside the server, so it always matches the tools the server currently exposes. The skill, the Claude Code plugin, and client setup guides are open source in the [lovablelabs/mcp](https://github.com/lovablelabs/mcp) repository.
</Note>

### Identity and workspaces

| Tool              | Description                                                                       |
| ----------------- | --------------------------------------------------------------------------------- |
| `get_me`          | Get the authenticated user's profile and workspaces                               |
| `list_workspaces` | List all workspaces you belong to                                                 |
| `get_workspace`   | Get workspace details, including plan, credit balance, member count, and settings |

### Projects

| Tool                      | Description                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list_projects`           | Search and list projects in a workspace, with filtering and full-text search                                                                                                                                                                                                                                                                                                                                           |
| `get_project`             | Get project details, including editor URL, preview URL, and a screenshot of the current state                                                                                                                                                                                                                                                                                                                          |
| `create_project`          | Create a new project with an `initial_message` (the build prompt) to the agent. Optionally start from a template or a design system                                                                                                                                                                                                                                                                                    |
| `deploy_project`          | Publish a project to production hosting on `lovable.app` and get the live URL                                                                                                                                                                                                                                                                                                                                          |
| `remix_project`           | Make a copy of an existing project into a workspace. The source project must be accessible to your workspace (your own workspace projects, templates, or projects with public remixing enabled)                                                                                                                                                                                                                        |
| `set_project_visibility`  | Set who can access the **project in the editor**, matching the share dialog options: `private` (your workspace audience with **Can edit**, default), `workspace_view` (your workspace audience with **Can view**, requires Business or Enterprise), or `draft` (**Restricted**, only people invited to the project, requires Business or Enterprise). Controls editor access only, not who can visit the published app |
| `set_folder_visibility`   | Set a folder to personal or workspace visibility. The change applies to all projects in the folder                                                                                                                                                                                                                                                                                                                     |
| `move_projects_to_folder` | Move up to 30 projects into a workspace folder                                                                                                                                                                                                                                                                                                                                                                         |
| `list_template_projects`  | List available project templates                                                                                                                                                                                                                                                                                                                                                                                       |
| `list_design_systems`     | List design systems available in a workspace                                                                                                                                                                                                                                                                                                                                                                           |

### Agent interaction

| Tool            | Description                                                                                                                                                                                                                |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `send_message`  | Send a chat message to a project's AI agent and wait for the response. Supports `plan_mode` (discuss before building) and `files` attachments. Pass `wait=false` to return immediately and poll with `get_message` instead |
| `get_message`   | Get the status and content of a message, for example after `send_message` with `wait=false`                                                                                                                                |
| `list_messages` | List recent messages in a project, newest first. Useful for finding message IDs when you only have a project ID                                                                                                            |

### Knowledge and skills

| Tool                      | Description                                                                                                                  |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `get_workspace_knowledge` | Get the workspace's [knowledge](/features/knowledge), the custom AI instructions that apply to all projects in the workspace |
| `set_workspace_knowledge` | Set the workspace's [knowledge](/features/knowledge). Replaces the existing content entirely                                 |
| `get_project_knowledge`   | Get a project's [knowledge](/features/knowledge), the custom AI instructions for that project                                |
| `set_project_knowledge`   | Set a project's [knowledge](/features/knowledge). Replaces the existing content entirely                                     |
| `list_workspace_skills`   | List the workspace's [skills](/features/skills)                                                                              |
| `get_workspace_skill`     | Get a workspace skill, including its full contents                                                                           |
| `create_workspace_skill`  | Create a workspace skill. Workspace admins and owners only                                                                   |
| `update_workspace_skill`  | Update a workspace skill. Workspace admins and owners only                                                                   |
| `delete_workspace_skill`  | Delete a workspace skill. Workspace admins and owners only. This cannot be undone except by recreating the skill             |

### Code inspection

| Tool         | Description                                              |
| ------------ | -------------------------------------------------------- |
| `get_diff`   | Get the unified diff from a message or commit SHA        |
| `list_files` | List all files in a project at a specific git ref        |
| `read_file`  | Read the contents of a single file at a specific git ref |
| `list_edits` | List the edit history of a project with pagination       |

### Cloud database

| Tool                  | Description                                                                                 |
| --------------------- | ------------------------------------------------------------------------------------------- |
| `get_database_status` | Check whether Lovable Cloud is enabled for a project                                        |
| `enable_database`     | Enable Lovable Cloud on a Lovable project (takes 30-60 seconds)                             |
| `query_database`      | Execute an SQL query on a Lovable Cloud project. Supports reads, writes, and schema changes |

### Connectors

| Tool                        | Description                                                                                                                             |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `list_connectors`           | List all connector integrations available in a workspace (standard, seamless, and MCP), with their enabled status                       |
| `list_connections`          | List authenticated connector accounts for a workspace                                                                                   |
| `list_custom_connectors`    | List MCP connectors added to a workspace, both from the catalog and custom                                                              |
| `list_available_connectors` | Browse featured MCP connector templates available to add                                                                                |
| `add_connector`             | Get the Lovable dashboard URL where you can add a connector. Connectors are always added through the Lovable UI, never programmatically |
| `remove_connector`          | Remove an MCP connector from a workspace                                                                                                |

### Analytics

| Tool                          | Description                                                                                                                                                                                                |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `get_project_analytics`       | Get historical analytics for a published project: visitors, pageviews, bounce rate, session duration, and breakdowns by page, source, device, and country. Requires `start_date` and `end_date` (RFC 3339) |
| `get_project_analytics_trend` | Get the real-time visitor count and 5-minute trend for a published project                                                                                                                                 |

### File uploads

| Tool                  | Description                                                          |
| --------------------- | -------------------------------------------------------------------- |
| `get_file_upload_url` | Get a presigned URL to upload a file for use as a message attachment |

### Client-specific tools

Two tools only appear in certain clients:

* `render_project_widget` shows a live build-progress widget after `create_project`. It appears in clients that support MCP Apps, such as ChatGPT.
* `import-claude-design-from-url` imports a Claude design into a new Lovable project. It appears in Claude clients only.

## Skills

A skill is a reusable instruction file that tells your AI client how to use the Lovable MCP server effectively: when to trigger it, how to sequence tool calls, and what patterns to follow. Add it to your client once and it will know how to drive Lovable without extra prompting.

Lovable publishes the skill at [mcp.lovable.dev/skill.md](https://mcp.lovable.dev/skill.md). It is maintained alongside the server, so it always matches the tools the server currently exposes. Download the file and add it to your client's skills or instructions directory, for example `.claude/skills/lovable-mcp/SKILL.md` for Claude Code.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Tools not showing after connecting">
    Run `tools/list` to confirm the connection. If tools don't appear, troubleshoot based on how you connected:

    * **Connected through the client's UI (OAuth):** Open your client's connector or MCP settings, remove the Lovable entry, and add it again to re-run the OAuth flow.
    * **Using a config file:** Open the config file and confirm the JSON is valid and the `"lovable"` entry is nested inside the existing `mcpServers` object. Restart the client after saving.
  </Accordion>

  <Accordion title="Workspace not found">
    Call `list_workspaces` to retrieve valid workspace IDs. If you omit `workspace_id` on `create_project`, Lovable picks the workspace automatically when only one is eligible; if multiple workspaces qualify, the tool returns a `WAITING` response listing them so you can re-call with a specific `workspace_id`.
  </Accordion>

  <Accordion title="Project not found">
    The project ID is incorrect or the project was deleted. Call `list_projects` with the workspace ID to find the correct ID.
  </Accordion>

  <Accordion title="No database found">
    The project doesn't have a database provisioned. Call `enable_database` first (takes 30-60 seconds), then retry.
  </Accordion>

  <Accordion title="SQL query returns no results">
    Confirm the table exists by running `SELECT table_name FROM information_schema.tables` through `query_database` first, then query the table you need.
  </Accordion>

  <Accordion title="MCP client prompts you to sign in again (SSO workspaces)">
    If your workspace has **Enforce SSO** enabled with a session duration (24 hours, 48 hours, or 7 days), the Lovable MCP server requires a fresh SSO sign-in once that window elapses.

    When the session expires, the server responds with `401 Unauthorized` and a `WWW-Authenticate: Bearer error="invalid_token"` challenge. Spec-compliant MCP clients (Claude Desktop, Cursor, Claude Code) automatically restart the OAuth flow, which opens a browser window so you can re-authenticate against your identity provider.

    To resolve it, complete the sign-in prompt in your browser. Your client picks up the new token automatically and tool calls resume.

    See [Set up single sign-on (SSO)](/features/business/sso) for how workspace owners and admins configure session duration.
  </Accordion>
</AccordionGroup>

## FAQ

<AccordionGroup>
  <Accordion title="What is the difference between the Lovable MCP server and chat connectors?">
    [Chat connectors](/integrations/chat-connectors) let the **Lovable agent** connect to your external tools (for example, Notion, Linear, or Miro) during a build session. The Lovable MCP server is the reverse: it lets **your external client** (ChatGPT, Claude, Claude Code, Cursor, or VS Code) connect to Lovable and control it programmatically.
  </Accordion>

  <Accordion title="Which plans can use the Lovable MCP server?">
    All plans. On Enterprise workspaces, a workspace admin or owner must first enable [Third-party MCP clients](/features/privacy-and-security-settings#third-party-mcp-clients) in **Settings → Security → Privacy & security**.
  </Accordion>

  <Accordion title="Can I connect with an API key?">
    API key authentication is not currently available. OAuth is the only supported way to connect to the Lovable MCP server.
  </Accordion>

  <Accordion title="Does using the MCP server consume my Lovable credits?">
    Standard Lovable credits apply to `create_project` and `send_message` calls. Other tools are free.
  </Accordion>

  <Accordion title="What permissions does the MCP server have?">
    The MCP server inherits your Lovable user permissions exactly, with no additional surface area.
  </Accordion>
</AccordionGroup>
