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

> ## Agent Instructions
> Use the exact commands, endpoints, and product terms in these docs. Check the context map before connected services or the web.

# CLI reference

> Install the Port of Context platform CLI, sign in, and inspect local MCP configuration.

The platform CLI installs to `~/.local/bin/pctx`. It is separate from the open-source tool that also uses the `pctx` name.

## Install

Download and inspect the installer before running it.

```bash Terminal theme={null}
curl -fsSL https://pctx.ai/install.sh -o /tmp/pctx-install.sh
less /tmp/pctx-install.sh
sh /tmp/pctx-install.sh
```

Confirm that you installed the platform CLI:

```bash Terminal theme={null}
~/.local/bin/pctx mcp scan --help
```

## Sign in

```bash Terminal theme={null}
~/.local/bin/pctx login --url https://mcp.pctx.ai
```

The CLI session is separate from the OAuth session in your MCP client. Complete the browser prompt before running authenticated commands.

## Scan MCP configuration

Find MCP servers already configured in supported local agents:

```bash Terminal theme={null}
~/.local/bin/pctx mcp scan
```

Use JSON output for automation:

```bash Terminal theme={null}
~/.local/bin/pctx mcp scan --json
```

The scan reports each service, the agents or repository files that configure it, and repeated configurations. Localhost servers are excluded from this scan.

## Configure consolidation

Build an interactive plan to consolidate supported MCP servers behind Port of Context:

```bash Terminal theme={null}
~/.local/bin/pctx mcp configure
```

Depending on your permissions and choices, the command can:

* Enable matching built-in connectors for the workspace
* Add the `pctx` gateway to supported agents where it is missing
* Remove local entries that the gateway now serves

Custom servers and repository-shared configuration are left alone.

> [!WARNING]
>
> Enabling a connector affects the workspace. Editing agent configuration affects local files. Confirm both parts of the plan before continuing.

## Command summary

| Command | Purpose | Changes state |
| - | - | - |
| `pctx login` | Authenticate the platform CLI | Local session |
| `pctx mcp scan` | Inspect MCP configurations | No |
| `pctx mcp configure` | Plan and apply consolidation | With confirmation |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.