Lovable MCP Skill
Connect Hermes Agent to Lovable's remote MCP server (https://mcp.lovable.dev) so
the agent can create full-stack apps (React + Tailwind + shadcn/ui + Supabase),
iterate on them by chat, query their Postgres database, and deploy to production —
without opening the Lovable editor. This skill documents the exact working setup
(including two non-obvious workarounds), the operational guardrails, and a
standalone driver script that works even before MCP tools load into a session.
When to Use
- "Build me a Lovable app / landing page / dashboard / internal tool"
- "Deploy my Lovable project" / "show me what changed in my Lovable project"
- "Run SQL against my Lovable project's database"
- Setting up a new machine or Hermes profile to use Lovable (the setup below is
the proven path — don't improvise, Lovable's OAuth rejects naive attempts)
- Don't use for: Lovable's chat connectors (those let Lovable call YOUR tools —
this is the reverse), or non-Lovable MCP servers (use
mcp-server-connectivity).
Prerequisites
- Lovable account, any plan. Third-party MCP client access must be enabled for
the workspace (default ON for Free/Pro/Business; Enterprise admins must enable
it in Settings → Security → Privacy & security → Third-party MCP clients).
- The
mcp Python package in the Hermes venv (Hermes installs it; check with
terminal: ~/.hermes/hermes-agent/venv/bin/python -c "import mcp").
- MCP tool calls spend real Lovable credits (builds, chat iterations). SQL
queries, file reads, and diffs are free.
Procedure — Setup (first time per machine)
Perform steps in this exact order via the terminal tool. Steps 2–3 are the
critical workaround: Lovable's OAuth server rejects Hermes' default client-identity
style (CIMD) with invalid_client, despite advertising support for it. Forcing
dynamic client registration fixes it.
- Add the server. Answer
Y to "continue without authentication" and y to
"save config anyway" (it cannot authenticate yet — that's expected):hermes mcp add lovable --url https://mcp.lovable.dev --auth oauth
Completion check: hermes mcp ls shows lovable (status disabled is fine).
- Force dynamic client registration. The value must be a real boolean:
hermes config set mcp_servers.lovable.oauth.cimd false
Completion check: hermes config get mcp_servers.lovable shows cimd: false.
- Authenticate. If a desktop browser is available on this machine, just run
hermes mcp login lovable and complete the browser flow. On a headless or
remote machine (agent host ≠ your screen), run it in a background PTY and
drive the flow through a page the user can see:
- Start:
terminal(command="hermes mcp login lovable", background=true, pty=true)
process(action="log", ...) → copy the printed
https://lovable.dev/oauth/authorize?... URL
- Open it where the user can see it (e.g. Hermes desktop preview pane);
user logs in to Lovable and clicks Authorize
- The browser lands on
http://127.0.0.1:<port>/callback?code=... and shows a
connection error — that is the success path; the code is in the address bar
- Paste that full URL into the still-running login process:
process(action="submit", data="<callback URL>")
- The PKCE code is single-use and the login process must still be alive
when you paste — if it exited, restart from the
login step
Completion check: output shows ✓ Authenticated — N tool(s) available and
$HERMES_HOME/mcp-tokens/lovable.json exists.
- Verify:
hermes mcp test lovable connects and lists ~40 tools.
- Restart the Hermes session (or spawn a new one) — MCP tools load at startup
as
mcp_lovable_<tool> and are available in every conversation on every
platform. The current session will NOT see them (loader initializes at
session start; that's expected, not a bug).
How to Run
Prefer the injected mcp_lovable_* tools in normal conversation. For scripts,
cron jobs, or before a restart, use the bundled driver (run with the Hermes venv
python, which has the mcp package):
~/.hermes/hermes-agent/venv/bin/python scripts/lovable_mcp.py tools
~/.hermes/hermes-agent/venv/bin/python scripts/lovable_mcp.py call list_workspaces
~/.hermes/hermes-agent/venv/bin/python scripts/lovable_mcp.py call create_project \
--data '{"workspace_id": "<id>", "initial_message": "Build a todo app", "wait": true}'
--server overrides the token name (default lovable). Token path resolves via
$HERMES_HOME (default ~/.hermes). The driver does NOT refresh tokens — if a
call returns 401, re-run hermes mcp login lovable.
Quick Reference — workflow
list_workspaces → workspace id (call first; create_project needs it when
the account has more than one workspace)
create_project(workspace_id, initial_message, wait=true) → full build;
returns projectId, message_id, preview_url
set_project_visibility(project_id, "private") immediately — see Pitfalls
get_diff(project_id, message_id) → review what the agent changed
send_message(project_id, msg, plan_mode=true) to discuss architecture
before code; wait=true (default) blocks until the build finishes
enable_database → query_database (live SQL incl. DDL and writes)
deploy_project(project_id) → live URL on lovable.app
Full tool reference: references/tools.md.
Pitfalls
invalid_client on the authorize page = CIMD rejected. Fix is step 2 of
setup (oauth.cimd: false). Verify it survived: config values must be real
YAML booleans, not the string "false".
- No
delete_project tool exists. Remove projects only in the Lovable
dashboard. Keep test junk private.
set_project_visibility first. deploy_project on Free/Pro publishes to
a URL anyone with the link can reach; previews of draft projects are
semi-public by default until set private.
- Scope is the whole account. One OAuth grant = the client can read and edit
every Lovable project the account can access. Revoke via Lovable Settings →
Build & deploy → MCP server → Manage access (or Third-party MCP clients).
- Credits.
create_project and send_message consume Lovable credits.
Retries within ~2 minutes are deduplicated by the server (a retry returns
deduplicated: true with the original IDs — treat it as the earlier call's
result, don't build twice).
send_message is slow. Builds take minutes; keep tool-call timeouts high
(pass wait=false + poll with get_message for long builds).
- 401 on every call = refresh token dead or tokens wiped. Re-run
hermes mcp login lovable (the dynamic-registered client persists in
$HERMES_HOME/mcp-tokens/lovable.client.json; login reuses it).
- Connectors cannot be added programmatically —
add_connector only returns
a dashboard URL; the human adds the connector in the Lovable UI.
Verification
hermes mcp test lovable → connects, lists ~40 tools.
list_workspaces returns the account's workspace(s) — proves auth end-to-end.
- Smoke test (spends one credit, disclose first):
create_project with a
minimal one-page prompt, check status: completed, get_diff returns a real
diff, preview URL renders. Keep it private; delete in the dashboard after.
1---2name: lovable-mcp3description: Drive Lovable app-building from Hermes via remote MCP.4license: MIT5---67# Lovable MCP Skill89Connect Hermes Agent to Lovable's remote MCP server (`https://mcp.lovable.dev`) so10the agent can create full-stack apps (React + Tailwind + shadcn/ui + Supabase),11iterate on them by chat, query their Postgres database, and deploy to production —12without opening the Lovable editor. This skill documents the exact working setup13(including two non-obvious workarounds), the operational guardrails, and a14standalone driver script that works even before MCP tools load into a session.1516## When to Use1718- "Build me a Lovable app / landing page / dashboard / internal tool"19- "Deploy my Lovable project" / "show me what changed in my Lovable project"20- "Run SQL against my Lovable project's database"21- Setting up a new machine or Hermes profile to use Lovable (the setup below is22 the proven path — don't improvise, Lovable's OAuth rejects naive attempts)23- Don't use for: Lovable's *chat connectors* (those let Lovable call YOUR tools —24 this is the reverse), or non-Lovable MCP servers (use `mcp-server-connectivity`).2526## Prerequisites2728- Lovable account, any plan. Third-party MCP client access must be enabled for29 the workspace (default ON for Free/Pro/Business; Enterprise admins must enable30 it in Settings → Security → Privacy & security → Third-party MCP clients).31- The `mcp` Python package in the Hermes venv (Hermes installs it; check with32 `terminal`: `~/.hermes/hermes-agent/venv/bin/python -c "import mcp"`).33- MCP tool calls spend **real Lovable credits** (builds, chat iterations). SQL34 queries, file reads, and diffs are free.3536## Procedure — Setup (first time per machine)3738Perform steps in this exact order via the `terminal` tool. Steps 2–3 are the39critical workaround: Lovable's OAuth server rejects Hermes' default client-identity40style (CIMD) with `invalid_client`, despite advertising support for it. Forcing41dynamic client registration fixes it.42431. Add the server. Answer `Y` to "continue without authentication" and `y` to44 "save config anyway" (it cannot authenticate yet — that's expected):45 ```46 hermes mcp add lovable --url https://mcp.lovable.dev --auth oauth47 ```48 Completion check: `hermes mcp ls` shows `lovable` (status `disabled` is fine).492. Force dynamic client registration. The value must be a real boolean:50 ```51 hermes config set mcp_servers.lovable.oauth.cimd false52 ```53 Completion check: `hermes config get mcp_servers.lovable` shows `cimd: false`.543. Authenticate. If a desktop browser is available on this machine, just run55 `hermes mcp login lovable` and complete the browser flow. On a headless or56 remote machine (agent host ≠ your screen), run it in a background PTY and57 drive the flow through a page the user can see:58 - Start: `terminal(command="hermes mcp login lovable", background=true, pty=true)`59 - `process(action="log", ...)` → copy the printed60 `https://lovable.dev/oauth/authorize?...` URL61 - Open it where the user can see it (e.g. Hermes desktop preview pane);62 user logs in to Lovable and clicks **Authorize**63 - The browser lands on `http://127.0.0.1:<port>/callback?code=...` and shows a64 connection error — that is the success path; the code is in the address bar65 - Paste that full URL into the still-running login process:66 `process(action="submit", data="<callback URL>")`67 - The PKCE code is **single-use** and the login process must still be alive68 when you paste — if it exited, restart from the `login` step69 Completion check: output shows `✓ Authenticated — N tool(s) available` and70 `$HERMES_HOME/mcp-tokens/lovable.json` exists.714. Verify: `hermes mcp test lovable` connects and lists ~40 tools.725. Restart the Hermes session (or spawn a new one) — MCP tools load at startup73 as `mcp_lovable_<tool>` and are available in every conversation on every74 platform. The current session will NOT see them (loader initializes at75 session start; that's expected, not a bug).7677## How to Run7879Prefer the injected `mcp_lovable_*` tools in normal conversation. For scripts,80cron jobs, or before a restart, use the bundled driver (run with the Hermes venv81python, which has the `mcp` package):8283```84~/.hermes/hermes-agent/venv/bin/python scripts/lovable_mcp.py tools85~/.hermes/hermes-agent/venv/bin/python scripts/lovable_mcp.py call list_workspaces86~/.hermes/hermes-agent/venv/bin/python scripts/lovable_mcp.py call create_project \87 --data '{"workspace_id": "<id>", "initial_message": "Build a todo app", "wait": true}'88```8990`--server` overrides the token name (default `lovable`). Token path resolves via91`$HERMES_HOME` (default `~/.hermes`). The driver does NOT refresh tokens — if a92call returns 401, re-run `hermes mcp login lovable`.9394## Quick Reference — workflow95961. `list_workspaces` → workspace id (call first; `create_project` needs it when97 the account has more than one workspace)982. `create_project(workspace_id, initial_message, wait=true)` → full build;99 returns `projectId`, `message_id`, `preview_url`1003. `set_project_visibility(project_id, "private")` immediately — see Pitfalls1014. `get_diff(project_id, message_id)` → review what the agent changed1025. `send_message(project_id, msg, plan_mode=true)` to discuss architecture103 before code; `wait=true` (default) blocks until the build finishes1046. `enable_database` → `query_database` (live SQL incl. DDL and writes)1057. `deploy_project(project_id)` → live URL on `lovable.app`106107Full tool reference: `references/tools.md`.108109## Pitfalls110111- **`invalid_client` on the authorize page** = CIMD rejected. Fix is step 2 of112 setup (`oauth.cimd: false`). Verify it survived: config values must be real113 YAML booleans, not the string `"false"`.114- **No `delete_project` tool exists.** Remove projects only in the Lovable115 dashboard. Keep test junk private.116- **`set_project_visibility` first.** `deploy_project` on Free/Pro publishes to117 a URL anyone with the link can reach; previews of draft projects are118 semi-public by default until set private.119- **Scope is the whole account.** One OAuth grant = the client can read and edit120 every Lovable project the account can access. Revoke via Lovable Settings →121 Build & deploy → MCP server → Manage access (or Third-party MCP clients).122- **Credits.** `create_project` and `send_message` consume Lovable credits.123 Retries within ~2 minutes are deduplicated by the server (a retry returns124 `deduplicated: true` with the original IDs — treat it as the earlier call's125 result, don't build twice).126- **`send_message` is slow.** Builds take minutes; keep tool-call timeouts high127 (pass `wait=false` + poll with `get_message` for long builds).128- **401 on every call** = refresh token dead or tokens wiped. Re-run129 `hermes mcp login lovable` (the dynamic-registered client persists in130 `$HERMES_HOME/mcp-tokens/lovable.client.json`; login reuses it).131- **Connectors cannot be added programmatically** — `add_connector` only returns132 a dashboard URL; the human adds the connector in the Lovable UI.133134## Verification135136- `hermes mcp test lovable` → connects, lists ~40 tools.137- `list_workspaces` returns the account's workspace(s) — proves auth end-to-end.138- Smoke test (spends one credit, disclose first): `create_project` with a139 minimal one-page prompt, check `status: completed`, `get_diff` returns a real140 diff, preview URL renders. Keep it private; delete in the dashboard after.