vscode-mcp-server

v4.9.5
@vscode-mcp/vscode-mcp-server Checked 3 days ago Published 4 months ago

MCP Server that connects to VSCode Extension via Unix Socket

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

health_check Health Check

Test connection to VSCode MCP Bridge extension. Troubleshoot when other VSCode MCP tools return connection errors or timeouts

ParameterTypeDescription
workspace_path *stringAbsolute path of the open VSCode workspace folder that runs the VSCode MCP Bridge extension. This value selects the VSCode socket, so it must match the workspace shown by list_workspaces or the extens…

get_diagnostics Get Diagnostics

Get diagnostic information from vscode language servers. Ideal quality-check tool for AI coding agents, much faster than 'tsc --noEmit' and 'eslint .' **Parameter Examples:** - Check modified files: workspace_path: '/path/to/open-vscode-workspace', __NOT_RECOMMEND__filePaths: [] (auto-detects git changes, including submodules) - Check submodule files explicitly: keep workspace_path at the open VSCode workspace root and pass file paths relative to that root, for example ['submodule/path/src/file.ts'] - Filter to ESLint findings only: sources: ['eslint'] - Errors only (rarely useful): __NOT_RE…

ParameterTypeDescription
__NOT_RECOMMEND__filePaths *arrayArray of file paths to get diagnostics for. If empty array is provided, will get diagnostics for all git modified files (staged and unstaged) in the workspace.
workspace_path *stringAbsolute path of the open VSCode workspace folder that runs the VSCode MCP Bridge extension. This value selects the VSCode socket, so it must match the workspace shown by list_workspaces or the extens…
__NOT_RECOMMEND__severitiesarraySeverity levels to include. Default includes all four (error, warning, info, hint) so ESLint rules that surface as hints are not silently dropped.
excludeSourcesarrayDiagnostic sources to exclude (case-insensitive substring match). Defaults to ["cspell"] to drop noisy spell-checker reports; pass [] to keep them. Applied after `sources`, so an excluded source is dr…
sourcesarrayArray of diagnostic sources to include (e.g., "eslint", "ts", "typescript"). If empty array provided, includes all sources.

get_symbol_lsp_info Get Symbol LSP Info

Retrieve comprehensive LSP information for a symbol, including type definitions, documentation, and usage details. Essential for fixing type errors and understanding symbol declarations. Typical use cases: - Fix TypeScript type checking errors - Extract function parameters and return types from symbols when encapsulating code blocks into functions - Obtain variable types from nearby code symbols when declaring variables or type assertions, avoiding the use of 'any'

ParameterTypeDescription
filePath *stringFile path (absolute or relative to workspace root)
symbol *stringSymbol name
workspace_path *stringAbsolute path of the open VSCode workspace folder that runs the VSCode MCP Bridge extension. This value selects the VSCode socket, so it must match the workspace shown by list_workspaces or the extens…
codeSnippetstringOptional code snippet to help precisely locate the symbol when there are multiple symbols with the same name. Eg: "function getUserName()" when locating the symbol "getUserName"
infoTypestringType of LSP information to retrieve. **Info Types Available:** - **all**(default): Returns all available information - **hover**: Rich type information and documentation - **signature_help**: Functio…

get_references Get References

Find all reference locations of a symbol (variable, function, class, etc.) across the codebase **Return Format:** Array of reference locations with file paths and exact positions

ParameterTypeDescription
filePath *stringFile path (absolute or relative to workspace root)
symbol *stringSymbol name
workspace_path *stringAbsolute path of the open VSCode workspace folder that runs the VSCode MCP Bridge extension. This value selects the VSCode socket, so it must match the workspace shown by list_workspaces or the extens…
codeSnippetstringOptional code snippet to help precisely locate the symbol when there are multiple symbols with the same name. Eg: "function getUserName()" when locating the symbol "getUserName"
includeDeclarationbooleanWhether to include the declaration in the results
usageCodeLineRangenumberNumber of lines to include around each reference for usage context. 5 = ±5 lines (11 total), 0 = only reference line, -1 = no usage code

execute_command ⚠️ Execute VSCode Command

Execute VSCode commands with arguments **Common Use Cases:** - Format code: 'editor.action.formatDocument' with args: '[]' - Open files: 'vscode.open' with args: '["file:///absolute/path/to/file.ts"]' - Save all files: 'workbench.action.files.saveAll' with args: '[]' - Auto-fix issues: 'editor.action.fixAll' with args: '[]' - Restart TypeScript: 'typescript.restartTsServer' with args: '[]' - Restart ESLint: 'eslint.restart' with args: '[]' **Important Notes:** - Commands and arguments may change with VSCode updates, it's recommended to search in the VSCode official repository to confirm the c…

ParameterTypeDescription
command *stringVSCode command to execute (e.g., 'vscode.open', 'editor.action.formatDocument')
workspace_path *stringAbsolute path of the open VSCode workspace folder that runs the VSCode MCP Bridge extension. This value selects the VSCode socket, so it must match the workspace shown by list_workspaces or the extens…
argsstringOptional JSON string of arguments array to pass to the command - args parameter must be a JSON string representing an array of arguments - For file paths: Use absolute paths like '["file:///absolute/p…
saveAllEditorsbooleanSave all dirty editors after executing the command (default: true)

open_files Open Files

Open files in vscode

ParameterTypeDescription
files *arrayArray of files to open
workspace_path *stringAbsolute path of the open VSCode workspace folder that runs the VSCode MCP Bridge extension. This value selects the VSCode socket, so it must match the workspace shown by list_workspaces or the extens…

rename_symbol ⚠️ Rename Symbol

Rename a symbol with VSCode F2 ability Advantages over search and replace: - Faster - More accurate - Automatically updates imports and reference locations **Important Notes:** - Some symbols may not be renameable (e.g., built-in types, external libraries)

ParameterTypeDescription
filePath *stringFile path (absolute or relative to workspace root)
newName *stringNew symbol name
symbol *stringSymbol name
workspace_path *stringAbsolute path of the open VSCode workspace folder that runs the VSCode MCP Bridge extension. This value selects the VSCode socket, so it must match the workspace shown by list_workspaces or the extens…
codeSnippetstringOptional code snippet to help precisely locate the symbol when there are multiple symbols with the same name. Eg: "function getUserName()" when locating the symbol "getUserName"

list_workspaces List Available Workspaces

List all available VSCode workspaces that can be connected to use vscode mcp tools **Return Format:** Array of workspace objects with paths, names, status, and optional details. Includes summary statistics about discovered workspaces. **Important Notes:** - **Active status** means successfully connected and verified - **Available status** means socket exists but not tested