---
title: Claude Code
description: "Connect Claude Code to the platform with clika-cli mcp install, with claude mcp add, or with an entry in ~/.claude.json, then check the connection and remove it."
---

Connect Claude Code to the CLIKA Platform and you can ask it about your devices and benchmarks while you work. There are three ways to connect; pick one.

| Way | Use it when | Where the API key lives |
| --- | --- | --- |
| [`clika-cli mcp install`](#register-with-the-clika-cli-recommended) (recommended) | You use the CLIKA CLI. | In your CLIKA CLI profile. Claude Code's files hold no key. |
| [`claude mcp add`](#add-it-with-claude-mcp-add) | You do not use the CLIKA CLI. | In `~/.claude.json`, in plain text. |
| [An entry by hand](#add-the-entry-by-hand) | You manage the config file yourself. | In your CLIKA CLI profile. |

Each needs an [API key](index.md#you-need-an-api-key).

## Register with the CLIKA CLI (recommended)

With the CLIKA CLI installed and logged in ([Get started with the CLI](../cli/get-started.md)), one command registers the platform:

```bash
clika-cli mcp install claude-code
```

If a Claude Code session is running, the command says so: restart it to load the server.

What the command does:

- It first checks the profile's key with one request to the deployment. If the profile has no key or the deployment refuses it, the command offers to log in when it runs at a terminal, and prints the `login` command to run otherwise.
- It adds an entry named `clika-platform` to the user-scope `mcpServers` of `~/.claude.json` (`$CLAUDE_CONFIG_DIR/.claude.json` when `CLAUDE_CONFIG_DIR` is set), so every project on the machine sees the server.
- The entry is an HTTP connection to `<base-url>/api/mcp`. Its `Authorization` header comes from a `headersHelper`: a command Claude Code runs for each connection, here `clika-cli --profile default mcp headers`, which prints the header from the CLIKA CLI profile. The API key never lands in `~/.claude.json`, and a new key needs a new `clika-cli login` and no change to the entry.

Useful flags:

| Flag | What it does |
| --- | --- |
| `--profile staging` | Registers another deployment's profile. |
| `--name clika-staging` | Picks the entry's name. |
| `--dry-run` | Prints the entry without writing it. |
| `--insecure-tls` | For a deployment with a self-signed certificate: the entry runs the CLIKA CLI as a local bridge (`mcp --remote`) instead of connecting over HTTP. [Troubleshooting](troubleshooting.md#a-self-signed-certificate-on-premise) explains why. |

The [CLI reference](../cli/mcp.md#mcp-install-uninstall-status-and-headers) lists every flag.

## Add it with `claude mcp add`

Without the CLIKA CLI, register the endpoint with Claude Code's own command:

```bash
claude mcp add --transport http clika-platform https://platform.clika.io/api/mcp --header "Authorization: Bearer clika_your_api_key" --scope user
```

- `--scope user` makes the server available in every project.
- Claude Code stores the key in `~/.claude.json` as part of the entry, readable by anything that can read that file. A new key means removing the entry and adding it again.
- On a deployment with a self-signed certificate, trust its certificate authority in Claude Code (`NODE_EXTRA_CA_CERTS`) or register with `clika-cli mcp install claude-code --insecure-tls` instead ([Troubleshooting](troubleshooting.md#a-self-signed-certificate-on-premise)).
- The **Connect an AI agent (MCP)** card under **Settings**, then **Developer access**, shows this command with your deployment's address filled in, twice: under the server name `clika-rt-remote-full` for the full endpoint `/api/mcp`, and under `clika-rt-remote` for the `benchmark-ops` toolset (`/api/mcp/benchmark-ops`). The name is yours to choose.

## Add the entry by hand

Log in with the CLIKA CLI first (`clika-cli --base-url https://platform.clika.io login`). Then write the same entry `mcp install` writes, in the top-level `mcpServers` of `~/.claude.json` for every project, or in `.mcp.json` at a project's root for that project only:

```json
{
  "mcpServers": {
    "clika-platform": {
      "type": "http",
      "url": "https://platform.clika.io/api/mcp",
      "headersHelper": "/usr/local/bin/clika-cli --profile default mcp headers"
    }
  }
}
```

- Claude Code runs `headersHelper` through a shell, so put double quotes around a CLI path that contains a space.
- Edit `~/.claude.json` while no Claude Code session is running, since a running session may write the file back.
- An entry you write by hand is yours: `mcp install` and `mcp uninstall` never change or remove it. If it uses the name `clika-platform`, `mcp install` refuses that name and asks for `--name`.

## Check the connection

`clika-cli mcp status` reports, for each client, whether `mcp install` registered the server, under which name and profile, and which config file it read. Then start Claude Code and ask:

> Which of my Clika Platform devices are online?

The answer comes from the device list tool, `get_devices`. If the tools do not appear, see [Troubleshooting](troubleshooting.md).

## Remove it

Remove the entry the way you added it:

| Added with | Remove with |
| --- | --- |
| `clika-cli mcp install` | `clika-cli mcp uninstall claude-code`. It deletes the entries it added for the profile and leaves every other entry alone. |
| `claude mcp add` | `claude mcp remove clika-platform --scope user` |
| By hand | Delete the entry from the file. |

If a Claude Code session is running, restart it. If no other client uses the API key, revoke it under **Settings**, then **Developer access**.
