当前位置: 首页 > Skill >

Lovable MCP

Lovable MCP

Lovable MCP

使用 Lovable 的 MCP 服务器,通过自然语言提示创建、迭代和部署全栈 Web 应用。在用户想要构建时触发此技能。

1.0.0 2026.11.26 823
获取Skill文件查看使用说明
作 者:叶言 许可证: 更新时间:2026.11.26
本文目录展开

Lovable MCP Server

Build, iterate, inspect, and deploy full-stack web apps through Lovable's MCP server — without ever opening the Lovable UI.

Lovable's agent handles the heavy lifting: you describe what you want in plain language, and it builds a working app (React + Vite + Tailwind + shadcn/ui + Supabase when needed). The MCP server exposes this capability programmatically, so you can drive the entire workflow from any agent that supports skills.

What is Lovable MCP?

Lovable provides a Model Context Protocol (MCP) server at https://mcp.lovable.dev that gives AI agents direct access to:

  • Create, read, update, and delete Lovable projects
  • Send prompts to Lovable's AI agent for building/iterating on apps
  • Deploy projects to production
  • Read source code and review diffs
  • Manage workspace-level governance
  • Query analytics

Authentication is OAuth 2.1+PKCE. The MCP server supports the standard MCP OAuth flow:

  1. Contact the server → receive WWW-Authenticate: Bearer challenge
  2. Fetch OAuth metadata from https://lovable.dev/oauth/.well-known/oauth-authorization-server
  3. Redirect user to the authorization endpoint with PKCE
  4. Exchange the authorization code for tokens at the token endpoint
  5. Use the access token as Authorization: Bearer in all subsequent calls

Prerequisites

  • A Lovable account (Pro or Business plan recommended — needed for API access)
  • A CLIENT_ID from Lovable support (email support@lovable.dev and ask for MCP OAuth client credentials)
  • curl (should be available on any system)
  • python3 (for scripts, should be available on any system)

Setup

Step 1: Get credentials from Lovable

Contact Lovable support (support@lovable.dev) and request MCP OAuth client credentials. They will provide a CLIENT_ID (a hex string like 0123456789abcdef0123456789abcdef).

This CLIENT_ID is registered with a specific redirect URI. The skill scripts use this redirect URI during the OAuth flow.

Step 2: Run the OAuth setup

