> ## Documentation Index
> Fetch the complete documentation index at: https://docs.harbormcp.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Command Reference

> Complete reference for every Harbor CLI command.

Every command has a nautical name and a standard alias. Use whichever you prefer.

## harbor dock

<Info>Alias: `harbor add`</Info>

Dock a new MCP server into the harbor. Supports three modes: **native** (one-click catalog), **custom stdio**, and **custom remote**.

### Native servers

Dock a server from Harbor's built-in catalog with a single command:

```sh theme={null}
harbor dock <native-id> [--name <name>] [--skip-auth] [--disabled] [--auto-start] [-- <extra-args>...]
```

| Flag           | Description                                                        |
| -------------- | ------------------------------------------------------------------ |
| `<native-id>`  | Server id from the catalog (e.g., `github`, `slack`, `filesystem`) |
| `--name`       | Override the default server name                                   |
| `--skip-auth`  | Dock now, authorize later                                          |
| `--disabled`   | Keep moored (disabled) initially                                   |
| `--auto-start` | Start automatically when Harbor launches                           |
| `-- <args>`    | Extra arguments appended after the catalog defaults                |

**Examples:**

```sh theme={null}
# Dock GitHub (remote, needs a PAT in the vault)
harbor dock github

# Dock filesystem with allowed directories
harbor dock filesystem -- ~/Documents ~/Projects

# Dock Slack (opens browser for OAuth)
harbor dock slack

# Dock with a custom name
harbor dock atlassian --name my-jira
```

See the [native servers guide](/guides/native-servers) for the full catalog.

### Custom stdio servers

```sh theme={null}
harbor dock --name <name> --command <command> [--args <args>...] [--env <KEY=VALUE>...]
```

| Flag           | Description                                             |
| -------------- | ------------------------------------------------------- |
| `--name`       | Unique name for the server                              |
| `--command`    | Executable to run (e.g., `npx`, `node`, `python`)       |
| `--args`       | Arguments to pass (comma-separated for multiple)        |
| `--env`        | Environment variables (supports `vault:KEY` references) |
| `--auto-start` | Start automatically when Harbor launches                |
| `--disabled`   | Keep moored (disabled) initially                        |

**Example:**

```sh theme={null}
harbor dock --name memory --command npx --args "-y,@modelcontextprotocol/server-memory"
```

### Custom remote (HTTP) servers

```sh theme={null}
harbor dock --name <name> --url <url> [-H <KEY:VALUE>...] [--env <KEY=VALUE>...]
```

| Flag             | Description                                             |
| ---------------- | ------------------------------------------------------- |
| `--name`         | Unique name for the server                              |
| `--url`          | URL of the remote MCP HTTP endpoint                     |
| `-H`, `--header` | Custom HTTP headers (`KEY:VALUE`, can be repeated)      |
| `--env`          | Environment variables (supports `vault:KEY` references) |

**Example:**

```sh theme={null}
harbor dock --name my-api --url https://mcp.example.com/v1/mcp \
  -H "Authorization:Bearer vault:my_api_key"
```

***

## harbor undock

<Info>Alias: `harbor remove`</Info>

Undock a server and cast it off.

```sh theme={null}
harbor undock --name <name>
```

***

## harbor fleet

<Info>Alias: `harbor list`</Info>

Review your fleet of docked servers. Shows each server's name, command/url, status, and enabled state.

```sh theme={null}
harbor fleet [--host <host>]
```

| Flag     | Description                                        |
| -------- | -------------------------------------------------- |
| `--host` | Filter servers bound to a specific host (optional) |

***

## harbor launch

<Info>Alias: `harbor start`</Info>

Launch a server out to sea (start the process).

```sh theme={null}
harbor launch --name <name>
```

***

## harbor manifest

<Info>Alias: `harbor status`</Info>

Read the harbor manifest — shows the current state of all servers and hosts.

```sh theme={null}
harbor manifest
```

***

## harbor signal

<Info>Alias: `harbor sync`</Info>

Signal connected hosts to update their charts. This merges your docked servers into each host's config file.

<Note>
  Syncing happens **automatically** when you dock, undock, toggle, or connect a host. You only need `harbor signal` to force a manual re-sync.
</Note>

```sh theme={null}
harbor signal [--host <host>]
```

| Flag     | Description                             |
| -------- | --------------------------------------- |
| `--host` | Sync only to a specific host (optional) |

***

## harbor port

<Info>Alias: `harbor host`</Info>

