Your agent asks.
VS Code answers.
Editor Relay is a VS Code extension that runs a small MCP server on your machine. Any AI agent can use it to read what you're working on, and to use the language servers, terminal, git and debugger you already have.
Install/Source/Changelog/Issues
Copilot, Claude Code, Cursor or any MCP client
127.0.0.1:3210, token required, asks before acting
Editors, language servers, terminal, git, debugger
Nothing leaves your machine. The relay only listens on localhost.
§1 Setup
Install the extension. The server starts with VS Code, and the status bar reads Editor Relay: Running.
code --install-extension SahilTiwaskar.vscode-context-bridge
Connect your agent. Copilot finds it on its own. Other clients need the URL and your token:
claude mcp add --transport http editor-relay \ http://127.0.0.1:3210/mcp --header \ "Authorization: Bearer $(cat ~/.vscode-context-bridge/token)"
Ask normally: who calls this function? rename it everywhere. why did my last command fail? The agent picks the tools.
§2 Tools
- get_context
- Open file, selection, tabs, errors, diffs, recent terminal output
- open_file
- Open a file in the editor
- select_text
- Select a range in the active editor
- show_notification
- Show the user a message
- propose_change
- Suggest an edit as a diff you accept or reject
- go_to_definition
- Where a symbol is defined
- find_references
- Everywhere a symbol is used
- hover_info
- Its type and docs
- document_symbols
- Outline of a file
- workspace_symbol_search
- Find a symbol by name
- get_diagnostics
- Errors and warnings from your linters and compilers
- get_code_actions
- Quick fixes available for a range
- apply_code_action
- Apply one, after you review the diff
- rename_symbol
- Rename across the project, after you review the diff
- run_in_terminal
- Run a command once you approve it, then read its output
- list_tasks
- Tasks from tasks.json and package scripts
- run_task
- Run one and get its exit code
- git_status
- Branch, staged, unstaged and untracked files
- get_breakpoints
- Breakpoints you've set
- get_debug_state
- Call stack and variables while paused
§3 Safeguards
Edits wait for you. Proposals, quick fixes and renames open as a diff with Accept and Reject. Nothing is written until you accept.
Commands wait for you. Terminal commands ask first, then run in a terminal you can see.
It stays local. The relay listens on 127.0.0.1 only and every request needs your token. Files like .env can be hidden from it entirely.
§4 In practice
› fix the error I'm looking at get_context main.ts, line 4 selected get_diagnostics Cannot find name 'multiply' go_to_definition src/math.ts:5 get_code_actions Add import from "./math" apply_code_action waiting for review … accepted run_task test exit 0 Added the missing import. Tests pass.