# Connect Claude Code

_Connect an AI assistant · 2 min read · Updated 2026-10-28 · https://lanachat.ai/guides/ai-connect-claude-code/_

Claude Code adds the LanaChat MCP server with one command. You need Claude Code installed ([guide](https://lanachat.ai/guides/ai-install-assistant/)) and your token ([guide](https://lanachat.ai/guides/ai-create-mcp-token/)).

## Add the server

1. Open a terminal.
2. Paste this command. Replace `YOUR_MCP_TOKEN` with your token, keep the word `Bearer` and the space after it.

```bash
claude mcp add --transport http --scope user lanachat https://api.lanachat.ai/mcp --header "Authorization: Bearer YOUR_MCP_TOKEN"
```

Press Enter. Claude Code answers that it added the server `lanachat`.

What each part means:

| Part | Meaning |
|---|---|
| `--transport http` | the server speaks Streamable HTTP |
| `--scope user` | available in every folder you open, not only this one |
| `lanachat` | the name of the server in Claude Code |
| `https://api.lanachat.ai/mcp` | the LanaChat MCP address |
| `--header "Authorization: Bearer …"` | your token, sent with each call |

> Tip: To keep the token out of your terminal history on a Mac or Linux, type `read -s LANACHAT_MCP_TOKEN`, press Enter, paste the token (nothing shows), press Enter, then run the same command with `Bearer $LANACHAT_MCP_TOKEN` in place of `Bearer YOUR_MCP_TOKEN`.

## Check it is connected

1. Start Claude Code: type `claude` and press Enter.
2. Type `/mcp` and press Enter.
3. `lanachat` shows as **connected**, with its tools.

From the terminal, `claude mcp list` gives the same answer without starting a session.

## Change or remove it

- New token (after a rotation): `claude mcp remove lanachat --scope user`, then add it again with the new token.
- Changed the boxes of the token with **Edit**: quit Claude Code and start it again, so it reads the new tool list.

Next: [test the connection](https://lanachat.ai/guides/ai-test-connection/).

## Related

- [Create your MCP token](https://lanachat.ai/guides/ai-create-mcp-token/)
- [Test the connection](https://lanachat.ai/guides/ai-test-connection/)
- [Troubleshooting the MCP: 401, 403, missing tools](https://lanachat.ai/guides/ai-troubleshooting/)
