VS Code Smart Context MCP
Run an MCP server directly from VS Code and expose live workspace intelligence (LSP + editor + file context) to external AI coding agents.
Requires an MCP-compatible client: Claude Code, opencode, Codex CLI, or VS Code Copilot.
Features
Live MCP Server
Start a local MCP HTTP endpoint (http://127.0.0.1:<port>/mcp) and connect external agents without leaving VS Code.
- Starts automatically on extension activation (configurable)
- Automatic port-pair scanning (
MCP + IPC) — never fails silently if your preferred port is busy
- Start / Stop / Restart from the command palette or side panel
- Copy server URL in one click
- Self-heals: automatically recovers if the MCP process crashes
- Handles multiple VS Code windows and workspaces gracefully
Deep Code Intelligence (LSP / AST)
Go beyond grep — get the same semantic results VS Code computes internally.
- Go to definition, find references, hover documentation
- Implementations and call hierarchy
- Workspace-wide and file-level symbol search
- Code actions (quick fixes, refactors) and safe rename
- Codebase graph with community detection, god-node identification, and cross-module link analysis
Full Workspace & Editor Context
- File: read, write, list, search, diff (git changes)
- Editor: active file, current selection, open tabs, problems panel
- Execute: run VS Code commands or terminal commands (with
confirm or auto approval)
- Todo: persistent task list scoped to the agent session
One-Click Client Sync
Automatically writes the MCP server URL into the config files for:
| Client |
Config Target |
| Claude Code |
~/.claude/claude_desktop_config.json |
| opencode |
opencode project config |
| Codex CLI |
~/.codex/config.json |
| VS Code Copilot |
Workspace MCP settings |
Quick Start
- Install the extension from the VS Code Marketplace.
- The server starts automatically when VS Code opens (
http://127.0.0.1:3785/mcp).
- Run
Context MCP: Sync Clients to register the server URL with your AI clients.
- Start prompting — your agent now has full workspace context.
Tip: The server URL is shown in the Context MCP side panel. Click Copy URL to grab it instantly.
Commands
| Command |
Description |
Context MCP: Start Server |
Start the MCP server |
Context MCP: Stop Server |
Stop the MCP server |
Context MCP: Restart Server |
Restart server and IPC bridge |
Context MCP: Open Panel |
Open the Context MCP side panel |
Context MCP: Sync Clients |
Write MCP URL to all enabled client configs |
Context MCP: Copy Server URL |
Copy the current MCP endpoint URL |
Settings
| Setting |
Type |
Default |
Description |
vscodeContextMcp.port |
number |
3785 |
Preferred MCP port (auto-scans fallbacks if busy) |
vscodeContextMcp.autoStart |
boolean |
true |
Start server automatically on activation |
vscodeContextMcp.executeApproval |
enum |
"confirm" |
Approval mode for execute_command — confirm prompts before running, auto runs silently |
vscodeContextMcp.enabledClients |
array |
["claudeCode","opencode"] |
Clients to register during sync |
| Group |
Tool |
Description |
| File |
read_file |
Read file contents with line range support |
|
write_file |
Write or overwrite a file |
|
list_directory |
List directory contents |
|
file_search |
Search files by name/glob |
|
text_search |
Full-text search across the workspace |
|
get_changes |
Return git diff / changed files |
| Execute |
execute_command |
Run a VS Code or shell command |
|
terminal_last_command |
Get the last command run in the terminal |
|
terminal_selection |
Get the current terminal selection |
| Intelligence |
get_diagnostics |
Fetch errors and warnings (all or per-file) |
|
get_file_symbols |
Symbol outline for a file |
|
get_workspace_symbols |
Search symbols across the workspace |
|
find_references |
All references to a symbol |
|
find_symbol_definition |
Find where a symbol is defined |
|
find_symbol_references |
Cross-file references for a symbol |
|
resolve_symbol |
Resolve a symbol name to its declaration |
|
go_to_definition |
Jump to the definition location |
|
get_hover_info |
Hover docs / type info at a position |
|
get_implementations |
Find implementations of an interface/abstract |
|
get_call_hierarchy |
Incoming and outgoing call graph |
|
get_code_actions |
Available quick fixes and refactors |
|
rename_symbol |
Safe rename across all references |
|
get_codebase_graph |
Structural graph with communities and god nodes |
| Editor |
get_active_file |
Active editor path and cursor position |
|
get_selection |
Currently selected text |
|
get_open_files |
List of all open editor tabs |
|
get_problems |
Problems panel contents |
| Todo |
todo_list |
List all todos for the session |
|
todo_add |
Add a new todo item |
|
todo_complete |
Mark a todo as complete |
|
todo_remove |
Remove a todo item |
Requirements
- VS Code
1.93.0 or newer
- Dart extension or any language extension (for LSP intelligence features)
- An MCP-compatible client: Claude Code, opencode, Codex CLI, or VS Code Copilot
Troubleshooting
Server won't start
Try changing vscodeContextMcp.port to a free port. The extension automatically scans fallback port pairs, but a firewall rule may block the range entirely.
Intelligence tools return empty results
The language server needs a few seconds to index your project after opening VS Code. Wait for the status bar to finish loading and retry.
Client sync fails
Confirm the server is running (green indicator in the side panel), then run Context MCP: Sync Clients again. Check that the target client's config directory exists and is writable.
Privacy
This extension collects no telemetry and sends no data to any server.
Author & Publisher
Author: Chinmay Nagar — Industrial Embedded & Connected Systems Engineer
Publisher: ChipNexa — Intelligent Connected Systems. Production-grade software from firmware to cloud.
License
MIT