GuidesHosting choices

OpenCode LSP: language servers in version 1 and 2

OpenCode 2 runs no language servers. OpenCode 1: "lsp": true, the 34 built-in servers, custom ones, and why diagnostics don't appear.

November 23, 2026The Everpod team
The short answer

OpenCode 2 runs no language servers. As of 2.4.1 (November 23, 2026) it accepts an lsp block in opencode.json and does nothing with it: no server starts, no diagnostics reach the agent, and there is no LSP tool. The return is tracked in an open issue with no date; until then, put your project’s lint and typecheck commands in AGENTS.md. OpenCode 1 does run them, but only when you turn them on: add "lsp": true to opencode.json and it starts the matching server (34 built in, among them typescript, pyright, gopls, rust-analyzer and clangd) when it opens a file, then appends any errors to the result of each edit. Leave the key out and every server is off. Run opencode --version to see which one you have.

OpenCode 2: the lsp key is kept, and nothing runs

OpenCode’s migration guide from version 1 says it in one sentence:

V2 accepts and preserves lsp configuration, but it does not run language servers, expose LSP tools, or produce LSP diagnostics.
Copied

So a version 1 config with "lsp": true, or a block of custom servers, is still read on version 2 and has no effect. The signs on a running version 2: the built-in tools (read, glob, grep, edit, write, patch, shell and the rest) include nothing for definitions, references or diagnostics, and an edit comes back without any error list. OpenCode’s issue triage also reports that the version 2 sidebar has no LSP section at all, where version 1’s says “LSPs are disabled” or “LSPs will activate as files are read”. The 2.4.0 source has no language-server code in its core package.

The work to bring it back is #38528, “V2: port LSP and formatter services”, open since July 23, 2026. A user’s question there in October, whether the port was actively being worked on, had no answer by November 23. Reports of servers that never start on 2.0.32, 2.2.6 and 2.2.7 have all been closed into it, and a maintainer closing “LSP support gutted from v2?” wrote: “we’re tracking its return there.” Search results may still show OpenCode’s LSP page with the full server list; that page, at both opencode.ai/docs/lsp and opencode.ai/v2/docs/lsp, is the version 1 page, and says so in its first line.

What to do instead on version 2

The migration guide’s advice is to replace LSP-dependent workflows “with the project’s lint, typecheck, or compiler commands”. The agent runs those through its shell tool, as long as it knows to. OpenCode 2 reads AGENTS.md from the project folder and its parents, and ~/.config/opencode/AGENTS.md for every project, so the commands go there. Use the scripts your project already has:

## Checks
After editing code, run `npm run lint` and `npm run typecheck`
and fix every error they report before saying the task is done.
Copied

The compiler and linter report the errors a language server would have flagged, at the point the agent checks rather than after every edit, and this is what OpenCode’s own version 1 documentation recommends for many projects anyway (below). A skill or a custom agent with its own instructions works too, where the checks differ by task.

Formatters do run on version 2, after the write, edit and patch tools change a file, and like LSP they are off until "formatter": true (or an object of overrides) is in the config. Built-ins include gofmt, rustfmt, ruff and prettier, each used only when its command or dependency is present. They change the file; they report no errors to the agent.

Staying on version 1 for its language servers is possible, at a price: OpenCode’s pinned thread says “v1 no longer supports free models and only gets fixes for critical bugs.” What else changes between the two is in upgrading OpenCode 1 to 2.

OpenCode 1: what LSP does

On version 1, a language server’s job is feedback after edits. When the agent edits a file, OpenCode opens it in the matching server, waits for diagnostics, and, if there are errors, appends them to what the edit tool returns, under the line LSP errors detected in this file, please fix:. Only errors are passed on, not warnings or hints, and at most 20 per file, followed by ... and N more. The agent reads that as part of the edit’s result, with the request to fix them.

It is off by default. The version 1 LSP page says “If lsp is omitted, all LSP servers are disabled”, and a maintainer, closing a pull request to change that in April 2026, wrote “LSP is intentionally disabled by default.” Users in the issue that followed report that earlier releases started servers with no config, which is why a setup that once showed diagnostics can go quiet after an update with the config unchanged.

Turning it on, off, or per server

The setting goes in ~/.config/opencode/opencode.json for every project, or opencode.json in a project’s root for that project (precedence is in OpenCode’s config guide):

ValueEffect on version 1
key absent
All servers off
"lsp": true
Every built-in server on
"lsp": {} or an object of entries
Every built-in on, with the entries as overrides or extra servers
"lsp": false
All off

Each entry takes disabled, command (an array), extensions, env and initialization (settings sent in the LSP initialize request, which differ by server). An entry needs command unless all it does is disable a server. All built-ins except TypeScript, plus a custom server and an environment variable for rust-analyzer:

{
  "$schema": "https://opencode.ai/config.json",
  "lsp": {
    "typescript": {
      "disabled": true
    },
    "rust": {
      "command": ["rust-analyzer"],
      "env": {
        "RUST_LOG": "debug"
      }
    },
    "custom-lsp": {
      "command": ["custom-lsp-server", "--stdio"],
      "extensions": [".custom"]
    }
  }
}
Copied

An entry whose name matches a built-in is merged over it, so extensions can be left out there; a new name is a new server, rooted at the project folder.

