> For the complete documentation index, see [llms.txt](https://docs.cloud.olakrutrim.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloud.olakrutrim.com/mcp/connect-codex.md).

# Connect Codex

Connect Krutrim Cloud MCP to Codex with the shared local Codex configuration. The ChatGPT desktop app, Codex CLI, and Codex IDE extension can use the same MCP server definition.

## Before you begin

* First, complete the shared installation and API-key setup in the [MCP Overview](/mcp/overview.md). These guides use local stdio, not a hosted OAuth connection.
* Make sure `uvx` is available on the local machine.
* Use the raw API key as `KRUTRIM_API_KEY`, without a `Bearer` prefix or surrounding spaces. Keep it private and restart the client after changing the key.

## Connect to Krutrim Cloud

{% stepper %}
{% step %}

### Open the Codex configuration file

Open `~/.codex/config.toml`. Create the `.codex` directory and configuration file if they do not already exist.

> Scope: The configuration below runs Krutrim Cloud MCP locally through stdio. Do not add actual API keys to a project configuration or commit them to source control.
> {% endstep %}

{% step %}

### Add the Krutrim Cloud MCP server

Add this entry to `~/.codex/config.toml`. If you already have MCP servers, preserve the existing entries and add this one alongside them.

```toml
[mcp_servers.krutrim-cloud]
enabled = true
command = "uvx"
args = ["krutrim-mcp-server"]

[mcp_servers.krutrim-cloud.env]
KRUTRIM_API_KEY = "YOUR_KRUTRIM_API_KEY"
```

{% endstep %}

{% step %}

### Check that Codex sees the server

In a terminal, run:

```bash
codex mcp list
```

In the Codex CLI interactive interface, use `/mcp` to inspect server status. Start a new Codex session after changing the file. In the ChatGPT desktop app or IDE extension, save the configuration and restart the relevant surface.
{% endstep %}

{% step %}

### Verify with a read-only request

Then make a read-only request:

```
List my VPCs in In-Bangalore-1.
```

Review the tool call and allow only the read-only request.
{% endstep %}
{% endstepper %}

## Next steps

Before changing Cloud resources, follow the safety guidance in the [MCP Overview](/mcp/overview.md). Start with a read-only request and review the exact region and resource identifiers.

Need help? Open [Troubleshooting](/mcp/troubleshooting.md) for startup, API-key, and tool-discovery checks.

For current Codex MCP product behavior and UI paths, see the [OpenAI MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cloud.olakrutrim.com/mcp/connect-codex.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
