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

# CLI

> Install and run the Latch CLI to wrap MCP servers.

## Install

```bash theme={null}
npm install -g @latchagent/cli
```

## Configure

```bash theme={null}
latch init
```

This writes `~/.latch/config.json` so you don’t have to pass `--cloud-url`, `--workspace`, etc. every time.

## Run (wrap an upstream MCP server)

```bash theme={null}
latch run --upstream-command "npx" --upstream-args "-y,@modelcontextprotocol/server-filesystem,/tmp"
```

## Common flags

* `--cloud-url`: Latch dashboard/API URL (default should come from config)
* `--workspace`: Workspace ID
* `--upstream-id`: Upstream ID
* `--agent-key`: Agent key
