# How to Connect Kalen to Claude Code

> Add Kalen to Claude Code in one terminal command with an API key from your Connect page, check it works, and upload media from the terminal.

Canonical: https://kalen.si/guides/connect-claude-code

[Start](https://kalen.si/guides)

Updated November 23, 2026 · 3 min read

To connect Kalen to Claude Code, create an API key on the [Connect page](https://kalen.si/app/setup) and run one command: `claude mcp add --transport http kalen https://kalen.si/mcp --header "Authorization: Bearer <key>"`. Claude Code then reaches Kalen over HTTP with your key on every call. Start a new Claude Code session and ask it to check your Kalen account. Keys work on every plan, including no plan at all.

## Steps

1. Sign in to Kalen and open the [Connect page](https://kalen.si/app/setup).
2. Create an API key. It starts with `kln_live_` and is shown once, so copy it now. You can keep up to 10 active keys, one per machine or app, and revoke any of them later.
3. In a terminal, run once, with your key in place of `<key>`:

```
claude mcp add --transport http kalen https://kalen.si/mcp --header "Authorization: Bearer <key>"
```

1. Start a new Claude Code session and send the prompt below.

By default `claude mcp add` saves the server for the current project. To have Kalen in every project, add `--scope user` to the command.

## Check that it works

```
Use Kalen to check my account.
```

Claude Code should call the `account` tool and report your plan, credits, X connection and profile. The call appears on your [Usage](https://kalen.si/app/usage) page with the client’s name.

## Example

An illustration, not a real account.

You: Use Kalen to check my account.

Claude Code calls `account`. Kalen’s line comes back: your plan and credits, “I post as” your handle if X is connected, and whether your voice and story bank are saved. If X isn’t connected, the result carries a connect link you open in a browser.

You: Write a post about what I shipped today and schedule it for this evening.

Claude Code asks you for the facts, writes the draft, scores it with Kalen, shows it to you in full with its time, and schedules it only after you say yes.

## Media from the terminal

A terminal can’t show Kalen’s upload panel, so `upload_media` returns a `curl` line instead. Run it once per local file:

```
curl -F "file=@/path/to/image.png" "<upload link from Kalen>"
```

The link is valid for an hour and takes any number of files in that hour. Then ask Claude Code to list your media to get the ids. See [Media and video](https://kalen.si/guides/media-and-video).

## What it costs

The key and the connection are free. Credits are spent when posts are scheduled and on paid reads from X, which ask first. See [Credits and plans](https://kalen.si/guides/credits-and-plans).

## Common errors

- **“Missing or invalid Kalen credentials” (HTTP 401).** The key was mistyped or revoked. Create a new one on the [Connect page](https://kalen.si/app/setup), then remove and add the server again with `claude mcp remove kalen` and the add command above.
- **A new tool is missing.** Claude Code reads the tool list when a session starts. Start a new session.
- **Claude Code doesn’t use Kalen.** Name Kalen in the request, for example “with Kalen”.
- **Keep the key out of your repo.** The add command stores it in your Claude Code settings, not in project files you commit, unless you chose a project-shared scope.

Related reading: [Post to X from Claude Code](https://kalen.si/blog/post-to-x-from-claude-code).

## Next

Next: [Connect your X account](https://kalen.si/guides/connect-x).

**About this guide.** Written by the team that builds Kalen. Something didn't match what you see? Write to [support@kalen.si](mailto:support@kalen.si) and say which AI you use.

## Your X assistant, inside your AI.

 [Start your 7-day trial for $1](https://kalen.si/#pricing)
