How to get LSP diagnostics and completion in Gemini CLI?
Gemini CLI (google-gemini/gemini-cli) has no native Language Server Protocol support, and when writing TypeScript the model sometimes tries to use variables or object properties that do not exist. Is there a way to get LSP diagnostics, completion, and symbol information through an MCP server, and what is the official status of native LSP support?
Originally asked on GitHub: https://github.com/google-gemini/gemini-cli/issues/2465
6 answers
Native LSP support in Gemini CLI is not implemented. The issue was closed, and a maintainer said in May 2026 that the team has no immediate plans to address it, so today you need an external LSP bridge.
The approach suggested in the thread is the Serena MCP server, which exposes LSP-style functions. To set it up: in
<project>/.serena/project.ymladdincluded_optional_tools: ["initial_instructions"], then ask Gemini CLI: "Read the initial instructions of serena MCP." The thread does not contain a confirmed report that this makes LSP features work. One user said they are using it but that it adds noticeable token overhead at the start of every session and that Gemini keeps re-reading files it has already read.Other community options mentioned: a contributor's local experimental branch at https://github.com/genneth/gemini-cli/tree/feat/lsp-integration-v2 (opens external site), and the codeTree MCP tool at https://github.com/ThinkyMiner/codeTree (opens external site). Neither has a maintainer endorsement or verification in the thread.
General advice: until native LSP support exists, keep relevant type definitions in context or use explicit search tools when working in larger TypeScript projects.
Did this work for you?What @njam tried on GitHub (Outcome unclear)
Suggested using the Serena MCP server and adding
included_optional_tools: ["initial_instructions"]to<project>/.serena/project.yml, then asking Gemini to read Serena's initial instructions.Did this work for you?What @ramAdam tried on GitHub (Outcome unclear)
A user reported currently using it and noted that it adds significant token overhead at the beginning of every session and that Gemini keeps re-reading files it has already read.
Did this work for you?What @genneth tried on GitHub (Outcome unclear)
A contributor asked maintainers whether standalone LSP support would be accepted and proposed a phased design: implicit symbol/diagnostic enrichment, an explicit lsp_query tool, and diagnostic diffs on writes.
Did this work for you?What @genneth tried on GitHub (Outcome unclear)
A contributor shared their local experimental branch at https://github.com/genneth/gemini-cli/tree/feat/lsp-integration-v2 (opens external site) with LSP integration work.
Did this work for you?What @Kevinrob tried on GitHub (Outcome unclear)
A commenter linked the codeTree MCP tool at https://github.com/ThinkyMiner/codeTree (opens external site) as a possible helper for Gemini CLI.
Did this work for you?
Related questions
- gemini-cli 400: "only 'enum' and 'date-time' are supported for STRING type"
- Gemini CLI: API Error 'Model stream ended with an invalid chunk or missing finish reason' after ReadFile or Edit tool calls
- gemini-cli stuck on "This is taking a bit longer" after Esc cancel — is there a fix?
- Is there a way to get codebase indexing in gemini-cli?
- How can I use voice input instead of typing with Gemini CLI?