# Connect an AI assistant
Add Klarefi's MCP server to your assistant or editor
Source: https://www.klarefi.com/docs/api/connect-assistants

Klarefi's Streamable HTTP MCP endpoint is `https://www.klarefi.com/mcp`.

For customer tools, create a test API key under **Settings → Developers → API keys**. Choose the scopes for the tools you need. For example, `list_workflows` needs `workflows:read`. Store the key in the client's credential settings or its launch environment. Use a key with the same environment as the cases you want to see.

For applicant tools, use a signed intake link. With manual client setup, omit the `Authorization` header or the Codex `--bearer-token-env-var` flag. See [Agent intake](/docs/guides/agent-intake#mcp-server) for the tool list and the credentials each call needs.

In the examples below, `KLAREFI_API_KEY` is an environment variable containing your key.

## Codex

Add the remote server in a terminal that has `KLAREFI_API_KEY` set:

```sh
codex mcp add klarefi --url https://www.klarefi.com/mcp --bearer-token-env-var KLAREFI_API_KEY
```

Start a fresh session and run `/mcp` to list the tools. The Codex IDE extension shares the CLI's configuration. Restart it with the same variable in its launch environment. If Codex reports a missing environment variable, set the key in its launch environment and restart. Remove the server with `codex mcp remove klarefi`.

## Claude Code

Add this entry to your project `.mcp.json`. Claude Code expands the variable when it starts.

```json
{
  "mcpServers": {
    "klarefi": {
      "type": "http",
      "url": "https://www.klarefi.com/mcp",
      "headers": { "Authorization": "Bearer ${KLAREFI_API_KEY}" }
    }
  }
}
```

Start Claude Code with `KLAREFI_API_KEY` set, approve the project server if prompted, then open `/mcp`. Remove the entry to disconnect.

## Claude web and remote connectors

In **Customize → Connectors**, select **Add custom connector** and name it **Klarefi**. Enter `https://www.klarefi.com/mcp`, choose **No sign in**, and add a request header named `Authorization` with the value `Bearer <your key>`. On a managed workspace, the owner configures the connector. A header set at workspace level gives each user of that connection the same credential and access.

This setup is documented by Claude and has yet to be tested with Klarefi's remote connector. [Claude custom connector setup](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp)

## Claude Desktop

Use the [remote connector setup](#claude-web-and-remote-connectors) in Claude Desktop to add the hosted server.

## Gemini CLI

Add this entry to `~/.gemini/settings.json` and start Gemini CLI with `KLAREFI_API_KEY` set:

```json
{
  "mcpServers": {
    "klarefi": {
      "httpUrl": "https://www.klarefi.com/mcp",
      "headers": { "Authorization": "Bearer ${KLAREFI_API_KEY}" }
    }
  }
}
```

Open a fresh session, trust the folder when Gemini CLI prompts, then run `/mcp list` to see the tools. Gemini CLI disables MCP servers in untrusted folders.

## Cursor

Start Cursor with `KLAREFI_API_KEY` in its environment, then use [Add Klarefi to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=klarefi&config=eyJ1cmwiOiJodHRwczovL3d3dy5rbGFyZWZpLmNvbS9tY3AiLCJoZWFkZXJzIjp7IkF1dGhvcml6YXRpb24iOiJCZWFyZXIgJHtlbnY6S0xBUkVGSV9BUElfS0VZfSJ9fQ%3D%3D). Review the server before installing. Or merge this entry into `~/.cursor/mcp.json` and open **Customize → MCPs**.

```json
{
  "mcpServers": {
    "klarefi": {
      "url": "https://www.klarefi.com/mcp",
      "headers": { "Authorization": "Bearer ${env:KLAREFI_API_KEY}" }
    }
  }
}
```

The config and install link have yet to be tested in Cursor.

## VS Code

[Open Klarefi's MCP setup in VS Code](https://vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522klarefi%2522%252C%2522type%2522%253A%2522http%2522%252C%2522url%2522%253A%2522https%253A%252F%252Fwww.klarefi.com%252Fmcp%2522%252C%2522headers%2522%253A%257B%2522Authorization%2522%253A%2522Bearer%2520%2524%257Benv%253AKLAREFI_API_KEY%257D%2522%257D%257D) and review the server before installing. For native Copilot, run **MCP: Add Server** and select **Global → Copilot Global**. The workspace-root `.mcp.json` destination appears when `chat.mcp.workspaceRootConfig.enabled` is on. Start the Copilot runtime with `KLAREFI_API_KEY` set and merge this entry into the selected native configuration.

```json
{
  "mcpServers": {
    "klarefi": {
      "type": "http",
      "url": "https://www.klarefi.com/mcp",
      "headers": { "Authorization": "Bearer ${KLAREFI_API_KEY}" }
    }
  }
}
```

The older editor-managed **Local** mode uses `.vscode/mcp.json` with a top-level `servers` object and `${env:KLAREFI_API_KEY}` in the header. The install link opens a review prompt. Use the native config above if your VS Code session runs on the Copilot harness. These paths have yet to be tested in VS Code. [Microsoft MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration)

## Windsurf

Start the editor with `KLAREFI_API_KEY` set. In Windsurf, open the raw Cascade MCP settings, or edit `~/.codeium/windsurf/mcp_config.json`. Add:

```json
{
  "mcpServers": {
    "klarefi": {
      "serverUrl": "https://www.klarefi.com/mcp",
      "headers": { "Authorization": "Bearer ${env:KLAREFI_API_KEY}" }
    }
  }
}
```

Refresh the MCP list after saving. This configuration has yet to be tested in Windsurf.

## Devin Desktop

Start the editor with `KLAREFI_API_KEY` set. In **Customize → MCPs → This computer**, open the MCP config and add:

```json
{
  "mcpServers": {
    "klarefi": {
      "url": "https://www.klarefi.com/mcp",
      "headers": { "Authorization": "Bearer ${env:KLAREFI_API_KEY}" }
    }
  }
}
```

Refresh the MCP list after saving. This configuration has yet to be tested in Devin Desktop.

## Grok Build

Set `KLAREFI_API_KEY` in the CLI's environment and add this to `~/.grok/config.toml`:

```toml
[mcp_servers.klarefi]
url = "https://www.klarefi.com/mcp"
headers = { Authorization = "Bearer ${KLAREFI_API_KEY}" }
```

Run `grok mcp doctor klarefi` to check the connection and tool discovery. In a session, use `/mcps` to see the server. [Grok Build MCP setup](https://docs.x.ai/build/features/mcp-servers)

## ChatGPT and the Gemini app

ChatGPT and the Gemini app support custom MCP servers. Their documented setup flows have no bearer-key field for Klarefi customer tools. For API-key access, use Codex or Gemini CLI. [ChatGPT MCP authentication](https://developers.openai.com/plugins/build/auth) · [Gemini custom apps](https://support.google.com/gemini/answer/17209137?hl=en-PR)

## Troubleshooting

Set `KLAREFI_API_KEY` in the client's launch environment and restart it. With the variable unset, Gemini CLI sends an empty bearer value, while Claude Code and Grok Build send the literal placeholder. `grok mcp doctor` can still report a healthy connection in that case.
