Build a website with Codex
Codex already reads your repository. Connect Kleap and it can also turn what it knows into a live website: a landing page for your project, a docs site, a client page, built, hosted and published without leaving the terminal.
Codex CLI, the Codex app and the IDE extension share the same config.
What you can ask Codex to do
Kleap is an AI website builder. Your agent gives the instructions, Kleap builds, hosts and publishes.
Build a site from a sentence
Your agent asks Kleap for a site. Kleap's AI builds it, with hosting, SSL and forms included, and returns a task the agent follows until it is done.
Edit what already exists
Find a site by name, address or domain, read its files, change exactly what must change, and keep the rest untouched. Or describe the outcome and let Kleap's AI write it.
Publish with proof it is live
A publish is reported as done only once the new version is actually serving at its URL. Your agent never hands you a dead link.
Improve SEO, once or on a schedule
Read Google Search Console numbers, find the pages that deserve work, rewrite titles and copy, publish, and report. The same prompt can run every day.
Read leads and traffic
Form submissions, visitors, pageviews and top pages come back as plain data your agent can summarise, answer or act on.
Domains, without surprise bills
The agent can search and connect domains. Buying one always goes through a payment link that you pay yourself, so nothing is bought on its own.
Connect Kleap to Codex
The Codex CLI, the Codex app and the IDE extension read the same ~/.codex/config.toml, so you set this up once.
Add the server
Register Kleap as a streamable HTTP server. This writes an entry to ~/.codex/config.toml, which you can also edit by hand.
Terminalcodex mcp add kleap --url https://kleap.co/api/mcp~/.codex/config.toml[mcp_servers.kleap] url = "https://kleap.co/api/mcp"Sign in with OAuth
Codex registers a client automatically and opens the browser so you can sign in to Kleap. In the Codex app or the IDE extension, select Authenticate instead. Check the result with codex mcp list, or type /mcp in the terminal interface.
Terminalcodex mcp login kleapOptional: install the Kleap skills
The skills CLI detects Codex and writes the five Kleap skills where it expects them.
Terminalnpx skills add kleaphq/skillsNon-interactive runs: use an API key
For automation with nobody at the browser, create a key at https://kleap.co/settings/api-key with the narrowest preset, export it, and tell Codex to send it as a bearer token.
Terminalexport KLEAP_API_KEY=kleap_live_sk_... codex mcp add kleap --url https://kleap.co/api/mcp --bearer-token-env-var KLEAP_API_KEY
Prompts to try in Codex
Copy one, change the details to yours, and send it. Each one names what you want and what done looks like.
Read README.md in this repository, then use Kleap to build a landing page for the project with a feature list, an install snippet and a waitlist form. Publish it and add the live URL to the README.
Turn the Markdown files in docs/ into a Kleap site with a sidebar-style navigation, a search-friendly title on every page, and a consistent footer. Publish it.
Read the files of my Kleap site, find the pages missing a meta description or with a duplicate H1, fix them, publish and show me the audit from get_publish_status.
Show me the form leads and the top pages of my Kleap site for the last 7 days, then list two changes that would help the most.
Run it on a schedule
Codex can create scheduled tasks from a chat, managed in the Scheduled view of the ChatGPT desktop app or ChatGPT on the web. They run unattended with your sandbox settings, and per OpenAI, tool calls that need app access fail in read-only mode. OpenAI suggests testing the prompt in the CLI first, which is what we would do with the prompt below.
Every morning, go through my Kleap sites one by one. For each site: 1. Read the last 28 days with get_search_console and get_analytics. 2. Pick the one page with the most impressions that still sits between position 5 and 20, or whose title does not match the query it ranks for. 3. Read that page with read_files and improve its title, meta description, H1, intro, internal links and FAQ so they answer that query better, in the site's own voice. 4. Push the change with write_files, then publish_app and confirm with get_publish_status. 5. Send me a summary: site, page, query, what changed. Never invent statistics or testimonials, never change a site's design, and touch at most two pages per site per run.
Google Search Console must be connected to the site for the search data. If it is not, Kleap hands the agent a consent link for you to open.
Good to know
- OpenAI's docs do not say whether scheduled tasks can use MCP servers from config.toml, so test a scheduled run by hand before you rely on it.
- Project-scoped config (.codex/config.toml) only applies to trusted projects.
- Domain purchases always go through a payment link that you pay yourself.
Official documentation: Model Context Protocol in Codex (OpenAI), codex mcp commands (OpenAI).
Codex and Kleap: questions
Can Codex build and publish a website?
Yes, with Kleap connected. Codex asks Kleap to build the site, or writes the files itself with write_files, then publishes it. Kleap hosts it on a kleap.io address or your own domain and confirms it is live.
Do I need an API key for Codex?
Not for interactive use: codex mcp login signs you in with OAuth. A key is for non-interactive runs, through the --bearer-token-env-var option.
Should Codex write the files or let Kleap's AI do it?
For exact wording, URLs or markup, let Codex write the files with write_files; that step does not run Kleap's AI. For a whole new section described in words, modify_app lets Kleap's AI write it.
Does it work from the Codex app and the IDE extension?
Yes. They share the CLI's config.toml, so the server you added is there too. Use Authenticate in the app or extension where the CLI uses codex mcp login.
Does it cost anything to connect Kleap?
Connecting is free. Building and AI edits draw on your Kleap usage, and the free plan includes some. If your agent writes the files itself with write_files, Kleap does not run its own AI for that step. Publishing on a Kleap address is free. See the pricing page for each plan.
Using another agent?
Same Kleap account, same sites. See all the agent guides or the MCP, CLI and skills reference.
Put Codex to work on your website
Connect once, then ask in plain words. Kleap builds, hosts and publishes, and your agent keeps the site improving.
Free to start. See pricing