---
title: Connect Claude Code
description: Connect Claude Code to Hostino MCP — on the same machine or on a headless server
sidebar:
  order: 4
  badge:
    text: Alpha
    variant: success
---

Claude Code is the **tested and recommended** client for Hostino MCP.

## 1. Add the server

```bash
claude mcp add --transport http --scope user hostino https://mcp.hostino.ai/mcp
```

With `--scope user` the server is available in all your projects. Drop `--scope user` to add it to the current project only.

Check:

```bash
claude mcp list
```

`hostino` shows "Needs authentication". That's expected: you haven't signed in yet.

## 2. Sign in

In Claude Code run:

```text
/mcp
```

Select `hostino` and choose **Authenticate**. Claude Code opens (or prints) the sign-in link. Sign in with your Hostino account and approve both permissions on the consent page.

### Case A: Claude Code and the browser on the same machine

After approving, click **Continue (same machine)** on the "✅ Signed in" page. Claude Code switches to **connected**.

### Case B: Claude Code on a server or browserless terminal

1. Copy the link Claude Code prints and open it in your laptop or phone browser.
2. Sign in and approve.
3. On the "✅ Signed in" page, click **Copy command**.
4. Run the command in **another terminal on the same server as Claude Code**:

```bash
curl 'http://localhost:PORT/callback?code=…&state=…'
```

Claude Code receives the code and switches to **connected**. The code is valid for 5 minutes; if it expires, choose Authenticate again.

:::tip[Alternative: SSH tunnel]
If you reach the server over SSH, you can forward the port shown in the sign-in link (`redirect_uri=http://localhost:PORT/…`) to your laptop so **Continue (same machine)** works directly:

```bash
ssh -N -L PORT:127.0.0.1:PORT user@your-server
```
:::

## 3. Use it

Ask Claude Code:

- "List my services with their due dates."
- "Which services are due in less than 30 days?"
- "What's the status of example.com?"
- "Which of my domains are expired or expire in the next 60 days?"
- "Show my unpaid invoices."
- "Suggest a plan for this project and, after I agree, request it." (you open the approval link yourself)

Claude Code calls the right tool. All are read-only except `request_order`, which only creates a purchase request with an approval link. [Tool details](/en/ai-mcp/remote-mcp/#tools)

## Managing the connection

| Task | Command |
|---|---|
| Status | `claude mcp list` or `/mcp` |
| Sign in again (e.g. for a new permission) | `/mcp` → `hostino` → Re-authenticate |
| Remove | `claude mcp remove hostino` |

Having trouble? See [Troubleshooting](/en/ai-mcp/troubleshooting/).
