lsp-mcp-server
v1.1.28MCP 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.
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line 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.
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line 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.
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line number (1-indexed) |
include_declaration | boolean | Whether to include the declaration in results |
limit | number | Maximum number of results to return |
offset | number | Number 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.
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line number (1-indexed) |
limit | number | Maximum 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.
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line 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.
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line 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.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Absolute 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.
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query to match symbol names (supports fuzzy matching) |
kinds | array | Filter results to specific symbol kinds (e.g., "Class", "Function", "Variable") |
limit | number | Maximum 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.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Absolute path to the source file |
include_signatures | boolean | Include 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.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Absolute 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.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Absolute path to the source file |
severity_filter | string | Filter 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.
| Parameter | Type | Description |
|---|---|---|
group_by | string | How to group/sort results |
limit | number | Maximum number of diagnostics to return |
severity_filter | string | Filter 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.
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line number (1-indexed) |
limit | number | Maximum 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.
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line number (1-indexed) |
new_name * | string | New name for the symbol |
dry_run | boolean | If 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.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Absolute path to the source file |
start_column * | number | Start column number (1-indexed) |
start_line * | number | Start line number (1-indexed) |
action_index | number | Index of the action to apply (when apply=true). Defaults to 0 (first action). |
apply | boolean | If true, apply the first available action. If false, just list available actions. |
end_column | number | End column number (1-indexed). Defaults to start column. |
end_line | number | End line number (1-indexed). Defaults to start line. |
kinds | array | Filter 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.
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line number (1-indexed) |
direction | string | Direction 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.
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line number (1-indexed) |
direction | string | Direction 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.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Absolute path to the source file to format |
apply | boolean | If true, apply formatting changes to file. If false, return edits without applying. |
insert_spaces | boolean | Use spaces instead of tabs (default: true) |
tab_size | number | Number of spaces per tab (default: 2) |
lsp_smart_search
Get comprehensive information about a symbol in one call: type signature, definition location, all references, implementations, and call hierarchy. Use when you need full context about something instead of making multiple separate queries.
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line number (1-indexed) |
include | array | Which information to include in results |
references_limit | number | Maximum number of references/implementations to return |
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.
| Parameter | Type | Description |
|---|---|---|
name * | string | Symbol name to search for (supports fuzzy matching) |
include | array | What information to include for the found symbol |
kind | string | Filter to specific symbol kind |
references_limit | number | Maximum 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.
| Parameter | Type | Description |
|---|---|---|
server_id | string | Specific 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.
| Parameter | Type | Description |
|---|---|---|
server_id * | string | Server ID from configuration (e.g., 'typescript', 'python') |
workspace_root * | string | Absolute 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.
| Parameter | Type | Description |
|---|---|---|
server_id * | string | Server ID from configuration (e.g., 'typescript', 'python') |
workspace_root | string | Workspace 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).
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line 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.
| Parameter | Type | Description |
|---|---|---|
end_column * | number | End column (1-indexed) |
end_line * | number | End line (1-indexed) |
file_path * | string | Absolute path to the source file |
start_column * | number | Start column (1-indexed) |
start_line * | number | Start line (1-indexed) |
limit | number | Maximum 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").
| Parameter | Type | Description |
|---|---|---|
column * | number | Column number (1-indexed) |
file_path * | string | Absolute path to the source file |
line * | number | Line 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.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Absolute path to the source file |
kind_filter | string | Filter 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.
| Parameter | Type | Description |
|---|---|---|
files * | array | List of absolute file paths to open |