vscode
Surfaces C/C++ compiler and Clangd diagnostics from VS Code's Problems panel, letting the agent inspect errors and warnings reported for C/C++ sources.
Can trigger CMake-related VS Code commands (e.g. cmake.build) through the generic vscode_execute_command tool, enabling builds and other CMake operations from within the editor.
Exposes VS Code's Problems panel diagnostics, allowing the agent to read ESLint errors and warnings (with severity filtering) for a given file path.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@vscode show me my current file's cursor position and any LSP errors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
VS Code Antigravity MCP (vscode-antigravity-mcp)
Zero-dependency Model Context Protocol (MCP) Server + VS Code UI Extension bridging AI coding agents (Google Antigravity, Claude Desktop, Cursor, Copilot, etc.) directly into Local and Remote-SSH / WSL / Dev Container VS Code windows.
Key Highlights / Điểm nổi bật
1:1 Antigravity Tool Schemas: Exact parameter names (
Path,StartLine,EndLine,ByteOffset,Target,Replacement,CommandLine,WaitMsBeforeAsync, ...) and output formatting matching Antigravity's native toolset.Seamless Remote-SSH / WSL / Containers Support (Zero Remote Install): Uses
"extensionKind": ["ui"]+vscode.workspace.fs+ VS Code Terminal Shell Integration (^1.93.0), allowing agents on your local machine to read, edit, search, and run commands inside remote SSH/WSL/Container windows without installing anything on the remote server.Live Editor & Preview Context + Undo-Safe Saves: Reads live cursor position (
line,column), highlighted selection (selectedText), open tabs (including Preview / Custom Editor / Webview / Diff / Notebook tabs), and compiler/LSP diagnostics (Problems). Includes an optional Antigravity Markdown Preview (*.mdcustom editor) that captures live highlighted text directly inside rendered Markdown. Edits on open tabs apply viavscode.WorkspaceEdit+doc.save()— saving immediately to disk while preservingCtrl+ZUndo history in VS Code.Multi-Window Smart Routing & Offline Fallback: Automatically routes local vs. remote paths across multiple open VS Code windows, and falls back to standalone Node.js file/shell execution when VS Code is closed.
Zero External Dependencies: Pure Node.js (
>=18), nonpm installrequired. Works on Windows, macOS, and Linux.
Related MCP server: VSCode MCP
Quick Start / Cài đặt nhanh (1 lệnh)
git clone https://github.com/anhpi1/vscode-antigravity-mcp.git
cd vscode-antigravity-mcp
npm run setupWhat npm run setup does automatically:
Packages
dist/vscode-antigravity-mcp-1.0.0.vsix(pure Node.js ZIP builder, no external CLI tools required).Installs the extension into VS Code's Default profile and all custom VS Code profiles.
Registers the
"vscode"MCP server in~/.gemini/config/mcp_config.jsonfor Antigravity.
After running setup, open Antigravity -> Additional Options (...) -> MCP Servers -> Refresh (or start a new chat).
Windows Troubleshooting / Lưu ý trên Windows
PowerShell blocks
npm.ps1(ExecutionPolicy): Run the setup script directly with Node.js instead ofnpm:node ./scripts/install.jsVS Code extension not showing in
code --list-extensions: Ifinstall.jsfails to install the.vsixdue tocmd.exequote escaping, install the packaged VSIX directly:code --install-extension ./dist/vscode-antigravity-mcp-1.0.0.vsix --force code --list-extensions --show-versions(For custom VS Code profiles, add
--profile "<ProfileName>".)
Manual MCP Configuration (Other MCP Clients)
Add to your mcp_config.json / claude_desktop_config.json:
{
"mcpServers": {
"vscode": {
"command": "node",
"args": ["/absolute/path/to/vscode-antigravity-mcp/src/mcp-server.js"]
}
}
}Available MCP Tools (12 Tools)
Category | Tool Name | Parameters | Description |
File Operations |
|
| Read up to 800 lines or 46,080 bytes with |
|
| Create, overwrite, or append files; auto-saves and preserves | |
|
| Exact text replacement via | |
Search & Directories |
|
| List subdirectories and file byte sizes (Local & Remote-SSH). |
|
| Fast glob/extension file finder. | |
|
| Text and regex content search with line numbers. | |
Shell & Tasks |
|
| Run commands locally or on Remote-SSH/WSL via VS Code Shell Integration; supports async background tasks. |
|
| Inspect, send stdin to, or terminate background command tasks. | |
VS Code Editor & UI |
|
| Get active |
|
| Open file in VS Code, scroll into view, and set cursor/selection range. | |
|
| Read Errors/Warnings from VS Code's Problems panel (Clangd, C/C++, Pylance, ESLint, etc.). | |
|
| Trigger any VS Code Command ID (e.g. |
Markdown Preview with Live Selection
VS Code isolates built-in Webview previews (vscode.markdown.preview.editor), so external extensions can detect the active preview file path (activeTab / filePath) via tabGroups, but cannot read highlighted text inside built-in Webviews.
To read both the active file path and live highlighted text while viewing rendered .md files:
Open any
.mdfile in VS Code.Click the
Open Antigravity Markdown Previewicon in the top-right editor title bar (or right-click the file -> Open With... -> Antigravity Markdown Preview).Highlight any text in the rendered Markdown view — it is exposed through
vscode_get_editor_state(and the optional PreInvocation hook below).
Optional: Live Context PreInvocation Hook (Antigravity)
This hook is optional and is not installed by npm run setup. When enabled, Antigravity automatically injects your active VS Code file path, cursor position, and highlighted text (from both text editors and Antigravity Markdown Preview) into every user turn without manually calling vscode_get_editor_state.
Install / Uninstall Hook
# Install optional PreInvocation hook into ~/.gemini/config/hooks.json
npm run setup-hook
# (Windows PowerShell without npm.ps1):
node ./scripts/install-hook.js
# Remove the hook
npm run uninstall-hook
# or:
node ./scripts/install-hook.js --uninstallManual Hook Configuration (~/.gemini/config/hooks.json)
{
"vscode-live-cursor-and-selection": {
"enabled": true,
"PreInvocation": [
{
"type": "command",
"command": "node /absolute/path/to/vscode-antigravity-mcp/hooks/vscode-context-hook.js",
"timeout": 10
}
]
}
}Useful Commands
# Package VSIX only
npm run build
# Run automated MCP protocol tests
npm test
# Install / uninstall optional Antigravity PreInvocation hook
npm run setup-hook
npm run uninstall-hook
# Uninstall extension from all VS Code profiles & remove MCP config entry
npm run uninstall-bridgeLicense
Available Tools
12 toolsedit_fileA
Edit an existing file by replacing exact occurrences of Target with Replacement. Updates open VS Code tabs cleanly with Undo support and saves immediately to disk.
Inputs: Path (required), Target (required), Replacement (required).
find_by_nameA
Search for files and subdirectories within a directory by glob pattern, extension, and type (works across Local and Remote-SSH/WSL).
Inputs: SearchDirectory (required), Type, Pattern, Excludes, +3 more.
grep_searchB
Search for exact text or regular expression matches inside files or directories (works across Local and Remote-SSH/WSL).
Inputs: Query (required), SearchPath (required), IsRegex, Includes, +2 more.
list_dirA
List the subdirectories and files inside a directory (works across Local and Remote-SSH/WSL workspaces).
Inputs: DirectoryPath (required).
manage_taskB
Manage background command tasks: list running/completed tasks, check status and recent output, send_input to stdin, or kill a task.
Inputs: Action (required), Input, TaskId.
read_fileA
Read the contents of a text file (supports both Local paths and Remote-SSH/WSL/Container paths in VS Code). Each read returns at most 800 lines or 46080 bytes.
Inputs: Path (required), EndLine, StartLine, ByteOffset.
run_commandB
Execute a shell command in the active VS Code workspace (Local shell or Remote Shell Integration / SSH on Remote-SSH/WSL windows). Commands exceeding WaitMsBeforeAsync continue as background tasks.
Inputs: CommandLine (required), toolSummary (required), WaitMsBeforeAsync (required), Cwd, +2 more.
vscode_execute_commandB
Execute any built-in or extension VS Code command ID (e.g., "editor.action.formatDocument", "cmake.build", "workbench.action.files.saveAll").
Inputs: Command (required), Args.
vscode_get_diagnosticsB
Read compiler, linter, and language-server errors/warnings (e.g. Clangd, C/C++, Pylance, ESLint) from VS Code Problems panel.
Inputs: Path, Severity.
vscode_get_editor_stateA
Get live VS Code state: active file path (Local or Remote-SSH), cursor line/column, currently highlighted/selected text, open tabs, and workspace folders.
Inputs: AllWindows.
vscode_open_fileB
Open a file in VS Code, bring it into view, and optionally jump to a line/column or highlight a selection range.
Inputs: Path (required), EndLine, Preview, EndColumn, +2 more.
write_fileA
Create a new file with the given contents, overwrite an existing file, or append when Append is true. Automatically saves to disk in VS Code while preserving Undo history on open tabs.
Inputs: Path (required), Content (required), Append, Overwrite.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools target clearly distinct actions: read_file/write_file/edit_file, grep_search (contents), find_by_name (names/globs), and list_dir (one directory) are separable, and run_command vs vscode_execute_command is distinguished by shell vs VS Code command IDs. The only mild friction is write_file (overwrite/append) vs edit_file (targeted replacement), which share file-mutation intent but are adequately described.
All names follow a snake_case verb_noun pattern (read_file, grep_search, manage_task, vscode_open_file), which is predictable. The only deviation is the inconsistent 'vscode_' prefix applied to four tools but not to the other eight, which is a minor cosmetic inconsistency rather than a readability problem.
Twelve tools is well within the ideal range and each earns its place: file I/O, search, directory navigation, editor state, diagnostics, shell execution, background task management, and VS Code command dispatch. No redundant or filler tools are present.
The surface covers the full editing workflow—read, write, edit, search, navigate, inspect diagnostics, run commands, and manage background tasks—plus live editor state and command dispatch. Minor gaps exist: no delete/rename/move file operation and no directory creation, though agents can work around these via run_command.
Maintenance
Related MCP Connectors
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Let ChatGPT and Claude read and edit files, search and run commands on your own computer.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceBridges web-based AI agents to a local VS Code workspace over MCP Streamable HTTP, letting them inspect files, edit code, and run persistent shell commands within session-scoped boundaries. Risky, destructive, or out-of-scope operations pause for explicit human approval, with session state surviving reconnects.8 npmGPL 3.0
- FlicenseNot gradedqualityAmaintenanceEnables AI coding agents to access real-time VSCode LSP diagnostics, type information, and code navigation without slow tsc/eslint checks, plus symbol renaming and file operations.-
- FlicenseNot gradedqualityAmaintenanceEnables AI coding agents to pull real-time LSP diagnostics, hover/definition/signature details, and symbol references with usage context from a running editor instance, replacing slow tsc/eslint/build runs. It also supports workspace-wide symbol renaming and opening files across multiple workspaces.-
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to query a running VSCode instance for real-time LSP data such as diagnostics, hover/definition/signature info, and symbol references instead of waiting on slow tsc or eslint runs. Also supports workspace-wide symbol renaming, opening files, listing workspaces, and executing VSCode commands.MIT