# Connect cloud MCP clients

Add OSMates as a connector in an MCP client that runs on the web, such as Claude or ChatGPT.

## Before you start

- The [tailnet browser](https://osmates.com/docs/tailnet) serves this Mac, with a passkey added.
- You sign in from a device in your tailnet, such as your phone.
- Port 8443 of this Mac's tailnet name serves nothing else.

The client reaches this Mac through your own Tailscale Funnel. You allow it twice: with your passkey, then on this Mac.

## Turn on Funnel in Tailscale

1. Open Tailscale's admin console and choose **Access controls**.
2. Add the `funnel` attribute for this Mac under `nodeAttrs`, then save.

For example, for every member's devices:

```json
"nodeAttrs": [
  { "target": ["autogroup:member"], "attr": ["funnel"] }
]
```

## Turn on Cloud Clients

1. Choose **OSMates > Settings**, then click **Remote**.
2. Under **Cloud Clients**, turn on **Let cloud clients connect**.
3. Wait until **Status** says **Serving**.
4. Click **Copy** beside **Connector URL**.

In Terminal, run `osmates remote set cloud-clients on`. The URL looks like `https://studio.tail1234.ts.net:8443/mcp`. Anyone on the internet can reach it, and only clients you allow get in.

## Add OSMates as a connector

1. In the client, add a custom connector and paste the connector URL.
2. Click the client's **Connect**. It opens this Mac's tailnet page.
3. Sign in with your passkey.
4. Check the client's name and where its codes go. Choose a **Profile**, then click **Continue**.
5. On this Mac, check the same request and click **Allow**.

To check, ask the client to list your machines. You answer on this Mac before it uses a machine, as for any agent. [Pick a profile](https://osmates.com/docs/agents#pick-a-profile) lists the tools each profile gets.

## Revoke a client

In **Remote** settings, under **Cloud Clients**, click **Revoke** beside the client. Its sessions end at once. To connect it again, add the connector again.

In Terminal, list the clients, then revoke one by its name:

```sh
osmates remote clients
osmates remote clients revoke <client>
```

To stop serving every client, turn off **Let cloud clients connect**, or run `osmates remote set cloud-clients off`. OSMates removes its funnel on port 8443, and a funnel you set up yourself stays.

## Limits

- Turning off the tailnet browser turns Cloud Clients off too.
- A client that doesn't connect for 30 days signs in again.
- Up to 32 clients can be allowed at once.
- A new tailnet name for this Mac ends every client's access.
- This Mac must stay [awake and logged in](https://osmates.com/docs/remote#keep-a-host-reachable).

## If a client doesn't connect

- If **Status** says to allow Funnel for this Mac, [turn on Funnel](https://osmates.com/docs/cloud-clients#turn-on-funnel-in-tailscale). OSMates tries again within a minute.
- If **Status** says port 8443 already serves something, turn that off in Tailscale. Then turn Cloud Clients off and on.
- If the client's sign-in page doesn't open, open it on a device in your tailnet.
