Install Bitrise MCP Server in OpenAI Codex
PrerequisitesClick to copy link
- The latest version of OpenAI Codex installed (the CLI or the IDE extension; see the official Codex documentation)
- A Bitrise account
- For local setup: Go (>=1.25) installed and a Bitrise PAT
Bitrise MCP Server ConfigurationClick to copy link
Codex stores MCP servers in a config.toml file, under one [mcp_servers.<name>] table per server. The Codex CLI, the IDE extension, and the Codex desktop app share the same configuration.
- Global configuration:
~/.codex/config.tomlwhere~is your home directory - Project-specific:
.codex/config.tomlin your project directory (Codex loads it for trusted projects only)
You can edit the file by hand or use the codex mcp commands. Start a new Codex session for manual changes to take effect.
Remote Server Setup (Streamable HTTP) — RecommendedClick to copy link
The remote server uses OAuth to authenticate you against your Bitrise account. No token to copy or paste.
- Add the server:
Or add it tocodex mcp add bitrise --url https://mcp.bitrise.io
~/.codex/config.tomlyourself:[mcp_servers.bitrise]url = "https://mcp.bitrise.io" - Sign in:
Codex opens your browser. Log in to Bitrise (or confirm your existing session) and approve the consent screen. On a machine without a browser, runcodex mcp login bitrise
codex mcp login bitrise --no-browserand open the URL it prints. - Verify that Codex works: Verification.
Fallback: PAT-based authenticationClick to copy link
If OAuth sign-in doesn't work in your setup, use a Personal Access Token.
- Create a Bitrise API Token under Account Settings → Security.
- Export the token as an environment variable. To keep it available in every new terminal, add the line to your shell profile, such as
~/.zshrc:export BITRISE_TOKEN=your_token_here - Reference the variable in
~/.codex/config.toml. Codex sends its value as a bearer token, so the token itself never goes into the file:[mcp_servers.bitrise]url = "https://mcp.bitrise.io"bearer_token_env_var = "BITRISE_TOKEN" - Restart the Codex app server from a shell where
BITRISE_TOKENis set, so that it picks up the variable:codex app-server daemon restart - Verify that Codex works: Verification. Start
codexfrom the same shell.
The Codex CLI connects to a background app server, which keeps the environment it was started with. If you export BITRISE_TOKEN after the app server started, Codex doesn't see it until you restart the app server, and opening a new terminal doesn't change that (see the app server daemon README). See also Server shows as failed.
Local Server Setup (Go required)Click to copy link
The local server runs in stdio mode and authenticates with a Personal Access Token (no browser OAuth flow in stdio mode).
-
Add Bitrise to Codex. You have two options:
- Store the token in
config.toml. Run:
codex mcp add bitrise --env BITRISE_TOKEN=YOUR_BITRISE_PAT -- go run github.com/bitrise-io/bitrise-mcp/v2@v2Codex writes the token into
~/.codex/config.tomlas plain text, under[mcp_servers.bitrise.env], and passes it to the server when it starts. You don't need to export anything in your shell. Anyone who can read the file can read your token, so keep the file private and don't share or commit it.- Keep the token out of
config.toml. Add the server to~/.codex/config.tomlwithout the token:
[mcp_servers.bitrise]command = "go"args = ["run", "github.com/bitrise-io/bitrise-mcp/v2@v2"]env_vars = ["BITRISE_TOKEN"]Codex forwards
BITRISE_TOKENfrom the environment of the Codex app server, so the token stays in your shell environment. Export the token:export BITRISE_TOKEN=your_token_hereRestart the app server from the same shell so that it picks up the variable:
codex app-server daemon restartnoteThe Codex CLI connects to a background app server, which keeps the environment it was started with. If you export
BITRISE_TOKENafter the app server started, Codex doesn't see it until you restart the app server, and opening a new terminal doesn't change that (see the app server daemon README). See also Server shows as failed. - Store the token in
-
Verify that Codex works: Verification. With option B, start
codexfrom the same shell.
VerificationClick to copy link
- Check the configured servers:
codex mcp list
- Check the connection in Codex: start Codex with
codex, then type/mcpin the composer to see the connected servers and their tools. - Test with a prompt:
List my Bitrise projects
Advanced configurationClick to copy link
See Tools for enabling/disabling specific toolsets. To change the toolsets, add the toolset query parameter to the server URL (for the local server, set the ENABLED_TOOLSET environment variable instead):
[mcp_servers.bitrise]
url = "https://mcp.bitrise.io/?toolset=apps,builds,workspaces"
If a task needs a tool from a toolset you haven't enabled, the agent can call list_toolset to find out which toolset to add.
Codex also supports per-server settings such as startup_timeout_sec (default 10 seconds), tool_timeout_sec (default 60 seconds), and the enabled_tools and disabled_tools lists. See the Codex MCP documentation for the full list.
TroubleshootingClick to copy link
Authentication IssuesClick to copy link
- OAuth flow doesn't open a browser: Run
codex mcp login bitrise --no-browserand open the URL manually, or fall back to PAT-based authentication - Token expired (PAT): Generate a new Bitrise token, update the environment variable, and restart the app server with
codex app-server daemon restart - Authentication failed: Run
codex mcp login bitriseagain, or remove the server withcodex mcp remove bitriseand repeat the setup - Check that a PAT is valid: The Bitrise API takes the token without a
Bearerprefix. A200response means the token is valid:curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: $BITRISE_TOKEN" https://api.bitrise.io/v0.1/me
Configuration IssuesClick to copy link
Server shows as failedClick to copy link
If /mcp in Codex shows bitrise: failed (0 tools) and you use a PAT or the local server, the Codex app server probably doesn't have your environment variable. The app server runs in the background and keeps the environment it was started with, so a variable you export later is invisible to it. Run codex doctor to confirm: it reports bearer token env var BITRISE_TOKEN is not set.
- Check that the variable is exported in your current shell:
The output isenv | grep -c '^BITRISE_TOKEN='
1when it's exported. - Restart the app server from that shell, then start
codexagain from the same shell:codex app-server daemon restart
If the server still fails, stop the app server with codex app-server daemon stop and start codex again.
Other configuration issuesClick to copy link
- Invalid TOML: Check the syntax of
~/.codex/config.toml. Each server needs its own[mcp_servers.<name>]table - Project-level config ignored: Codex loads
.codex/config.tomlonly for trusted projects - Server doesn't start in time: Raise
startup_timeout_secfor the server. Thego runcommand can take longer than the 10-second default on its first run - Tools not appearing: Run
/mcpin Codex to check the server status, then restart Codex