Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By EmileBrunellev1.0.0ISCIn 1 marketplace
OCaml language server (ocaml-lsp-server) for code intelligence
Language servers for diagnostics and code navigation.
OCaml language server for Claude Code, providing code intelligence and analysis.
Wraps ocaml-lsp-server (the ocamllsp
binary), the language server behind the OCaml Platform editor extensions.
It reads its per-file configuration from Dune, so the project must build.
.ml, .mli
Other syntaxes ocamllsp accepts (.mll, .mly, .t, .re/.rei,
.mlx, .eliom) are deliberately not declared: the server takes the
documents but returns no symbols or types for them, so there is nothing for
Claude to read.
ocamllsp is not bundled with the compiler, and it is not in any system
package manager worth using (see below). opam is the route:
opam install ocaml-lsp-server
eval $(opam env) # required: the binary lives in the switch
Install it into the switch you are working in, not once and globally: the server has to match the compiler that built the project.
Homebrew has no ocaml-lsp formula — it packages ocaml and opam only. So
Homebrew gets you opam, and opam gets you the server:
brew install opam
opam init && opam install ocaml-lsp-server
nix-shell -p ocamlPackages.ocaml-lsp
Nixpkgs pins a different ocaml-lsp version per compiler, the same way opam
resolves a different one per switch.
Untested — treat this as an open question, not a claim. opam has had native
Windows support since 2.2, so ocamllsp.exe can be on PATH; what has not
been verified here is whether the bare ocamllsp command in the manifest
resolves to it. WSL2 is the route that certainly works, since it is Linux.
Reports either way are welcome.
Checked 2026-09-10, so that nobody burns an afternoon on it:
| Homebrew | no ocaml-lsp or ocaml-lsp-server formula |
| Debian / Ubuntu | no apt package (searched trixie) |
| Fedora | no dnf package |
| Arch | not in the official repos; AUR has only ocaml-lsp-git, an unversioned git snapshot with no votes |
claude from a shell where eval $(opam env) has run. The
binary sits in ~/.opam/<switch>/bin, which is not on the default PATH;
without it the server never starts. This is the same failure mode as OCaml
autocompletion dying in VS Code.ocamllsp gets its include paths and flags from
dune ocaml-merlin, so types and diagnostics on a project that does not
compile are partial at best. Run dune build first.Every row was checked by driving the server over stdio: initialize, then
didOpen + documentSymbol + hover on a .ml and a .mli in a built Dune
project. A row is OK only if both files return symbols and a type.
| OCaml | ocaml-lsp-server | Capabilities | .ml | .mli | Where |
|---|---|---|---|---|---|
| 4.14.4 | 1.21.0-4.14 | 22 | OK | OK | Fedora host + Debian container |
| 5.1.1 | 1.18.0 | 22 | OK | OK | Debian container |
| 5.2.1 | 1.21.0 | 22 | OK | OK | Debian container |
| 5.3.0 | 1.23.1 | 22 | OK | OK | Fedora host + Debian container |
| 5.4.1 | 1.26.0 | 23 | OK | OK | Fedora host + Debian container |
| 5.5.1 | 1.27.0 | 23 | OK | OK | Fedora host |
hoverProvider, definitionProvider and publishDiagnostics are present in
every row. The plugin pins no version — it runs whatever ocamllsp the switch
provides — so the oldest row is what matters: ocaml.interface is already
accepted by 1.18.0, nine releases before the version this was written against.
Every row is Linux. Host rows: Fedora 44, dune 3.24.2, opam 2.5.2. Container rows: official
ocaml/opam:debian-ocaml-* images, whose pinned opam snapshot is what selects
each ocaml-lsp-server version. Re-run the matrix yourself with
test/matrix.sh — it uses the official ocaml/opam
container images and leaves your switches alone.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub emilebrunelle/claude-ocaml-lsp --plugin ocaml-lspPlugins from other owners that cover similar ground