# Connect an AI assistant

> Turn on the MCP server, create a personal token and connect an MCP client such as Claude Code or Claude Desktop to Buttons.

This guide turns on the MCP server, creates a personal token, and connects an assistant to Buttons. When you are done, you can ask the assistant about your system in plain language, for example "List my positions" or "Which connections are offline?".

<callout color="yellow" title="Warning">
  A connected assistant acts as you. It can do anything your Buttons user can do, including changing and deleting configuration and triggering actions on live devices. Do not connect an assistant to a system that is on air until you have tried it on a test system.
</callout>

## Before you begin

You need:

- Buttons 1.9 or later.
- An MCP client on a computer that can reach Buttons over the network, for example Claude Code or Claude Desktop.
- To turn the MCP server on: a role with the **MCP management** permission under System administration. Administrators have it. If you only need a token, ask an administrator to turn the server on for you.

## Turn on the MCP server

The MCP server is off on a new system. Turning it on lets users connect clients with their own tokens.

1. Open **Settings → MCP**.
2. Turn on **Enable MCP server**.

![Settings → MCP with the MCP server turned on, two tokens and the Connect a client section](https://bitfocus.io/api/docs-media/file/settings-mcp.png?prefix=docs-media)

If the switch is greyed out, your role does not have the MCP management permission.

## Create a personal token

Each user creates their own tokens. A token carries your Buttons access, so do not share it.

1. In **Settings → MCP**, select **Create personal token**.
2. Enter a **Name** that says where the token is used, for example `Claude Code on my laptop`.
3. Optional: set an **Expiration**. Use the quick buttons for 1 day, 30 days, 90 days or 1 year, or leave the field empty for a token that never expires.

![Create MCP token dialog with a name filled in and no expiration](https://bitfocus.io/api/docs-media/file/create-token-1.png?prefix=docs-media)

4. Select **Create token**.
5. Copy the token and store it in your MCP client now. Buttons shows it only once.

The dialog also shows a ready-made client configuration with the token filled in.

![MCP token created dialog showing the token and the client configuration](https://bitfocus.io/api/docs-media/file/token-created.png?prefix=docs-media)

## Connect an MCP client

Buttons serves MCP over Streamable HTTP and authenticates each request with a bearer token. Any client that supports remote HTTP servers and custom headers can connect.

1. In **Settings → MCP**, copy the **Endpoint**. It ends in `/mcp`, for example `http://192.168.0.10:4440/mcp`.
2. Copy the **Configuration** block and replace `<MCP_TOKEN>` with your token:

```json
{
  "mcpServers": {
    "bitfocus-buttons": {
      "type": "streamable-http",
      "url": "http://192.168.0.10:4440/mcp",
      "headers": { "Authorization": "Bearer <MCP_TOKEN>" }
    }
  }
}
```

3. Add the entry to your client's MCP configuration. Where it goes depends on the client; see its documentation.

For Claude Code, add the server from a terminal instead:

```bash
claude mcp add --transport http bitfocus-buttons http://192.168.0.10:4440/mcp --header "Authorization: Bearer <MCP_TOKEN>"
```

### Claude Desktop

Claude Desktop connects to Buttons through an extension instead of a configuration entry.

1. In **Settings → MCP**, next to **Claude Desktop**, select **Download extension**.
2. Open the downloaded file in Claude Desktop.
3. Enter your token when Claude Desktop asks for it.

### HTTP or HTTPS endpoint

The default HTTPS certificate in Buttons is self-signed, and most MCP clients refuse it. That is why the **Endpoint** in **Settings → MCP** is always an `http://` address, even when you opened Buttons over HTTPS.

When you opened Buttons over HTTPS, **Settings → MCP** also shows an **HTTPS endpoint**. Use it only if your MCP client trusts the HTTPS certificate configured in Buttons. Both endpoints are served by the same Buttons system.

## Check the connection

Ask the assistant to list something you know is there, such as "List the surfaces in Buttons". If it fails, the client usually shows one of these messages:

| Message | What it means | What to do |
| --- | --- | --- |
| `MCP token required` | The client sent no token. | Check that the `Authorization` header is set to `Bearer` followed by the token. |
| `Invalid or expired MCP token` | The token is wrong, revoked or expired. | Create a new token and update the client. |
| `MCP is disabled on this Buttons system` | The MCP server is off. | Turn on **Enable MCP server**, or ask an administrator. |
| `Too many requests` | The client hit the rate limit. | Wait a moment. See [Manage MCP access and tokens](/docs/buttons/v1.10/mcp/manage-mcp-access#rate-limit). |

If the client cannot reach Buttons at all, check that the endpoint address and port are the ones shown in **Settings → MCP**, and that no firewall blocks the computer running the client.

## Next steps

- [Edit with an assistant in the editor](/docs/buttons/v1.10/mcp/edit-with-the-editor)
- [What an assistant can do](/docs/buttons/v1.10/mcp/what-an-assistant-can-do)
- [Manage MCP access and tokens](/docs/buttons/v1.10/mcp/manage-mcp-access)