Manage host connections. Users opt in to each host individually.

```sh theme={null}
harbor port                    # List all hosts with link status
harbor port link <host>        # Link a host to start syncing
harbor port unlink <host>      # Unlink a host
```

Valid hosts: `claude`, `claude-desktop`, `codex`, `vscode`, `cursor`

***

## harbor lighthouse

<Info>Alias: `harbor gateway`</Info>

Light the lighthouse — start the HTTP/SSE gateway to expose your MCP servers over the network.

```sh theme={null}
harbor lighthouse [--port <port>] [--host <host>] [--expose] [--token <token>]
```

| Flag       | Description                                             |
| ---------- | ------------------------------------------------------- |
| `--port`   | Port to listen on (default: `3100`)                     |
| `--host`   | IP to bind to (default: `127.0.0.1`)                    |
| `--expose` | Shorthand for `--host 0.0.0.0` (expose to network)      |
| `--token`  | Bearer token required for remote (non-localhost) access |

See the [gateway guide](/guides/gateway) for endpoint details.

***

## harbor publish

<Info>Alias: `harbor broadcast`</Info>

Broadcast your gateway to the high seas — publish your local MCP tools to the internet via a secure QUIC tunnel.

```sh theme={null}
harbor publish [--relay <addr>] [--subdomain <name>] [--relay-key <hex>] [--transport <type>] [--port <port>] [--tools <tool,...>]
```

| Flag          | Default              | Description                                                       |
| ------------- | -------------------- | ----------------------------------------------------------------- |
| `--relay`     | `relay.harbormcp.ai` | Relay server address (hostname or `host:port`)                    |
| `--subdomain` | auto-assigned        | Requested subdomain (e.g. `myname` → `myname.relay.harbormcp.ai`) |
| `--relay-key` | auto-fetched         | Relay's public key (hex) — required for self-hosted relays        |
| `--transport` | `quic`               | Transport to use: `quic` (default) or `cloudflare`                |
| `--port`      | from config          | Local gateway port to tunnel (default: `3100`)                    |
| `--tools`     | all                  | Comma-separated tool allowlist for remote access                  |

**Examples:**

```sh theme={null}
# Zero-config publish via managed relay
harbor publish

# Custom subdomain
harbor publish --subdomain myname

# Self-hosted relay
harbor publish --relay relay.example.com:7800 --relay-key <hex-key>

# Cloudflare Tunnel (requires cloudflared installed)
harbor publish --transport cloudflare

# Expose only specific tools remotely
harbor publish --tools get_issues,search_code
```

See the [publishing guide](/guides/publishing) for full details.

***

## harbor relay

Run a self-hosted Harbor relay server.

```sh theme={null}
harbor relay [--quic-port <port>] [--https-port <port>] [--domain <domain>] [--keypair-file <path>] [--print-key]
```

| Flag             | Default                      | Description                                |
| ---------------- | ---------------------------- | ------------------------------------------ |
| `--quic-port`    | `7800`                       | Port for QUIC tunnel listener (UDP)        |
| `--https-port`   | `8443`                       | Port for HTTPS frontend (TCP)              |
| `--domain`       | `relay.harbormcp.ai`         | Domain for subdomain routing               |
| `--keypair-file` | `/data/harbor-relay/keypair` | Path to persist the relay keypair          |
| `--print-key`    | —                            | Print the relay's public key and exit      |
| `--auth-token`   | —                            | Require this token from all tunnel clients |

**Examples:**

```sh theme={null}
# Start relay with default settings
harbor relay --domain relay.example.com

# Print the relay's public key (share with tunnel clients)
harbor relay --print-key --keypair-file /data/harbor-relay/keypair
```

