# connector.json

> Every field of connector.json, the file in the Minekube plugin's folder that turns on the connector and says which registry, relays, network and labels a server has.

> **Preview: Connect in the Minekube plugin:**
> This page describes the connector in the Minekube plugin, the next generation of Connect. The Connect plugin has its own configuration, described in the [Connect docs](https://minekube.com/guide/connectors/plugin).

The connector starts only when `connector.json` exists in the plugin's folder: `plugins/Minekube/` on Paper, and the Minekube plugin's folder on Velocity. It needs Java 22 or newer. Paths in the file are relative to the plugin's folder.

```json title="plugins/Minekube/connector.json"
{
  "directory": { "registry": "https://registry.staging.minekube.net" },
  "relays": ["https://relay.staging.minekube.net/"],
  "join": { "network": "my-network", "token": "network-invite" },
  "labels": { "stage": "lobby" }
}
```

## Fields

| Field | Type | Required | What |
| --- | --- | --- | --- |
| `directory` | `{ "registry": url }` or `{ "file": path }` | Yes | Where the connector looks up networks and instances. `registry` keeps a signed control channel to the registry at that URL. `file` reads a recorded directory from a JSON file, for tests and offline development. |
| `relays` | array of URLs | Yes | The relays to pick the home relay from. The connector measures them and takes the nearest. |
| `labels` | object of strings | No | The server's own labels, such as `stage=lobby`. Labels under `minekube.com/` are dropped, except `minekube.com/entry`. See [Labels and selectors](https://minekube.com/guide/networks/labels). |
| `join` | `{ "network": name, "token": path }` | No | Joins `network` with the token in the file at `path`: a one-time invite (`mk network invite`), or a token from the server's environment that a trust rule covers (`mk trust add`). The connector reads the file again on every attempt, because such tokens rotate. |
| `network` | string | No | The network this instance belongs to, with a `file` directory. With a registry, the registry knows it. |
| `key` | path | No | The instance's key file, made on first start. Default `instance.key`. |
| `servers` | object of selectors | No | On a proxy: the names it knows its backends by, each with the label selector that picks the backend. Each name gets a loopback port. |
| `bundles` | path | No | Where the connector writes the bundles the network assigns this instance (`mk publish`). The plugin sets it unless the file does. |

The platform and its version are not fields you set. The plugin reports them, and the registry turns them into the system labels `minekube.com/platform` and `minekube.com/version`.

## Related

- [Let servers in](https://minekube.com/guide/networks/let-servers-in): invites, trust rules and your dev server.
- [How servers get their bundles](https://minekube.com/games/versions-and-deployments/bundle-delivery): what the connector does with `bundles`.
