How it works
The short version
claude-lsp-plugins (a marketplace: one git repo)
|
.claude-plugin/marketplace.json lists 5 plugins
|
plugins/<name>/.claude-plugin/plugin.json
{ "lspServers": { "<server>": {
"command": "yaml-language-server",
"args": ["--stdio"],
"extensionToLanguage": { ".yaml": "yaml" } } } }
|
Claude Code --starts--> language server (stdio, JSON-RPC)
^ |
|-- diagnostics, hover, symbols
Claude Code reads the plugin, sees that .yaml files belong to yaml-language-server, and starts that program the first time it touches a matching file. It speaks the Language Server Protocol to it over standard input and output.
The pieces
1. The marketplace
.claude-plugin/marketplace.json is a list of plugins. Each entry has a name, a short description and a relative source path:
{
"name": "claude-lsp-plugins",
"owner": {"name": "Andrew Cates"},
"plugins": [
{"name": "bash-lsp", "source": "./plugins/bash-lsp", "description": "..."}
]
}
2. The plugin
Each plugin is a single manifest, with the server configuration inline under lspServers. A server config needs two things:
| Field | Meaning |
|---|---|
command | The program to launch. It must be on PATH. |
extensionToLanguage | Maps a file extension to the LSP language ID the server expects. |
args is optional. The plugins here use it for --stdio (and start and serve for the two servers that want a subcommand).
3. The language server
The server is an ordinary program you install yourself. The plugin never downloads or wraps it. That keeps the supply chain short: the code that runs is the upstream project's, at the version you chose.
What happens when Claude edits a file
- Claude edits
deploy.yml. - Claude Code looks up
.ymland findsyaml-language-server. It starts the server if it is not running yet. - It sends the document to the server (
textDocument/didOpenanddidChange). - The server answers with diagnostics (
textDocument/publishDiagnostics). - Claude Code puts those diagnostics in front of Claude, which fixes them in the next step.
Some servers publish more than once. terraform-ls sends an empty list first and the real errors a moment later.
One plugin, two servers
css-html-lsp registers two servers because lspServers is a map keyed by name:
"lspServers": {
"vscode-css-language-server": { "command": "vscode-css-language-server", "args": ["--stdio"], "extensionToLanguage": {".css": "css", ".scss": "scss", ".less": "less"} },
"vscode-html-language-server": { "command": "vscode-html-language-server", "args": ["--stdio"], "extensionToLanguage": {".html": "html", ".htm": "html"} }
}
Server keys are named after their binaries, so splitting a plugin later only means moving keys between files.
Design choices
- Minimal. Five manifests. No code, no wrappers, no installer.
- Real servers. Nothing reimplements a language server.
- One source of truth. Server settings live only in
plugin.json, not duplicated in the marketplace entry. - Verified. Each server command and language ID was checked by running the server and getting diagnostics back.