lsp-mcp-server

v1.1.28
lsp-mcp-server Checked 6 hours ago Published 6 days ago

MCP server bridging Codex, Claude Code, and other MCP clients to Language Server Protocol servers

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

lsp_goto_definition

Find where a function, class, or variable is defined. More accurate than grep—handles aliases, re-exports, and overloads correctly. Returns file path, line, and column of the definition.

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)

lsp_goto_type_definition

Find the type that defines a variable, parameter, or return value. Use when you have a variable and want to see its interface/class definition, not where the variable itself is declared.

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)

lsp_find_references

Find every usage of a symbol across the codebase. Use before renaming or deleting to understand impact. More complete than grep—finds semantic matches, not just text.

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)
include_declarationbooleanWhether to include the declaration in results
limitnumberMaximum number of results to return
offsetnumberNumber of results to skip (for pagination)

lsp_find_implementations

Find all concrete implementations of an interface, abstract class, or abstract method. Use to understand how an abstraction is actually used in practice.

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)
limitnumberMaximum number of results

lsp_hover

Get the type signature and documentation for any symbol. Use to understand what a function accepts/returns or what type a variable has, without reading its implementation.

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)

lsp_signature_help

Get parameter hints for a function call. Use when you need to know what arguments a function expects and their types, especially for overloaded functions.

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)

lsp_document_symbols

Get a structured outline of a file: all functions, classes, interfaces, and variables with their types and relationships. Faster and more accurate than reading and parsing the file yourself.

ParameterTypeDescription
file_path *stringAbsolute path to the source file

lsp_workspace_symbols

Find any function, class, interface, or type by name—no file path needed. Start here when exploring a codebase or locating where something is defined. Supports fuzzy matching.

ParameterTypeDescription
query *stringSearch query to match symbol names (supports fuzzy matching)
kindsarrayFilter results to specific symbol kinds (e.g., "Class", "Function", "Variable")
limitnumberMaximum number of results

lsp_file_exports

Get the public API surface of a file: top-level functions, classes, interfaces, and variables with their type signatures. Use to understand what a module exposes without reading the entire file.

ParameterTypeDescription
file_path *stringAbsolute path to the source file
include_signaturesbooleanInclude type signatures (slower but more informative)

lsp_file_imports

Get all imports/dependencies of a file. Shows what modules this file depends on, including ES modules, CommonJS require(), and dynamic imports. Use to understand file dependencies.

ParameterTypeDescription
file_path *stringAbsolute path to the source file

lsp_diagnostics

Get compiler errors, warnings, and hints for a file. Use after making changes to check for type errors, missing imports, or other issues. Diagnostics come from the language server, published or, for servers such as TypeScript 7, requested.

ParameterTypeDescription
file_path *stringAbsolute path to the source file
severity_filterstringFilter diagnostics by minimum severity

lsp_workspace_diagnostics

Get all errors and warnings across the entire project—no file path needed. Use during initial analysis to find problems or after changes to check overall project health. Only includes files opened in this session.

ParameterTypeDescription
group_bystringHow to group/sort results
limitnumberMaximum number of diagnostics to return
severity_filterstringFilter diagnostics by minimum severity

lsp_completions

Get intelligent code completion suggestions at a position. Returns available methods, properties, variables, and types that are valid in that context. More accurate than text-based completion.

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)
limitnumberMaximum number of suggestions

lsp_rename

Rename a symbol across the entire codebase safely. Handles all references, imports, and re-exports. Use dry_run=true (default) to preview changes before applying. More reliable than find-and-replace.

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)
new_name *stringNew name for the symbol
dry_runbooleanIf true, only preview changes without applying. If false, apply changes to files.

lsp_code_actions

Get quick fixes and refactoring suggestions at a position. Use to auto-fix errors, organize imports, extract functions, or apply other automated transformations. Set apply=true to execute an action.

ParameterTypeDescription
file_path *stringAbsolute path to the source file
start_column *numberStart column number (1-indexed)
start_line *numberStart line number (1-indexed)
action_indexnumberIndex of the action to apply (when apply=true). Defaults to 0 (first action).
applybooleanIf true, apply the first available action. If false, just list available actions.
end_columnnumberEnd column number (1-indexed). Defaults to start column.
end_linenumberEnd line number (1-indexed). Defaults to start line.
kindsarrayFilter by code action kinds: quickfix, refactor, refactor.extract, refactor.inline, refactor.rewrite, source, source.organizeImports, source.fixAll