The built-in servers and what each needs

A server starts when a file with one of its extensions is opened and its requirement is met. “Auto-installs” means OpenCode downloads it itself; the others must already be on the machine. From the version 1 docs, as of November 23, 2026:

ServerExtensionsRequirement
astro
.astroAuto-installs for Astro projects
bash
.sh .bash .zsh .kshAuto-installs bash-language-server
clangd
.c .cpp .cc .cxx .c++ .h .hpp .hh .hxx .h++Auto-installs for C/C++ projects
csharp
.cs .csx.NET SDK installed
clojure-lsp
.clj .cljs .cljc .ednclojure-lsp command
dart
.dartdart command
deno
.ts .tsx .js .jsx .mjsdeno command (detects deno.json/deno.jsonc)
elixir-ls
.ex .exselixir command
eslint
.ts .tsx .js .jsx .mjs .cjs .mts .cts .vueeslint dependency in the project
fsharp
.fs .fsi .fsx .fsscript.NET SDK installed
gleam
.gleamgleam command
gopls
.gogo command
hls
.hs .lhshaskell-language-server-wrapper command
jdtls
.javaJava SDK 21 or later
julials
.jljulia and LanguageServer.jl
kotlin-ls
.kt .ktsAuto-installs for Kotlin projects
lua-ls
.luaAuto-installs for Lua projects
nixd
.nixnixd command
ocaml-lsp
.ml .mliocamllsp command
oxlint
.ts .tsx .js .jsx .mjs .cjs .mts .cts .vue .astro .svelteoxlint dependency in the project
php intelephense
.phpAuto-installs for PHP projects
prisma
.prismaprisma command
pyright
.py .pyipyright dependency installed
razor
.razor .cshtml.NET SDK and the VS Code C# extension
ruby-lsp (rubocop)
.rb .rake .gemspec .ruruby and gem commands
rust
.rsrust-analyzer command
sourcekit-lsp
.swift .objc .objcppswift (Xcode on macOS)
svelte
.svelteAuto-installs for Svelte projects
terraform
.tf .tfvarsAuto-installs from GitHub releases
tinymist
.typ .typcAuto-installs from GitHub releases
typescript
.ts .tsx .js .jsx .mjs .cjs .mts .ctstypescript dependency in the project
vue
.vueAuto-installs for Vue projects
yaml-ls
.yaml .ymlAuto-installs Red Hat yaml-language-server
zls
.zig .zonzig command

The names in the first column are the keys to use in the lsp block. A few details from the 1.19.6 source: with go on the PATH and no gopls, OpenCode runs go install golang.org/x/tools/gopls@latest itself; rust-analyzer is only ever looked up on the PATH, never downloaded; and the TypeScript server needs the typescript package to resolve from the project, so a folder without node_modules gets no TypeScript diagnostics.

Setting the environment variable OPENCODE_DISABLE_LSP_DOWNLOAD=true stops every automatic download, for a machine with no internet or a policy against fetched binaries; the servers you installed yourself still run. For Python, OPENCODE_EXPERIMENTAL_LSP_TY=true uses ty instead of pyright, which it replaces; ty is never downloaded, so it must be on the PATH or in the project’s virtual environment. PHP Intelephense reads a premium license key from $HOME/intelephense/license.txt (the key alone in the file).

The experimental lsp tool

Diagnostics are the only thing a server does for the agent by default. Version 1 also has an LSP tool the agent can call itself, for goToDefinition, findReferences, hover, documentSymbol, workspaceSymbol, goToImplementation and the call hierarchy. It exists only when OpenCode is started with OPENCODE_EXPERIMENTAL_LSP_TOOL=true (or OPENCODE_EXPERIMENTAL=true), works through the servers configured under the lsp key, and is allowed under permission:

OPENCODE_EXPERIMENTAL_LSP_TOOL=true opencode

# opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "lsp": true,
  "permission": {
    "lsp": "allow"
  }
}
Copied

Why no diagnostics appear

To see what a server reports outside a conversation, version 1 has opencode debug lsp diagnostics <file>, which opens the file in its servers, waits up to ten seconds for their diagnostics, and prints whatever has arrived as JSON. A server still analysing a large project when that time runs out is not reported as an error, so an empty result does not by itself prove the file is clean.

When a language server makes things worse

OpenCode’s own version 1 page says LSP “is not always a net positive”: servers “can get out of sync, use significant memory, vary by version or project, and slow down agent workflows”, and for many projects it suggests having the agent run the lint and typecheck tools directly, written down in AGENTS.md, which is the same arrangement version 2 leaves you with. One reported extreme: #54280, where the Lua server returned diagnostics for a whole workspace of thousands of files, the session grew past 1 GB and each message took minutes at full CPU. It was closed without a fix. On a small server with a few GB of memory, the same trade-off argues for an object that disables the servers you do not need by name, rather than everything at once with true.

Run OpenCode on an always-on developer pod.

A developer pod is a permanent cloud computer (VPS), set up and secured for you, with your pick of Claude Code, Codex, OpenCode, Pi, Hermes and OpenClaw installed. Run more agents at once than your laptop can hold, and keep them working when it’s closed. From $24 a month, built in about ten minutes.