Skip to content

Commit f7adee4

Browse files
committed
feat(blog): introducing vsc as mcp extension
1 parent edb2813 commit f7adee4

2 files changed

Lines changed: 108 additions & 0 deletions

File tree

297 KB
Loading
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: "Introducing the Visual Studio Code MCP Server!"
3+
date: "2026-01-15T12:00:00-05:00"
4+
categories: [typescript, extensibility, vscode, ai, mcp]
5+
description: "A VS Code extension that exposes the IDE's language intelligence through the Model Context Protocol, enabling AI assistants to leverage IntelliSense, Go to Definition, Find References, and more."
6+
---
7+
8+
Yesterday I [introduced the Visual Studio MCP Server](https://www.codingwithcalvin.net/introducing-the-visual-studio-mcp-server/). Today, it's VS Code's turn.
9+
10+
## VSC MCP Server
11+
12+
**VSC MCP Server** exposes VS Code's language intelligence features as [MCP](https://modelcontextprotocol.io/) tools. Once connected, an AI assistant can:
13+
14+
- Get symbols from documents and workspaces
15+
- Navigate to definitions and find references
16+
- Get IntelliSense completions and signature help
17+
- Run diagnostics, format code, and rename symbols
18+
- Search files and text across the entire workspace
19+
20+
All the things you take for granted when coding in VS Code — now available to your AI tools.
21+
22+
## What's Under the Hood
23+
24+
VS Code has incredibly powerful language features built in. IntelliSense, Go to Definition, Find All References, hover info, call hierarchies — these aren't just UI conveniences. They're backed by language servers that deeply understand your code.
25+
26+
The problem is that this intelligence is locked inside VS Code. An AI tool running alongside the IDE can't tap into any of it. It has to rely on its own understanding of your codebase, which means re-parsing files, guessing at types, and missing context that VS Code already has.
27+
28+
This extension bridges that gap. It wraps VS Code's language server commands and exposes them through MCP, giving AI assistants access to the same semantic understanding that powers your daily coding experience.
29+
30+
## The Tools
31+
32+
The extension exposes 30 MCP tools organized into categories:
33+
34+
**Code Navigation & Analysis**
35+
- `document_symbols` — Get all symbols in a file (functions, classes, variables)
36+
- `workspace_symbols` — Search symbols across the entire workspace
37+
- `go_to_definition` — Find where a symbol is defined
38+
- `find_references` — Find all usages of a symbol
39+
- `hover_info` — Get type information and documentation at a position
40+
- `call_hierarchy` — Get incoming and outgoing function calls
41+
- `type_hierarchy` — Get type inheritance chains
42+
43+
**Completions & Suggestions**
44+
- `get_completions` — Get IntelliSense code completions
45+
- `get_signature_help` — Get function signature and parameter info
46+
- `get_code_actions` — Get available quick fixes and refactorings
47+
48+
**Formatting & Refactoring**
49+
- `format_document` — Format an entire document
50+
- `format_range` — Format a specific range
51+
- `organize_imports` — Sort and organize imports
52+
- `rename_symbol` — Rename a symbol across all references
53+
54+
**Diagnostics & Workspace**
55+
- `diagnostics` — Get errors and warnings for files or the workspace
56+
- `search_workspace_files` — Search for files using glob patterns
57+
- `search_workspace_text` — Search text across the entire workspace
58+
59+
Write operations support dry-run mode, so the AI can preview changes before applying them.
60+
61+
## Getting Started
62+
63+
Install the extension from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=CodingWithCalvin.VSC-MCPServer), or search for "VSC as MCP" in the Extensions view.
64+
65+
The MCP server starts automatically when VS Code launches. By default, it listens on port 4000. Configure your MCP client to connect to:
66+
67+
```json
68+
{
69+
"mcpServers": {
70+
"vscode": {
71+
"url": "http://localhost:4000/mcp"
72+
}
73+
}
74+
}
75+
```
76+
77+
That's it. Your AI assistant can now query VS Code's language intelligence directly.
78+
79+
### Configuration
80+
81+
If you need to change the defaults, head to **Settings** and search for `codingwithcalvin.mcp`:
82+
83+
| Setting | Default | Description |
84+
|---------|---------|-------------|
85+
| `autoStart` | `true` | Start the server when VS Code launches |
86+
| `port` | `4000` | Port for the MCP server |
87+
| `bindAddress` | `127.0.0.1` | Bind address (localhost only for security) |
88+
89+
You can also control the server from the Command Palette:
90+
91+
- **MCP Server: Start** — Start the server
92+
- **MCP Server: Stop** — Stop the server
93+
- **MCP Server: Restart** — Restart the server
94+
- **MCP Server: Show Available Tools** — View all available tools
95+
96+
## Security
97+
98+
The server only binds to localhost by default. It validates the Host header to prevent DNS rebinding attacks and restricts CORS to localhost origins. No authentication is required since it assumes same-machine local access is trusted.
99+
100+
## What's Next
101+
102+
This is v0.1.0. The tool coverage is solid, but there's always room for more. I'm looking at exposing debugging capabilities, terminal integration, and task execution. If there's something you'd find useful, let me know.
103+
104+
## Wrapping Up
105+
106+
The source is on [GitHub](https://github.com/CodingWithCalvin/VSC-MCPServer). If you run into issues or have ideas for additional tools, open an issue or send a PR.
107+
108+
Thanks for reading!

0 commit comments

Comments
 (0)