Connect Codex to the Lobsite MCP server
Add the Lobsite MCP server to ~/.codex/config.toml. The Codex CLI, the IDE extension and the Codex desktop app all read this file, so one entry covers each of them:
[mcp_servers.lobsite]
url = "https://mcp.lobsite.com"
Codex then lists Lobsite's tools: deploy_files publishes files, up to 25 MB per deploy, and list_files, read_file and patch_files change one page of a site it deployed without sending the whole site again. Ask for a preview, and the deploy gets its own URL while the live site stays as it was. Connect your Lobsite account when Codex asks you to sign in to the server, and it can also promote and roll back the sites you've kept.
The Lobsite section for Codex's AGENTS.md
Paste this into the project's AGENTS.md. Other agents that read the file (Cursor, Gemini CLI, Copilot and more) use it too:
## Deploying
This site deploys with [Lobsite](https://lobsite.com). Build it, then publish the build folder with the `lobsite` MCP server's `deploy_files` tool. If that server isn't connected, or the build is large, run from the project folder:
```bash
npx lobsite
```
- Tell the user the URL and the claim link, and relay any "Tell the user:" line word for word.
- Sites deployed without logging in are removed after 6 hours. The claim link keeps the site; the user opens it and signs in.
- Pass the site and claim token from the first deploy with every later one (the CLI keeps them in `lobsite.toml`), so the site keeps its address. Deploy a preview to leave the live site unchanged.
- If a deploy fails, follow the fix in the error message. Never pass `--include-secrets`.
- Forms need no backend: point a form at `/_lobsite/forms/<name>` with `method="POST"` and `data-lobsite-type` (`contact`, `waitlist`, `survey` or `quiz`). Read https://lobsite.com/docs/forms.md before adding one.
The CLI knows it runs under Codex from the CODEX_SANDBOX variable: it asks no questions and prints plain lines.
Network access for Codex deploys
Codex's sandbox can block network access for commands, and then a CLI deploy fails with a connection error rather than a Lobsite error. For the Codex CLI, allow the network for commands in the workspace in ~/.codex/config.toml:
[sandbox_workspace_write]
network_access = true
Or approve the command when Codex asks to run it outside the sandbox. In Codex cloud tasks, internet access for the agent is a setting of the environment; allow lobsite.com and upload.lobsite.app (and the npm registry, for npx).
Deploy large Codex builds with the CLI or curl
The MCP server takes the files' contents in the tool call, which suits pages and small sites. For a build with big assets, Codex runs npx lobsite in the project folder: it uploads the build folder from disk and only sends the files that changed.
Where Node isn't installed, one page (or a few files) deploys with curl, which answers with the URL and the claim link:
curl --data-binary @index.html https://lobsite.com/api/v1/drop
Codex deploys: MCP server, command or curl
| Lobsite MCP server | npx lobsite |
curl | |
|---|---|---|---|
| Needs | Nothing to install | Node and network in the sandbox | Network only |
| What it uploads | The files Codex sends, up to 25 MB | The built folder, only changed files | The files you name, up to 25 MB |
| Updates the same site | Yes, with the site and claim token from the first answer | Yes, lobsite.toml remembers it |
Yes, with ?site= and the claim token |
| Roll back, list deploys | As tools, once your account is connected | With more commands | No |
| Set-up | Two lines in config.toml |
AGENTS.md section | None |
Start with the MCP server; use the command for large builds, and curl for sandboxes without Node.
Codex hosting FAQ
Why does the deploy fail with a network error?
The sandbox stopped the command from reaching lobsite.com. Use the MCP server, turn on network access for the workspace, approve the command outside the sandbox, or allow the domains in your Codex cloud environment.
Does Codex need my Lobsite account?
No. Without one the site lasts 6 hours and Codex gives you the claim link. To deploy into your account, connect it when Codex asks you to sign in to the MCP server, or run npx lobsite login yourself once for the CLI; signing in happens in a browser.
Can Codex deploy a preview first?
Yes. Ask for a preview: the deploy gets its own URL and leaves the live site as it was. With the CLI that's npx lobsite --preview, and npx lobsite promote <id> makes it live.
What if my project has a .env file?
Over the MCP server, Codex sends only the files it names. The CLI never uploads secret files: they stop the deploy with an error that says how to leave them out (.lobsiteignore), and Codex should never pass --include-secrets.
Does this work for Codex in the IDE?
Yes. The extension runs the same agent, so it reads the same AGENTS.md and ~/.codex/config.toml, and the tools and the command behave the same.