Lovable MCP server: use Lovable from Claude Code, Codex or Cursor

Lovable is also an MCP server. You add mcp.lovable.dev to Claude Code, Codex or Cursor, and that agent can create Lovable projects, send messages to Lovable's agent, read the code, run SQL on the database and deploy. So do you still need to leave Lovable? If you wanted to work from your own editor or terminal, probably yes. The MCP server is a remote control. Lovable's agent still writes the code, in Lovable, on your Lovable credits. But it is useful while you move out, because it lets your new tool look inside the Lovable project first.

A remote control, not a way out

What it is

Lovable released the MCP server on 7 May 2026 as a research preview for Pro and Business. Since 3 June 2026 it works on every plan, Free included.

Lovable already had chat connectors. Those let Lovable's agent use your tools, like Notion or Linear, while you build. The MCP server is the other direction. Your AI client connects to Lovable and manages your projects from there.

Lovable's docs give setup steps for ChatGPT, Claude (desktop and claude.ai), Claude Code, Cursor and VS Code. Lovable's GitHub repository adds Codex, and since 22 July 2026 the server is also a Codex plugin.

There is also a Lovable API. That one is for your own scripts, uses an API key and needs a Business or Enterprise plan. It manages and deploys existing projects and uses no AI credits. Creating and editing projects with AI goes through the MCP server.

Who can use it and what it costs

  • It works on every plan, Free included.
  • Third-party MCP client access is on by default for Free, Pro and Business workspaces. On Enterprise it is off. An admin or owner turns it on in Workspace settings, Security, Privacy & security, under Third-party MCP clients.
  • create_project and send_message use your normal Lovable credits. The other tools are free.
  • You log in with OAuth. API keys do not work for the MCP server.

So nothing gets cheaper. Every change Lovable's agent makes still costs credits, whether you typed the prompt in Lovable or in Claude Code. Out of Lovable credits? explains how they work.

Connect it to Claude Code

The first time a Lovable tool runs, your client opens a browser window and you log in to Lovable. After that, ask your agent to list your Lovable workspaces. If you get a list back, it works.

In Claude Code, run this in your terminal:

claude mcp add --transport http lovable "https://mcp.lovable.dev"

Or install Lovable's plugin, which also adds slash commands for common tasks:

/plugin install lovable@claude-plugins-official

Check it with /mcp. You should see a server called lovable.

Connect it to Codex

These are the commands from Lovable's GitHub repository:

codex mcp add lovable --url https://mcp.lovable.dev
codex mcp login lovable

Lovable's skill.md file shows the first command without --url. OpenAI's Codex docs add a remote server with --url, so use the version above.

Connect it to Cursor

The easy way is Lovable's Cursor plugin. It connects the server and adds /lovable-new, /lovable-iterate, /lovable-db and /lovable-deploy.

To do it by hand, add this to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json in your project. The CLIENT_ID is Lovable's public OAuth client ID, from Lovable's docs.

{
  "mcpServers": {
    "lovable": {
      "type": "http",
      "url": "https://mcp.lovable.dev",
      "auth": {
        "CLIENT_ID": "6d465f583e1e4ce5801b1616f735670c"
      }
    }
  }
}

If the file already has an mcpServers block, put the lovable entry inside it. A second mcpServers block breaks the JSON. Reload the Cursor window after saving.

Five things it's good for when you move

You are about to leave Lovable for Claude Code, Codex or Cursor. Before you do, connect the MCP server in that new tool and let it look around. All five below are reads, so they cost no credits.

1. Let your new agent read the project

list_projects, list_files and read_file give your agent the code as it is in Lovable right now. A prompt like this is enough:

Find my Lovable project called [name]. List its files and tell me if it runs on Vite or TanStack Start.

That answer decides a lot of your later steps. Is your Lovable app TanStack Start or Vite? explains why.

2. Take your Knowledge with you

Your project and workspace Knowledge are the instructions Lovable's agent follows. They don't come with the code. get_project_knowledge and get_workspace_knowledge read them.

Read the project knowledge and the workspace knowledge for [project]. Write both into CLAUDE.md in this repo.

For Codex and Cursor, use AGENTS.md instead. More in Take your Lovable Knowledge to CLAUDE.md or AGENTS.md.

3. Look at the database before you move it

query_database runs SQL on the project's built-in database, the one Lovable sets up. If your app uses your own Supabase project, this tool doesn't apply. You manage that database in Supabase. Not sure which one you have? See Lovable Cloud or Supabase: which one does your app use?

Lovable's docs use this query to list the tables:

SELECT table_name FROM information_schema.tables

Then ask your agent for row counts per table, so you can compare after the move.

query_database runs with your full database permissions: reads, writes and schema changes. Tell your agent to only run SELECT.

And this is not a backup. Do the backup properly first with Back up the database of a Lovable app, then Move Lovable Cloud to your own Supabase project.

4. Save your traffic numbers

If the app is published on Lovable, get_project_analytics returns visits, page views, bounce rate and visit duration, with breakdowns by page, source, device and country. You give it a start and end date. Save the numbers before you switch hosts, so you have something to compare with after the move, especially for SEO. See Lovable SEO after you move.

5. See what Lovable changed

list_edits lists the edit history with commit SHAs. get_diff shows what changed in one message or between two commits. Handy if you still edit in Lovable for a while and in your new tool at the same time.

If you do that, read Keep Lovable in sync when you edit in another tool first. Two agents on the same code is how changes get lost.

What it won't do

It does not export your code. You can read files through the MCP server, but the way out is still GitHub. See Export a Lovable project to GitHub.

It does not edit your local files. send_message sends a prompt to Lovable's agent, which changes the project in Lovable. If your local folder is a clone of the connected GitHub repository, you pull those changes like any other commit.

It only deploys to Lovable. deploy_project publishes to lovable.app. Hosting somewhere else is still your job.

It won't deploy past critical security findings. If the latest security scan has unresolved critical findings that block publishing, deploy_project refuses with a 400 error. You fix or ignore them in the project's Security view and try again.

Before you connect

  • The connection is not limited to one project. It can reach every project and workspace your account can reach, within the scopes you approve.
  • Calls are live. They edit real projects and spend real credits.
  • On Free and Pro, a deployed app is open to anyone with the link, unless its website access is set to Invite only.

One more thing, because people search for a Lovable CLI. Lovable's docs don't list a command-line tool of its own. From Claude Code or Codex, the MCP server is the closest thing. If a page tells you to install a Lovable CLI from npm, check who published it first.

Use the MCP server or leave?

Keep Lovable and use the MCP server if you like Lovable's agent and Lovable's hosting, and you only want to drive it from Claude Code, Codex or Cursor instead of the browser.

Leave if you want your own agent to write the code, want to stop paying credits for every change or want the app hosted somewhere else. Then use the MCP server for the five reads above and follow a step-by-step route: Lovable to Claude Code, Lovable to Codex or Lovable to Cursor.

Still deciding? Start with Should you leave Lovable for Claude Code? and the Lovable migration checklist.

Sources

  1. Lovable docs: Lovable MCP server
  2. Lovable MCP: skill.md tool reference
  3. Lovable on GitHub: lovablelabs/mcp
  4. Lovable: MCP server
  5. Lovable docs: Lovable API
  6. Lovable docs: Changelog
  7. Lovable on LinkedIn: Lovable MCP server launch
  8. Codex docs: Model Context Protocol

Read next

Pick your route.

Choose where you are and where you want to go. The guide takes it from there.