Codex

Connect Moonlit to Codex from the command line, from its configuration file, or from the IDE extension.

  • Sign in: Moonlit account
  • Where: codex mcp add, ~/.codex/config.toml, or the extension's MCP servers menu
  • Help: Codex MCP documentation

Before you start

  • A Moonlit account. Sign in at app.moonlit.ai with your email and the one-time code it sends you, or with Google or Microsoft. Organizations can use single sign-on. Signing in creates the account if you do not have one.

The server URL:

https://mcp.moonlit.ai/mcp

Add the server

Codex CLI:

codex mcp add moonlit --url https://mcp.moonlit.ai/mcp

Or add the server to ~/.codex/config.toml, which the CLI and the IDE extension share:

[mcp_servers.moonlit]
url = "https://mcp.moonlit.ai/mcp"

Codex IDE extension:

  1. Open the gear menu and select MCP servers, then Add server.
  2. Choose Streamable HTTP, name it moonlit, and paste the server URL.
  3. Restart the extension.

Sign in

codex mcp login moonlit

Codex opens the Moonlit sign-in page. Sign in and click Allow.

Check it works

Run codex mcp list; Moonlit is listed. Then start a session and ask:

Prompt

Find the official text of Article 6 of the EU AI Act.

A good answer cites CELEX 32024R1689, links to the official publication, and quotes the article.

Use an MCP key instead

For a configuration shared with your team, or a machine that cannot open a browser, an organization MCP key replaces the sign-in. Keys come from Organizations; keep them in an environment variable, never in the file itself.

Codex reads the key from an environment variable and sends it as a Bearer token:

[mcp_servers.moonlit]
url = "https://mcp.moonlit.ai/mcp"
bearer_token_env_var = "MOONLIT_MCP_KEY"

If something fails

  • Check that the URL ends in /mcp.
  • Remove the server entry, add it again, and sign in once more.
  • Ask for your Moonlit account status. The check is free and shows your remaining calls.

For the app's own steps, see the Codex MCP documentation. Still stuck? Email support@moonlit.ai with what you see.

esc
↑↓ navigateenter openesc close