See the [self-hosting guide](/guides/publishing#self-hosting-the-relay) for deployment instructions.

***

## harbor cargo

<Info>Alias: `harbor filter`</Info>

Manage tool filtering — control which tools each server exposes.

```sh theme={null}
harbor cargo allowlist <server> [tools...]   # Set tool allowlist
harbor cargo blocklist <server> [tools...]   # Set tool blocklist
```

***

## harbor scout

<Info>Alias: `harbor search`</Info>

Scout the seas for new MCP servers on the official [MCP Registry](https://registry.modelcontextprotocol.io).

```sh theme={null}
harbor scout <query>
```

***

## harbor chest

<Info>Alias: `harbor vault`</Info>

Open the treasure chest — manage secrets stored in your OS keychain.

```sh theme={null}
harbor chest set <key> <value>
harbor chest get <key>
harbor chest delete <key>
harbor chest list
```

See the [vault guide](/guides/vault) for more details.

***

## harbor crew

<Info>Alias: `harbor team`</Info>

Share MCP server configs across your team via a git-backed fleet repository. Secrets stay local — only `vault:KEY_NAME` references are committed.

See the [team sync guide](/guides/team-sync) for a full walkthrough.

### harbor crew init

Initialize `~/.harbor/fleet/` as a git repository. Optionally links a remote so teammates can clone the same fleet.

```sh theme={null}
harbor crew init [--git <url>]
```

| Flag    | Description                                                 |
| ------- | ----------------------------------------------------------- |
| `--git` | Git remote URL (SSH or HTTPS) to push/pull the fleet config |

**Examples:**

```sh theme={null}
# Local-only fleet (add a remote later)
harbor crew init

# Initialize and link a remote in one step
harbor crew init --git git@github.com:your-org/fleet.git
```

### harbor crew join

Join an existing team fleet by cloning its git repository and auto-merging its servers into your local config.

```sh theme={null}
harbor crew join <git-url>
```

### harbor crew push

Push local fleet-managed servers to the shared repository. Pass server names to mark local servers as fleet-managed before pushing.

```sh theme={null}
harbor crew push [<servers>...] [--message <msg>]
```

| Flag              | Description                                                 |
| ----------------- | ----------------------------------------------------------- |
| `<servers>`       | Names of local servers to mark as fleet-managed and include |
| `-m`, `--message` | Commit message (default: `"Update fleet config"`)           |

**Examples:**

```sh theme={null}
# Share two existing servers with the team
harbor crew push github linear

# Push with a custom commit message
harbor crew push -m "Add Slack server"
```

### harbor crew pull

Fetch upstream changes and 3-way merge fleet servers into your local config.

```sh theme={null}
harbor crew pull [--dry-run]
```

| Flag        | Description                                         |
| ----------- | --------------------------------------------------- |
| `--dry-run` | Preview what would change without applying anything |

<Note>
  Servers you have edited locally since the last pull will be skipped (`locally modified`). Harbor never silently overwrites your changes. To accept the upstream version, run `harbor undock <name>` then `harbor crew pull`. To share your version instead, run `harbor crew push <name>`.
</Note>

### harbor crew status

Show local vs fleet drift — git sync status (ahead/behind) and per-server state.

```sh theme={null}
harbor crew status
```

### harbor crew provision

Prompt for vault secrets required by fleet servers that aren't yet stowed locally.

```sh theme={null}
harbor crew provision [--dry-run]
```

| Flag        | Description                                    |
| ----------- | ---------------------------------------------- |
| `--dry-run` | Show missing keys without prompting for values |

***

## harbor scuttle

<Info>Alias: `harbor uninstall`</Info>

Scuttle the ship — uninstall Harbor from your system. Removes Harbor-managed server entries from host configs, the app, and the CLI binary.

```sh theme={null}
harbor scuttle [--purge] [--dry-run] [--yes]
```

| Flag          | Description                                                 |
| ------------- | ----------------------------------------------------------- |
| `--purge`     | Also remove `~/.harbor/` config directory and vault secrets |
| `--dry-run`   | Preview what would be removed without making changes        |
| `-y`, `--yes` | Skip the confirmation prompt                                |

You can also uninstall via the install script:

<Tabs>
  <Tab title="macOS / Linux">
    ```sh theme={null}
    curl -fsSL https://harbormcp.ai/install.sh | sh -s -- --uninstall
    ```
  </Tab>

  <Tab title="Windows">
    ```powershell theme={null}
    $env:HARBOR_UNINSTALL=1; irm https://harbormcp.ai/install.ps1 | iex
    ```
  </Tab>
</Tabs>

## harbor update

Update Harbor to the latest version. Checks GitHub releases, downloads the appropriate binary for your platform, verifies the SHA256 checksum, and replaces the current binary.

```sh theme={null}
harbor update
```

### Flags

| Flag        | Description                               |
| ----------- | ----------------------------------------- |
| `--check`   | Just check for updates without installing |
| `-y, --yes` | Skip the confirmation prompt              |

### Examples

```sh theme={null}
# Check if an update is available
harbor update --check

# Update without confirmation
harbor update --yes
```

Harbor also checks for updates automatically in the background. If a newer version is available, a notice appears after any command (checked once every 24 hours).
