# Grok

> Connect xAI's Grok CLI or Grok on grok.com to Korala with a browser sign-in.

Source: https://docs.korala.ai/ai-agents/grok

---

  The steps below follow xAI's current documentation and Grok CLI 1.0.40 (checked 2026-09-22); menu names can change.

## Grok CLI

1. Add the server for your user:

   ```bash
   grok mcp add -s user korala https://api.korala.ai/mcp
   ```

2. Start `grok` in a terminal. Grok opens a browser the first time it uses Korala. To sign in straight away, run `/mcps`, select **korala** and press `i`.
3. Approve the connection on Korala's consent page. See [Permissions and safety](https://docs.korala.ai/ai-agents/permissions).

The sign-in needs an interactive session. Run it once; Grok stores the token in `~/.grok/mcp_credentials.json` and refreshes it.

The first command writes this block to `~/.grok/config.toml`. You can add it by hand:

```toml
[mcp_servers.korala]
url = "https://api.korala.ai/mcp"
enabled = true
```

Use `-s project` to write `.grok/config.toml` in the current project instead. `grok mcp doctor korala` checks the connection.

### The Korala plugin

Grok CLI installs Claude Code plugins. The Korala plugin adds the same server and a skill that tells Grok how to draft, prepare, send and track documents:

```bash
grok plugin marketplace add korala-ai/claude-plugins
grok plugin install korala --trust
```

Grok keeps a plugin's MCP server off until you trust the plugin, so keep `--trust`. Then sign in with `/mcps` as above. If you already ran `grok mcp add korala`, that entry wins over the plugin's server of the same name.

### API key alternative

For machines where nobody can open a browser:

```bash
grok mcp add korala-local \
  -e KORALA_API_KEY_ID=your-key-id \
  -e 'KORALA_API_SECRET=${KORALA_API_SECRET}' \
  -- npx -y @korala/mcp
```

Grok expands `${KORALA_API_SECRET}` from your environment when it starts the server, so the secret stays out of the config file. See [API key (CI and headless)](https://docs.korala.ai/ai-agents/api-key).

## Grok on grok.com

Grok on the web can use custom connectors. xAI documents them for Grok Business and Enterprise; in a team, an admin may need to add the connector.

1. Go to [grok.com/connectors](https://grok.com/connectors).
2. Choose **New Connector**, then **Custom**.
3. Enter `https://api.korala.ai/mcp` and complete the sign-in. Approve the connection on Korala's consent page.

xAI's documentation does not say which sign-in methods connectors support, and we have not tried this form. If Grok cannot complete the Korala sign-in, use the Grok CLI.
