Build and host a Discord bot with Codex

One command adds Bot-Hosting to OpenAI Codex. It deploys your Discord bot from the terminal, reads the real logs and fixes crashes.

How to connect Codex to Bot-Hosting

One command
Terminal
codex mcp add bot-hosting --url https://bot-hosting.net/api/mcp
  1. Run the command in your terminal. Codex detects the sign-in and opens your browser.
  2. Sign in to Bot-Hosting. If no browser opened, run codex mcp login bot-hosting.
  3. Start Codex in your project and ask away.

Steps checked in Codex on November 5, 2026.

Common Codex issues and fixes

What people run into most when they add Bot-Hosting, and how to get past it.

Codex says the bot-hosting MCP server is not logged in

Run codex mcp login bot-hosting, finish the sign-in in your browser, then start a new Codex session. Use the same command when Codex says the server requires OAuth reauthentication. Until you sign in, codex mcp list shows Not logged in in the Auth column.

Codex MCP sign-in never finishes over SSH

The automatic sign-in waits for a callback on 127.0.0.1 of the machine running Codex, which your local browser cannot reach. Run codex mcp login bot-hosting --no-browser, open the printed URL on your computer, sign in, then paste the full redirect URL back into the terminal.

MCP client for bot-hosting timed out at startup

Add startup_timeout_sec = 60 under [mcp_servers.bot-hosting] in ~/.codex/config.toml. If one tool call times out instead, raise tool_timeout_sec (default 60). If it still fails, check that the server URL is reachable through your network, VPN or proxy.

What your AI can do

Everything you do in the dashboard, asked in plain words.

Build and host your bot

It creates the deployment, writes the code, installs the packages and starts it.

Find and fix crashes

It reads the logs, explains why the bot stopped and fixes the file or the setting.

Manage the rest

Files, environment variables, packages, domains and resources, on request.

Stay in control

Secret variables stay masked, backups can be restored, and you can disconnect the AI at any time.

Try asking

Copy a request, paste it to your AI and watch it work.

Deploy this folder to a new Bot-Hosting deployment and start it.

My bot on Bot-Hosting crashed. Read the logs, fix the code here and deploy again.

Check that DISCORD_TOKEN is set as a secret variable on Bot-Hosting, then restart the bot.

Questions, answered.

Where does Codex save the Bot-Hosting server settings?

codex mcp add writes a [mcp_servers.bot-hosting] table with a url key to ~/.codex/config.toml. To share it with a team, put the same table in the project's .codex/config.toml, which loads only in trusted projects. Each teammate then runs codex mcp login bot-hosting.

Does Bot-Hosting also work in the Codex IDE extension?

Yes. The Codex CLI, the IDE extension and the ChatGPT desktop app share the same MCP configuration, so you set it up once. If the MCP servers list shows that Bot-Hosting needs sign-in, select Authenticate.

How do I sign out or remove Bot-Hosting from Codex?

Run codex mcp logout bot-hosting to delete the stored OAuth credentials, then codex mcp remove bot-hosting to delete the entry, since remove alone keeps them. To cut access on the Bot-Hosting side, revoke the app in your dashboard under Developer, then My apps.

Is it free?

Yes. The MCP server comes with every Bot-Hosting account, free plan included. What your AI can create stays within your plan, like in the dashboard.

Other AI tools

Same account, same tools. Connect as many as you like.

Connect Claude Paste a URL Connect ChatGPT Paste a URL Connect Mistral Vibe Paste a URL Connect Grok Paste a URL Connect Cursor One click Connect VS Code One click Connect Devin Desktop One command Connect Claude Code One command

Your AI is ready.
Your bot is next.