SQLCtx includes an LSP server for its SQL dialect (MODEL/DIMENSION/METRIC/RELATIONSHIP/SEGMENT).

Install the required extra with `uv tool install "sqlctx[lsp]"`, or use the `uvx --from` command below.

## Start the Server

```bash doc-validate=lint
sqlctx lsp
```

```bash doc-test
uvx --from "sqlctx[lsp]" sqlctx lsp --help
```

```text doc-expected-contains
Usage: sqlctx lsp
```

The LSP server runs on stdio. Configure your editor to start the command for files you want to edit.

## Troubleshooting

- If completion doesn’t work, confirm the editor is actually launching `sqlctx lsp`.
- If diagnostics are missing, run `sqlctx validate` and compare errors.