lsp_call_hierarchy

Trace function calls: who calls this function (incoming) and what it calls (outgoing). Essential for understanding code flow and assessing impact before modifying a function.

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)
directionstringDirection of call hierarchy: incoming (callers), outgoing (callees), or both

lsp_type_hierarchy

Explore inheritance: find parent classes/interfaces (supertypes) and child classes/implementations (subtypes). Use to understand class relationships before modifying a base class or interface.

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)
directionstringDirection of type hierarchy: supertypes (parents), subtypes (children), or both

lsp_format_document

Format a file according to project style settings (prettier, eslint, etc.). Use after making edits to ensure consistent formatting. Set apply=true to write changes.

ParameterTypeDescription
file_path *stringAbsolute path to the source file to format
applybooleanIf true, apply formatting changes to file. If false, return edits without applying.
insert_spacesbooleanUse spaces instead of tabs (default: true)
tab_sizenumberNumber of spaces per tab (default: 2)

lsp_find_symbol

Find a symbol by name alone—no file path or position needed. Returns the definition location plus full context (type info, references, call hierarchy). Use when you know a symbol name but not where it is defined.

ParameterTypeDescription
name *stringSymbol name to search for (supports fuzzy matching)
includearrayWhat information to include for the found symbol
kindstringFilter to specific symbol kind
references_limitnumberMaximum number of references to include

lsp_server_status

Check which language servers are running and their state. Use to verify LSP is available before analysis or to debug connection issues.

ParameterTypeDescription
server_idstringSpecific server ID to check, or omit for all servers

lsp_start_server

Start a language server manually for a workspace. Usually not needed—servers auto-start when you use other LSP tools. Use only when you need explicit control over server lifecycle.

ParameterTypeDescription
server_id *stringServer ID from configuration (e.g., 'typescript', 'python')
workspace_root *stringAbsolute path to the workspace/project root

lsp_stop_server

Stop a running language server to free resources. Servers auto-stop after idle timeout, so manual stop is rarely needed.

ParameterTypeDescription
server_id *stringServer ID from configuration (e.g., 'typescript', 'python')
workspace_rootstringWorkspace root to stop server for. If omitted, stops all instances of this server type.

lsp_document_highlights

Find all occurrences of the symbol at a position within the same file, classified as text/read/write. Faster and more local than lsp_find_references when you only care about one file (e.g., quick local rename preview or read-vs-write analysis).

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)

lsp_inlay_hints

Get inferred type annotations and parameter-name hints for a range of code. Reveals variable types, return types, and named-parameter mappings without one hover per identifier. Ideal for understanding heavily inferred code (TypeScript const/let, Rust let, etc.) at scale.

ParameterTypeDescription
end_column *numberEnd column (1-indexed)
end_line *numberEnd line (1-indexed)
file_path *stringAbsolute path to the source file
start_column *numberStart column (1-indexed)
start_line *numberStart line (1-indexed)
limitnumberMaximum hints to return

lsp_selection_range

Get the chain of semantic ranges enclosing a position — the expression, then its statement, then its block, up to the file. Use to pick the right range for lsp_code_actions (e.g., "extract this expression vs the whole statement").

ParameterTypeDescription
column *numberColumn number (1-indexed)
file_path *stringAbsolute path to the source file
line *numberLine number (1-indexed)

lsp_folding_ranges

Get the foldable regions of a file (functions, classes, blocks, imports, comments). Use as a quick structural overview before reading specific sections.

ParameterTypeDescription
file_path *stringAbsolute path to the source file
kind_filterstringFilter results to one kind of fold

lsp_index_files

Open a batch of files so language servers begin publishing diagnostics for them. Required warm-up before lsp_workspace_diagnostics (which only sees opened files) and before lsp_related_files imported_by. Use a small targeted set rather than the whole workspace.

ParameterTypeDescription
files *arrayList of absolute file paths to open