Enable LSP for better code awareness

mcp & integrations

// what it does

The lsp config key runs language servers so the agent works from real diagnostics, types, and definitions instead of guessing. "lsp": true turns on the built-ins (TypeScript, Python, Go, Rust, and ~30 more, auto-downloaded on first use); an object form lets you disable one or register a custom server by command and extensions.

// shell

$ { "lsp": true }
$ { "lsp": { "typescript": { "disabled": true } } }

// gotcha

opencode downloads servers on demand; in a locked-down or offline environment set OPENCODE_DISABLE_LSP_DOWNLOAD=true and install them yourself. LSP adds some startup latency, which is why it is configurable.

// resources