@@ -46,11 +46,28 @@ lsmcp provides multi-language support through Language Server Protocol (LSP) int
4646###Basic Usage
4747
4848``` bash
49- # Basic pattern: Specify LSP server with --bin
49+ # Using presets for common languages
50+ claude mcp add typescript npx -- -y @mizchi/lsmcp -p typescript
51+
52+ # Custom LSP server with --bin
5053claude mcp add< server-name> npx -- -y @mizchi/lsmcp --bin=" <lsp-command>"
51- claude mcp add typescript npx -- -y @mizchi/lsmcp --language=typescript
5254```
5355
56+ ###Available Presets
57+
58+ lsmcp includes built-in presets for popular language servers:
59+
60+ - ** ` typescript ` ** - TypeScript/JavaScript (typescript-language-server)
61+ - ** ` tsgo ` ** - TypeScript/JavaScript (tsgo - faster alternative)
62+ - ** ` deno ` ** - Deno TypeScript/JavaScript
63+ - ** ` pyright ` ** - Python (Microsoft Pyright)
64+ - ** ` ruff ` ** - Python (Ruff linter as LSP)
65+ - ** ` rust-analyzer ` ** - Rust
66+ - ** ` fsharp ` ** - F# (fsautocomplete)
67+ - ** ` moonbit-language-server ` ** - MoonBit
68+
69+ For languages not in this list, or to customize LSP server settings, see[ Manual Setup] ( #manual-setup ) .
70+
5471###Language-Specific Setup
5572
5673####TypeScript
@@ -62,11 +79,11 @@ claude mcp add typescript npx -- -y @mizchi/lsmcp --language=typescript
6279# with typeScript-language-server (stable)
6380npm add -D typescript typescript-language-server
6481# Recommended: use tsgo for full functionality
65- claude mcp add typescript npx -- -y @mizchi/lsmcp --language= typescript --bin=" npx tsgo --lsp --stdio"
82+ claude mcp add typescript npx -- -y @mizchi/lsmcp -p typescript --bin=" npx tsgo --lsp --stdio"
6683
6784# with @typescript/native-preview (experimental, fast)
6885npm add -D @typescript/native-preview
69- claude mcp add typescript npx -- -y @mizchi/lsmcp --language=typescirpt --bin=" npx tsgo"
86+ claude mcp add typescript npx -- -y @mizchi/lsmcp -p typescript --bin=" npx tsgo"
7087```
7188
7289Manual Configuration (.mcp.json)
@@ -79,7 +96,7 @@ Manual Configuration (.mcp.json)
7996"args" : [
8097" -y" ,
8198" @mizchi/lsmcp" ,
82- " --language " ,
99+ " -p " ,
83100" typescript" ,
84101" --bin" ,
85102" npx tsgo --lsp --stdio"
@@ -98,7 +115,7 @@ Manual Configuration (.mcp.json)
98115
99116``` bash
100117rustup component add rust-analyzer
101- claude mcp add rust npx -- -y @mizchi/lsmcp --bin= " rust-analyzer"
118+ claude mcp add rust npx -- -y @mizchi/lsmcp -p rust-analyzer
102119```
103120
104121Manual Configuration (.mcp.json)
@@ -108,7 +125,7 @@ Manual Configuration (.mcp.json)
108125"mcpServers" : {
109126"rust" : {
110127"command" :" npx" ,
111- "args" : [" -y" ," @mizchi/lsmcp" ," --bin " ," rust-analyzer" ]
128+ "args" : [" -y" ," @mizchi/lsmcp" ," -p " ," rust-analyzer" ]
112129 }
113130 }
114131}
@@ -125,7 +142,7 @@ See [examples/rust-project/](examples/rust-project/) for a complete example.
125142
126143``` bash
127144dotnet tool install -g fsautocomplete
128- claude mcp add fsharp npx -- -y @mizchi/lsmcp --language= fsharp --bin=" fsautocomplete --adaptive-lsp-server-enabled"
145+ claude mcp add fsharp npx -- -y @mizchi/lsmcp -p fsharp --bin=" fsautocomplete --adaptive-lsp-server-enabled"
129146```
130147
131148Manual Configuration (.mcp.json)
@@ -138,7 +155,7 @@ Manual Configuration (.mcp.json)
138155"args" : [
139156" -y" ,
140157" @mizchi/lsmcp" ,
141- " --language " ,
158+ " -p " ,
142159" fsharp" ,
143160" --bin" ,
144161" fsautocomplete"
@@ -158,6 +175,11 @@ See [examples/fsharp-project/](examples/fsharp-project/) for a complete example.
158175<summary >Python Setup</summary >
159176
160177``` bash
178+ # Option 1: Using Pyright (recommended)
179+ npm install -g pyright
180+ claude mcp add python npx -- -y @mizchi/lsmcp -p pyright
181+
182+ # Option 2: Using python-lsp-server
161183pip install python-lsp-server
162184claude mcp add python npx -- -y @mizchi/lsmcp --bin=" pylsp"
163185```
@@ -169,7 +191,7 @@ Manual Configuration (.mcp.json)
169191"mcpServers" : {
170192"python" : {
171193"command" :" npx" ,
172- "args" : [" -y" ," @mizchi/lsmcp" ," --bin " ," pylsp " ]
194+ "args" : [" -y" ," @mizchi/lsmcp" ," -p " ," pyright " ]
173195 }
174196 }
175197}
@@ -190,17 +212,141 @@ lsmcp supports any language with an LSP server. Here are some common configurati
190212# Go
191213go install golang.org/x/tools/gopls@latest
192214claude mcp add go npx -- -y @mizchi/lsmcp --bin=" gopls"
215+
216+ # C/C++
217+ # Install clangd from your package manager or LLVM releases
218+ claude mcp add cpp npx -- -y @mizchi/lsmcp --bin=" clangd"
219+
220+ # Java
221+ # Install jdtls (Eclipse JDT Language Server)
222+ claude mcp add java npx -- -y @mizchi/lsmcp --bin=" jdtls"
193223```
194224
225+ For more customization options, see[ Manual Setup] ( #manual-setup ) .
226+
195227</details >
196228
229+ ##Manual Setup
230+
231+ For advanced users who want more control over LSP server configuration, you can set up lsmcp manually with custom settings.
232+
233+ ###Minimal rust-analyzer Example
234+
235+ ``` json
236+ {
237+ "mcpServers" : {
238+ "rust-minimal" : {
239+ "command" :" npx" ,
240+ "args" : [
241+ " -y" ,
242+ " @mizchi/lsmcp" ,
243+ " --bin" ,
244+ " rust-analyzer"
245+ ],
246+ "env" : {
247+ "RUST_ANALYZER_CONFIG" :" {\" assist\" :{\" importGranularity\" :\" module\" },\" cargo\" :{\" allFeatures\" :true}}"
248+ }
249+ }
250+ }
251+ }
252+ ```
253+
254+ ###Custom Language Server Setup
255+
256+ You can configure any LSP server by providing the binary path and optional initialization options:
257+
258+ ``` json
259+ {
260+ "mcpServers" : {
261+ "custom-lsp" : {
262+ "command" :" npx" ,
263+ "args" : [
264+ " -y" ,
265+ " @mizchi/lsmcp" ,
266+ " --bin" ,
267+ " /path/to/your/lsp-server" ,
268+ " --initializationOptions" ,
269+ " {\" customOption\" :\" value\" }"
270+ ]
271+ }
272+ }
273+ }
274+ ```
275+
276+ ###Using Configuration Files
277+
278+ For complex LSP server configurations, you can use the` --config ` option to load settings from a JSON file:
279+
280+ 1 . Create a configuration file (e.g.,` my-language.json ` ):
281+
282+ ``` json
283+ {
284+ "id" :" my-language" ,
285+ "name" :" My Custom Language" ,
286+ "bin" :" my-language-server" ,
287+ "args" : [" --stdio" ],
288+ "initializationOptions" : {
289+ "formatOnSave" :true ,
290+ "lintingEnabled" :true ,
291+ "customFeatures" : {
292+ "autoImport" :true
293+ }
294+ }
295+ }
296+ ```
297+
298+ 2 . Use it with lsmcp:
299+
300+ ``` bash
301+ # Using Claude CLI
302+ claude mcp add my-language npx -- -y @mizchi/lsmcp --config ./my-language.json
303+
304+ # Or in .mcp.json
305+ {
306+ " mcpServers" : {
307+ " my-language" : {
308+ " command" :" npx" ,
309+ " args" : [" -y" ," @mizchi/lsmcp" ," --config" ," ./my-language.json" ]
310+ }
311+ }
312+ }
313+ ```
314+
315+ This approach is useful when:
316+ - You have complex initialization options
317+ - You want to share configurations across projects
318+ - You need to version control your LSP settings
319+
320+ ###Environment Variables
321+
322+ Some LSP servers can be configured via environment variables:
323+
324+ ``` json
325+ {
326+ "mcpServers" : {
327+ "configured-lsp" : {
328+ "command" :" npx" ,
329+ "args" : [" -y" ," @mizchi/lsmcp" ," --bin" ," lsp-server" ],
330+ "env" : {
331+ "LSP_LOG_LEVEL" :" debug" ,
332+ "LSP_WORKSPACE" :" /path/to/workspace"
333+ }
334+ }
335+ }
336+ }
337+ ```
338+
197339##MCP Usage
198340
199341###Command Line Options
200342
201343``` bash
202- # TypeScript/JavaScript (built-in support)
203- npx @mizchi/lsmcp --language< language> --bin' ...'
344+ # Using language presets
345+ npx @mizchi/lsmcp -p< preset> --bin' ...'
346+ npx @mizchi/lsmcp --preset< preset> --bin' ...'
347+
348+ # Custom LSP server
349+ npx @mizchi/lsmcp --bin' <lsp-command>'
204350```
205351
206352##Development