Docs›AI & automation
Connect Codex to Mangobeds with MCP
3 min read
Codex, OpenAI’s coding agent, can read your live Mangobeds data and answer questions about it without you leaving your work. A Codex MCP connection uses your API key, because Codex runs on your own computer and can send a header with each request. For the background on MCP, or if you use a different tool, start with Connect Mangobeds to AI tools with MCP.
This is a different product from ChatGPT, and it connects differently. If you want the assistant in your browser instead, see Connect ChatGPT to Mangobeds with MCP.
Before you start
In Mangobeds, go to Apps > MCP and pick Codex. The block shown there already has your API key in it, so copying from that page saves you filling anything in. Everything below uses a placeholder instead.
Add the server
Codex reads its settings from a TOML file. Add Mangobeds for everything you do, or for one project:
- Everywhere: ~/.codex/config.toml in your home folder.
- For one project: .codex/config.toml in that project’s folder.
Add this, replacing the placeholder with your own key, then restart Codex:
[mcp_servers.mangobeds]
url = "https://api.mangobeds.com/mcp"
http_headers = { "X-API-Key" = "YOUR_API_KEY" }
Then ask “what properties do I have in Mangobeds?” to check it works. It should answer without you giving it any IDs.
Two things that catch people out
- It is TOML, not JSON. Codex is the odd one out here: Cursor, VS Code and Claude Desktop all use JSON files, so a config copied from one of those guides will not load. The block above is the Codex form.
- A project file holds your key. .codex/config.toml sits inside your project folder, so add it to .gitignore if that folder is a repository, or your API key ends up committed. Use the home folder version if you would rather not think about it.
Keeping your key out of the file
If you would rather not write the key into the file at all, Codex can read it from an environment variable instead. Set MANGOBEDS_API_KEY in your shell and use:
[mcp_servers.mangobeds]
url = "https://api.mangobeds.com/mcp"
env_http_headers = { "X-API-Key" = "MANGOBEDS_API_KEY" }
Note the value is the name of the variable, not the key itself. Codex looks it up when it starts.
What you can ask
Codex can list your properties itself, then answer from your live data: bookings and who is checking in, availability, why a room is blocked on a date, what a room costs on a given day, your seasonal rates, and your guests. It can also read these help guides, so “how do I set up seasonal rates?” is answered next to what your own rates actually say. With permission it can correct a guest’s details, add a guest to a booking, and send one of your saved messages.
An API key carries every permission, so a connection made this way can do all of it, including sending a real email or WhatsApp to a guest. If you would rather grant read-only access, Claude in the browser asks you to tick what it may do. Either way, anything it changes is written into the booking’s activity.
If it does not connect
- Check the TOML is valid, and that the block starts with [mcp_servers.mangobeds] exactly. A typo in the table name leaves Codex with no server rather than a broken one, so it fails quietly.
- Restart Codex. It reads config.toml at startup, so changes need a restart.
- Check the key. Copy it again from Apps > MCP. If the key was deleted and regenerated, the old one stops working immediately.
- Start a new session. Codex picks up the available tools when a session starts, so one opened before you connected, or before an update on our side, may still be working from an older set.