> ## Documentation Index
> Fetch the complete documentation index at: https://tbd-6fc993ce-archand-kernel-1772-captcha-challenge-id-scope.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# fx

> Connect fx to the Kernel MCP server

<Warning>
  OAuth currently fails for fx, interactively or otherwise, with:

  ```text theme={null}
  MCP authentication for 'kernel' was rejected: expected issuer "https://mcp.onkernel.com" but
  the authorization response returned issuer "https://clerk.onkernel.com". fx stopped before token
  exchange.
  ```

  Until it's resolved, [connect with an API key](#connect-with-an-api-key-workaround) instead of OAuth.
</Warning>

## Install with the Kernel CLI

Run the following command:

```bash theme={null}
kernel mcp install --target fx
```

## Configure manually

Alternatively, add Kernel to the `mcp` map in `~/.fx/mcp.json`:

```json theme={null}
{
  "mcp": {
    "kernel": {
      "type": "http",
      "url": "https://mcp.onkernel.com/mcp",
      "oauth": {}
    }
  }
}
```

## Connect

Start fx, or reload the configuration in an existing session:

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

Then authenticate with Kernel:

```text theme={null}
/mcp auth kernel --open
```

Authorize access in the browser window that opens. You can then run `/mcp list` to verify that Kernel is connected.

<Note>This is also the path that would otherwise be needed for headless or scripted use — `/mcp auth` needs a browser, so `fx ask`, `fx acp`, and CI can't complete it even once the OAuth issuer bug above is fixed. Use the API-key workaround below for those regardless.</Note>

## Connect with an API key (workaround)

Get a project-scoped Kernel API key from the [Kernel Dashboard](https://dashboard.onkernel.com/api-keys), export it, and reference it from `~/.fx/mcp.json` with `bearer_token_env` instead of `oauth`:

```json theme={null}
{
  "mcp": {
    "kernel": {
      "type": "http",
      "url": "https://mcp.onkernel.com/mcp",
      "bearer_token_env": "KERNEL_API_KEY"
    }
  }
}
```

```bash theme={null}
export KERNEL_API_KEY='<project-scoped-key>'
fx
```

This works for both interactive and headless/scripted sessions (`fx ask`, `fx acp`, CI). `kernel mcp install --target fx` always writes the OAuth config, so switch to `bearer_token_env` by hand.

<Note>fx rejects a literal `Authorization` header in a static `headers` field (the format other MCP clients use for API-key auth) to keep credentials out of the profile file. `bearer_token_env` is the fx-specific equivalent — it points at an environment variable instead of embedding the token.</Note>
