> ## Documentation Index
> Fetch the complete documentation index at: https://docs.impulselabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Impulse with Codex

> Connect Codex to the Impulse MCP server and train, inspect, deploy, and run models from Codex

Codex can use Impulse through the Model Context Protocol (MCP). Once connected, Codex can upload datasets, start training sessions, inspect artifacts, deploy models, and run predictions through the Impulse tools.

This guide is for Codex only. For direct REST API calls, see the [Quickstart](/quickstart).

## Requirements

* A Codex app or Codex CLI install.
* An Impulse account with access to the production dashboard.
* A browser session that can sign in to Impulse during MCP OAuth.

<Note>
  You do not need to copy an Impulse API key into Codex when using the OAuth MCP setup below. Codex stores the MCP server config locally and completes auth through your browser.
</Note>

## Connect Codex from settings

The Codex app, CLI, and IDE extension share MCP settings. If you connect Impulse in one Codex surface, the others can use the same server because the configuration is stored in `config.toml`.

<Steps>
  <Step title="Open Codex settings">
    In the Codex app, open **Settings** from the app menu or press **Cmd+,** on macOS.
  </Step>

  <Step title="Open Integrations & MCP">
    Go to **Integrations & MCP**. This is where Codex manages external MCP servers.
  </Step>

  <Step title="Add a custom MCP server">
    Choose the option to add your own MCP server.
  </Step>

  <Step title="Enter the server details">
    Use `impulse` as the server name and `https://api.impulselabs.ai/api/mcp-http` as the server URL.
  </Step>

  <Step title="Authenticate">
    If Codex prompts for OAuth, continue in the browser, sign in to Impulse, approve access, and return to Codex.
  </Step>

  <Step title="Start a new thread">
    Open a new Codex thread and ask Codex to use Impulse.
  </Step>
</Steps>

## Connect Codex from the CLI

If you prefer terminal setup, add the same production Impulse MCP server with the Codex CLI:

```bash theme={null}
codex mcp add impulse --url https://api.impulselabs.ai/api/mcp-http
```

Start the OAuth login:

```bash theme={null}
codex mcp login impulse
```

Your browser will open. Sign in to Impulse, approve access, and return to Codex when the flow completes.

Verify the server is configured:

```bash theme={null}
codex mcp list
```

In an interactive Codex session, you can also run:

```text theme={null}
/mcp
```

You should see an `impulse` MCP server with available Impulse tools.

## Optional local config

Codex stores MCP servers in `~/.codex/config.toml`. The CLI command above writes a config similar to:

```toml theme={null}
[mcp_servers.impulse]
url = "https://api.impulselabs.ai/api/mcp-http"
```

For a repo-specific setup, put the same block in `.codex/config.toml` inside a trusted project.

## First Codex prompt

After auth, start a new Codex thread and ask it to use Impulse:

```text theme={null}
Use the Impulse MCP server to train a model from my uploaded dataset. Show me the session id, required artifacts, metrics, and prediction file when the run is complete.
```

If you already have dataset IDs:

```text theme={null}
Use Impulse MCP. Train a tabular classification model with dataset_id=<TRAIN_DATASET_ID> and test_dataset_id=<TEST_DATASET_ID>. The target column is Transported. Produce submission.csv and save the canonical model artifacts.
```

## What Codex can do

Once connected, Codex can use Impulse MCP tools to:

* Upload datasets.
* List datasets and projects.
* Start training sessions.
* Poll session status.
* Inspect generated artifacts.
* Package models for inference.
* Deploy trained models.
* Fetch deployment feature contracts.
* Run predictions against deployed models.

## Troubleshooting

### Codex says the server is not authenticated

Run the login command again:

```bash theme={null}
codex mcp login impulse
```

Then start a new Codex thread. New MCP auth and tool availability are easiest to verify in a fresh thread.

### The OAuth callback fails

Make sure the production Impulse Auth0 application allows the callback URL used by Codex. Codex may use a localhost callback URL by default unless you configure a custom callback URL.

### Codex does not show Impulse tools

Check the server list:

```bash theme={null}
codex mcp list
```

If the server is missing, add it again:

```bash theme={null}
codex mcp add impulse --url https://api.impulselabs.ai/api/mcp-http
codex mcp login impulse
```

Then restart Codex or open a new thread.