# Make the scripts executable
chmod +x scripts/*.sh

# Run the OAuth setup — this will generate a PKCE authorization URL for you
bash scripts/lovable-oauth-setup.sh

The script will:

  1. Generate a cryptographically random PKCE code_verifier + code_challenge
  2. Print an authorization URL for you to open in your browser
  3. Wait for you to paste back the redirect URL containing the ?code= parameter
  4. Exchange the code for access + refresh tokens
  5. Save the tokens to config/lovable-tokens.json

Step 3: Test the connection

# Get the access token (auto-refreshes if expired)
TOKEN=$(bash scripts/lovable-get-token.sh)

# Test: list your profile and workspaces
curl -s -X POST https://mcp.lovable.dev/ 
  -H "Content-Type: application/json" 
  -H "Accept: application/json, text/event-stream" 
  -H "Authorization: Bearer $TOKEN" 
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_me","arguments":{}},"id":1}'

Step 4: Configure your MCP server in OpenClaw

Add the Lovable MCP server to your openclaw.json:

{
  "mcp": {
    "servers": {
      "lovable": {
        "url": "https://mcp.lovable.dev",
        "type": "http",
        "auth": {
          "CLIENT_ID": "<your-client-id>"
        }
      }
    }
  }
}

Then restart the gateway:

openclaw gateway restart

OAuth Details

The OAuth flow uses PKCE (Proof Key for Code Exchange) as required by the MCP OAuth 2.1 specification.

Authorization URL parameters

Parameter Value
response_type code
client_id Your CLIENT_ID
code_challenge_method S256
code_challenge Base64URL(SHA256(code_verifier))
scope offline projects:read projects:write projects:create workspaces:read workspaces:write
state Random anti-CSRF token

Token endpoint

Exchange the authorization code at https://lovable.dev/oauth/token:

Parameter Value
grant_type authorization_code
code The authorization code from the redirect
redirect_uri The registered redirect URI for your client
client_id Your CLIENT_ID
code_verifier The PKCE verifier you generated

Refresh token

When the access token expires (after 8 hours), use the refresh token:

curl -s -X POST https://lovable.dev/oauth/token 
  -H "Content-Type: application/x-www-form-urlencoded" 
  -d "grant_type=refresh_token" 
  -d "refresh_token=<your-refresh-token>" 
  -d "client_id=<your-client-id>" 
  -d "redirect_uri=<your-registered-redirect-uri>"

How to Use

1. Find your workspace ID

TOKEN=$(bash scripts/lovable-get-token.sh)
curl -s -X POST https://mcp.lovable.dev/ 
  -H "Content-Type: application/json" 
  -H "Accept: application/json, text/event-stream" 
  -H "Authorization: Bearer $TOKEN" 
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"list_workspaces","arguments":{}},"id":1}'

2. List all projects

TOKEN=$(bash scripts/lovable-get-token.sh)
WORKSPACE_ID="<your-workspace-id>"

curl -s -X POST https://mcp.lovable.dev/ 
  -H "Content-Type: application/json" 
  -H "Accept: application/json, text/event-stream" 
  -H "Authorization: Bearer $TOKEN" 
  -d "{"jsonrpc":"2.0","method":"tools/call","params":{"name":"list_projects","arguments":{"workspace_id":"$WORKSPACE_ID"}},"id":1}"

3. Deploy a project

TOKEN=$(bash scripts/lovable-get-token.sh)
PROJECT_ID="<your-project-id>"

curl -s -X POST https://mcp.lovable.dev/ 
  -H "Content-Type: application/json" 
  -H "Accept: application/json, text/event-stream" 
  -H "Authorization: Bearer $TOKEN" 
  -d "{"jsonrpc":"2.0","method":"tools/call","params":{"name":"deploy_project","arguments":{"project_id":"$PROJECT_ID"}},"id":1}"

4. Send a prompt to the Lovable agent

TOKEN=$(bash scripts/lovable-get-token.sh)
PROJECT_ID="<your-project-id>"

curl -s -X POST https://mcp.lovable.dev/ 
  -H "Content-Type: application/json" 
  -H "Accept: application/json, text/event-stream" 
  -H "Authorization: Bearer $TOKEN" 
  -d "{"jsonrpc":"2.0","method":"tools/call","params":{"name":"send_message","arguments":{"project_id":"$PROJECT_ID","message":"Add a dark mode toggle to the header"}},"id":1}"

Deploy Workflow

Combine this skill with a CI/CD or agent workflow:

  1. Code is reviewed and merged to main in your git repo
  2. An agent (or CI) checks if the project exists on Lovable using list_projects
  3. Agent asks the user for deploy approval
  4. On approval, agent calls deploy_project(project_id)
  5. Agent reports the production URL

Tool Reference

Project Operations

Tool Parameters Description
create_project workspace_id (required), description (required), initial_message, tech_stack, visibility, template_project_id, selected_libraries Create a new Lovable project
send_message project_id (required), message (required), wait, timeout_seconds, plan_mode Send a prompt to the Lovable agent
get_project project_id (required) Get project details (URLs, latest commit, status)
list_projects workspace_id (required), query, visibility, sort_by, limit List/search all workspace projects
deploy_project project_id (required), name (optional slug) Publish current build to production

Code & History

Tool Parameters Description
list_files project_id, ref List files at a git ref
read_file project_id, ref, path Read full file contents
get_diff project_id, message_id View diff for a specific edit
list_edits project_id Full edit history (reverse chronological)
get_message project_id, message_id Check status of a send_message

Workspace

Tool Parameters Description
list_workspaces (none) List all workspaces
get_workspace workspace_id (required) Workspace details: plan, credits, members
get_me (none) Auth user profile

Database (Lovable Cloud)

Tool Parameters Description
get_database_status project_id (required) Check if DB is enabled
enable_database project_id (required) Provision PostgreSQL
query_database project_id (required), query (required) Run SQL

Analytics

Tool Parameters Description
get_project_analytics project_id, start_date, end_date Historical metrics
get_project_analytics_trend project_id Real-time visitors

Governance

Tool Parameters Description
get_workspace_knowledge workspace_id Read AI governance policies
set_workspace_knowledge workspace_id, text Set workspace-wide AI rules

Connectors

Tool Parameters Description
list_connectors workspace_id List connected services
list_available_connectors workspace_id Browse available connectors
add_connector connector_id Get URL to add a connector via dashboard
remove_connector workspace_id, connector_id Remove a connector

Common Patterns

Build and deploy in one flow

  1. list_workspaces() → get workspace_id
  2. create_project(workspace_id, description, initial_message) → get project_id
  3. get_project(project_id) → confirm it's built, get preview_url
  4. send_message(project_id, message) → iterate if needed
  5. get_diff(project_id, message_id) → review changes
  6. deploy_project(project_id) → ship it

Audit a workspace

  1. list_workspaces() → get workspace_id
  2. list_projects(workspace_id) → see all projects
  3. For each project: list_edits(), read_file(), get_database_status()

Troubleshooting

Token expired

Run the token refresh script:

bash scripts/lovable-refresh-token.sh

Refresh token also expired

If the refresh token no longer works, run the OAuth setup again:

bash scripts/lovable-oauth-setup.sh

"Invalid API key" error

The Lovable MCP server uses OAuth 2.0 Bearer tokens, NOT the Lovable-API-Key header. The API key from Lovable support only works for tools/list (discovery). For tools/call you MUST use an OAuth Bearer token obtained through the PKCE flow.

Connection refused / timeout

Verify the MCP server is reachable:

curl -s -o /dev/null -w "%{http_code}" https://mcp.lovable.dev/.well-known/oauth-protected-resource

Should return HTTP 200.

Security Notes

  • Never commit tokens or credentials to git. The config/lovable-tokens.json file should be in your .gitignore.
  • The access token is a JWT that expires after 8 hours. The refresh token is a long-lived secret.
  • If you suspect a token leak, revoke it by emailing Lovable support.
  • The OAuth flow should be initiated interactively by a human — never automate the consent step.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,040
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,033
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,021
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,021
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,019
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,016
Skill 文件
  • SKILL.md
    • Lovable MCP Server
    • What is Lovable MCP?
    • Prerequisites
    • Setup
      • Step 1: Get credentials from Lovable
      • Step 2: Run the OAuth setup
      • Step 3: Test the connection
      • Step 4: Configure your MCP server in OpenClaw
    • OAuth Details
      • Authorization URL parameters
      • Token endpoint
      • Refresh token
    • How to Use
      • 1. Find your workspace ID
      • 2. List all projects
      • 3. Deploy a project
      • 4. Send a prompt to the Lovable agent
    • Deploy Workflow
    • Tool Reference
      • Project Operations
      • Code & History
      • Workspace
      • Database (Lovable Cloud)
      • Analytics
      • Governance
      • Connectors
    • Common Patterns
      • Build and deploy in one flow
      • Audit a workspace
    • Troubleshooting
      • Token expired
      • Refresh token also expired
      • "Invalid API key" error
      • Connection refused / timeout
    • Security Notes
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期