# Kleap [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/kleaphq/cli  
**GitHub Stars:** 2  
**npm Downloads (last month):** 211  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/kleap

## Description
Build, edit, publish, and manage websites and web apps with Kleap hosting, domains, and analytics.

## Tools
Capabilities this server exposes over MCP:

- **list_apps** — List the Kleap apps (websites) owned by the authenticated account, newest first. Returns a `pagination` object {total, limit, offset, has_more, next_offset}: the server caps `limit` at 100, so when `has_more` is true, page with `next_offset`. To find ONE site by its domain / URL / slug, use find_app instead of paging through everything.
- **find_app** — Resolve a website the user names by its ADDRESS — a custom domain ("serrureriesk.ch"), a kleap.io URL ("mysite.kleap.io"), or a bare slug ("mysite") — to one of your apps in ONE call. Use this FIRST whenever the user refers to a site by its domain/URL instead of an app id, then pass the returned app_id to the other tools. Returns NOT_FOUND if no owned app matches — then fall back to list_apps.
- **get_app** — Get one Kleap app's metadata: slug, production_url, custom domains, visibility. To specifically confirm a deploy/publish, use get_publish_status.
- **rename_app** — Rename an app's display name. This does NOT change its URL — the live address ({slug}.kleap.io) and any links to it stay intact. (There is no delete tool, by design.)
- **get_screenshot** — Capture (or return the cached) screenshot of an app's site. Returns {image_url, width, height, captured_at, cached} — use it to SEE the result or show it to the user without them opening a browser.
- **wake_app** — Wake a sleeping preview sandbox (legacy Next.js apps). Astro apps have no sandbox and don't need it. Returns the preview_url, ready in ~30-60 s.
- **create_app** — Create a new Kleap website (an Astro site) from a natural-language prompt. Returns app_id + task_id immediately; poll check_task until status='completed' (~1-15 min). The site auto-builds and goes LIVE on completion — no separate publish needed for the first version. Needs ≥5 credits (402 INSUFFICIENT_CREDITS otherwise).
- **modify_app** — Ask a Kleap app's AI to change it — describe the OUTCOME you want (edit copy, add a section or page, add a database, fix a bug); Kleap's AI writes the files. Returns a task — poll check_task. For MANY similar pages (programmatic SEO), ask in ONE call for a single dynamic Astro route + a data file, NOT one page per call. For exact, deterministic changes use read_files → edit_files / write_files → publish_app instead. Needs ≥2 credits.
- **check_task** — Check an async create/modify task. By default it LONG-POLLS: the call holds for up to 'wait' seconds and returns the moment the task finishes — so just call it again while status is queued/processing (10-20 calls through one build is normal). status is one of: queued, processing, completed, failed. On 'completed' the change is built and LIVE (result.production_url). On 'failed', error.code is TASK_TIMEOUT or STALE_TASK (transient — call retry_task, which returns a NEW task_id) or TASK_FAILED (read error.message; retry_task once, and if it repeats, stop and tell the user).
- **retry_task** — Resume a failed/stalled create/modify task from where it stopped (partial files preserved). Returns a NEW task_id — poll check_task on that NEW id. Budget: TASK_TIMEOUT/STALE_TASK up to TWICE, TASK_FAILED only ONCE; then stop and tell the user. NEVER retry a non-transient error (402 INSUFFICIENT_CREDITS, a rejected prompt).
- **publish_app** — Build & publish an app to its live URL, with the VERIFIED-LIVE guarantee: only reported live once provably serving. REQUIRED after write_files / edit_files / delete_files / generate_image (those store files but do not deploy). NOT needed after create_app/modify_app (they auto-deploy). Returns a deploy_key; poll get_publish_status. If a deploy is already running, this returns it (already_running:true) instead of failing — do not loop publish_app.
- **get_publish_status** — Confirm whether an app is actually published and live. status is published | running | deploying (a newer deploy is running — keep polling) | queued | not_published. Once published it carries production_url and a `report` (every internal link checked, JSON-LD/sitemap/robots coverage) — read it instead of re-auditing the site. Pass the deploy_key from publish_app and wait (0-45 s) to long-poll.
- **list_app_files** — List the source file PATHS of a Kleap app (names only). Astro sites: src/pages/*.astro, src/data/*.json, src/components/*.astro, public/*. Then read_files to get contents before editing.
- **read_files** — Read the FULL CONTENTS of existing files (up to 60 per call) so you edit them SAFELY instead of rewriting blind. Allowed with a Read-only key. Returns { files: [{ path, content, type, bytes }], missing: [paths not found] }.
- **write_files** — Write source files DIRECTLY — YOUR model generates the code, Kleap stores, builds and deploys it as-is (deterministic, no Kleap credits). Use for NEW files or wholesale replacement; for a change inside an existing file use edit_files. Binaries (images, fonts, PDFs) go with encoding:'base64'. Max 512 KB per file. AFTER writing, call publish_app.
- **edit_files** — Change PART of existing files in place: each edit replaces old_string with new_string (old_string must match exactly and be unique unless replace_all). Read the file with read_files first. Far safer and cheaper than resending a whole file with write_files. Then publish_app.
- **delete_files** — REMOVE pages or assets (never blank a file to 'delete' it — that leaves a URL answering 200 with nothing). Returns the paths actually deleted. The pages stay live until you publish_app.
- **generate_image** — Put a REAL generated photo/illustration on the site with no bytes to send: give a vivid prompt and a public/ path ending .png/.jpg/.jpeg/.webp. 768×768 by default (width/height 256-1440); hd:true = premium model. To REPLACE an image, generate to a NEW filename and point the markup at it (same path can be served stale). Then publish_app.
- **get_form_submissions** — Read the leads/contacts submitted through the live site's forms, newest first: [{id, submitted_at, data:{...}}]. An empty list is normal for a new site. `since` (ISO 8601, inclusive) returns only newer ones. Needs forms:read — on 403 INSUFFICIENT_SCOPE, the user must create a new API key with the Full preset.
- **get_analytics** — Visitors, pageviews, top pages and referrers of the PUBLISHED site. configured:false means it was never published. Needs analytics:read.
- **get_search_console** — How the site performs IN GOOGLE SEARCH (real Search Console data): clicks, impressions, CTR, position, top queries/pages. Data lags ~2 days. If connected/site_selected is false, call connect_search_console.
- **connect_search_console** — Start Google Search Console for a site: returns a consent_url the USER must open in a browser and approve (it cannot be done from here); the property then binds itself. Requires a connected custom domain (requires_custom_domain:true otherwise).
- **get_credits** — The account's remaining credit balance and whether it is on a paid plan.
- **search_domains** — Search available domains for a name (ONE word, no spaces, no TLD — e.g. 'mybakery'). Returns [{domain, status: free|active, price, currency, purchasable}]. To buy one use buy_domain (the USER pays); to attach one the user already owns use connect_domain.
- **buy_domain** — Create a Stripe CHECKOUT LINK for a domain — this does NOT buy it. Returns {checkout_url, domain, years, price, currency, expires_at}: give checkout_url to the USER, who pays it themselves. Only after they pay does Kleap register the domain (and connect it to app_id if given). NEVER tell the user the domain is bought or live until check_domain confirms it. Needs domains:checkout (Full preset key).
- **check_domain** — A domain's connection / DNS status on Kleap: active (serving, TLS provisioning), pending_dns (A record not set yet — relay the message), aaaa_conflict (remove the AAAA record). Also use it after a buy_domain checkout to see if the paid domain is registered.
- **connect_domain** — Connect a domain the user ALREADY OWNS to a live Kleap app (routing + automatic TLS). A completed create_app/modify_app already counts as live. The response's dns_config lists the exact A records to set at the registrar — relay them. Paid plan required (403 PLAN_REQUIRED otherwise). Does not buy anything.
- **get_database_schema** — The app's Postgres database (Kleap Database): tables with row_count (a planner ESTIMATE, null if never analyzed — use run_database_sql count(*) for an exact number) and columns {name, type, nullable, default, primary_key}. 409 DATABASE_NOT_PROVISIONED means the app has no database yet — ask modify_app to 'add a database' first. Needs database:read.
- **query_database_rows** — Read rows of one table. where = equality filter object ({"status":"new"}); limit ≤500 (default 100); page with offset while has_more. At most 5 MB per call (fewer rows + truncated:true beyond); a row over 256 KB comes back as {__kleap_value_too_large:true, bytes}. Needs database:read. Returns {table, rows, limit, offset, has_more}.
- **insert_database_rows** — Insert rows (≤500 per call) into a table. Returns {table, inserted, rows} (rows = RETURNING *). Needs database:write.
- **update_database_rows** — Update the rows matching `where` (equality filters, REQUIRED and non-empty) with the values in `set`. Returns {table, updated, rows}. Needs database:write.
- **delete_database_rows** — Delete the rows matching `where` (equality filters, REQUIRED and non-empty). Returns {table, deleted}. Irreversible — read the rows first. Needs database:write.
- **run_database_sql** — Run SQL on the app's database with $1..$n params. Owner-level access: ALWAYS needs database:write, even for a SELECT (to just read rows, prefer query_database_rows, which only needs database:read). Accepted: one query (SELECT/WITH/VALUES/TABLE), INSERT/UPDATE/DELETE/MERGE (± RETURNING), CREATE/ALTER/DROP/TRUNCATE/GRANT/REVOKE/COMMENT/DO/ANALYZE/REFRESH/SET/RESET; anything else (EXPLAIN, SHOW, COPY, CALL, a multi-statement script with a query or RETURNING…) → 400 UNSUPPORTED_STATEMENT. Rows capped at 500 / 5 MB (truncated:true). Timeout 20 s for SELECT, 60 s otherwise. After DDL, a public table without row level security is refused with 422 RLS_REQUIRED — include ALTER TABLE … ENABLE ROW LEVEL SECURITY. Returns {command, row_count, rows}.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "kleap": {
    "command": "npx",
    "args": ["-y","kleap-cli"],
    "env": {
      "KLEAP_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `KLEAP_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Kleap MCP server does

The Kleap MCP server gives an MCP-compatible agent access to Kleap’s website infrastructure. It can create a new site from a prompt, ask Kleap’s AI to modify an existing site, generate an image directly into the site’s `public/` directory, and publish the result. Publishing includes a verified-live check, so the response can include confirmation that the deployed site is serving.

App references can be resolved from a numeric ID, slug, Kleap URL, or connected custom domain through `find_app`. This lets an agent accept a URL from a user without requiring the user to know Kleap’s internal app ID. `list_apps` provides the account’s apps and can also expose an individual app’s details, credit balance, and plan.

## How it works

The MCP package uses the same Kleap account and REST API as the project’s CLI. It supports a hosted connector at `https://kleap.co/api/mcp`, where the user authorizes access in a browser, and a local stdio process started with `kleap mcp` or the package’s default command.

Site creation and edits may run as asynchronous tasks. `create_app` returns a task, while `check_task` can wait for up to 50 seconds when polling and can resume a failed task with a new task ID. `publish_app` handles deployment and returns the post-deploy report after verifying the live result.

## Setup and configuration

For the hosted option, add the MCP endpoint to a compatible client and complete Kleap’s browser authorization flow. For local stdio use, authenticate with the CLI’s browser login or provide a `KLEAP_API_KEY`; the same saved account configuration is shared between the CLI and MCP process. The package communicates with Kleap’s service rather than storing service secrets in the package.

A client must support MCP and be configured for either the hosted endpoint or the local command. The README specifically documents Claude Desktop, Cursor, Claude Code, and Codex-oriented shell workflows.

## Tools and capabilities

The listed MCP capabilities cover:

- Resolving an app from a domain, URL, or slug with `find_app`.
- Creating sites, requesting AI edits, checking task status, and retrying failed work.
- Generating images into `public/` without transferring image bytes through the agent.
- Publishing an app and reading verified-live deployment results.
- Searching for domains and creating a checkout link that the user pays for.
- Connecting a user-owned domain and checking its DNS status.
- Reading form submissions, optionally limited to records after a supplied time.
- Retrieving traffic, Google Search figures, and a Search Console consent link.
- Renaming apps without changing their URLs, capturing screenshots, waking preview sandboxes, and listing apps.

## Limitations and notes

The Kleap MCP server does not purchase a domain on the user’s behalf. Domain search and purchase-related operations create a checkout link, and the user must complete payment. Connecting a domain also depends on the user owning it and configuring the required DNS record.

The available app, form, analytics, domain, and database information depends on the authenticated Kleap account and its permissions. Long-running creation or edit operations require task polling unless the client waits for completion. Use the task identifier returned by creation or editing operations to continue work after a non-blocking request.

_Full upstream README: https://allmcps.com/mcp/kleap/readme_

