VSC as MCP
Enables AI assistants to leverage VS Code's language intelligence for code navigation, refactoring, and analysis via the MCP protocol.
README
<p align="center"> <img src="https://raw.githubusercontent.com/CodingWithCalvin/VSC-MCPServer/main/resources/logo.png" alt="VSC as MCP Logo" width="128" height="128"> </p>
<h1 align="center">VSC as MCP</h1>
<p align="center"> <strong>🚀 Supercharge your AI coding assistants with VS Code's powerful language intelligence!</strong> </p>
<p align="center"> <a href="https://github.com/CodingWithCalvin/VSC-MCPServer/blob/main/LICENSE"> <img src="https://img.shields.io/github/license/CodingWithCalvin/VSC-MCPServer?style=for-the-badge" alt="License"> </a> <a href="https://github.com/CodingWithCalvin/VSC-MCPServer/actions/workflows/build.yml"> <img src="https://img.shields.io/github/actions/workflow/status/CodingWithCalvin/VSC-MCPServer/build.yml?style=for-the-badge" alt="Build Status"> </a> </p>
A Visual Studio Code extension that exposes an MCP (Model Context Protocol) server, giving AI tools like Claude, Cursor, and others direct access to VS Code's semantic code understanding capabilities - go-to-definition, find references, completions, diagnostics, and so much more!
✨ Features
- 🧠 Full Language Intelligence - Access VS Code's language server features via MCP tools
- 📁 Workspace Aware - Works on individual files or full project contexts
- 🔗 URI Protocol Handler - Launch VS Code via
vscode://codingwithcalvin.mcp/... - ⚡ Auto-start - MCP server starts automatically when VS Code launches
- 🔒 Secure by Default - Binds only to localhost, no external access
🛠️ Available Tools
| Tool | Description |
|---|---|
vscode_open_folder |
Open a workspace folder |
vscode_get_open_folders |
Get currently open workspace folder(s) |
vscode_document_symbols |
Get all symbols in a document |
vscode_workspace_symbols |
Search symbols across the workspace |
vscode_go_to_definition |
Find symbol definitions |
vscode_find_references |
Find all references to a symbol |
vscode_hover_info |
Get type info and documentation |
vscode_diagnostics |
Get errors and warnings |
vscode_call_hierarchy |
Get incoming/outgoing calls |
vscode_completions |
Get code completions at a position |
vscode_signature_help |
Get function signature help |
vscode_type_hierarchy |
Get type hierarchy information |
vscode_code_actions |
Get available code actions/quick fixes |
vscode_format_document |
Format an entire document |
vscode_format_range |
Format a specific range |
vscode_organize_imports |
Organize imports in a document |
vscode_rename_symbol |
Rename a symbol across the workspace |
vscode_workspace_file_search |
Search for files by pattern |
vscode_workspace_text_search |
Search for text across files |
📦 Installation
VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "VSC as MCP"
- Click Install 🎉
Manual Installation
Download the latest .vsix from the Releases page:
code --install-extension CodingWithCalvin.VSC-MCPServer.vsix
🚀 Usage
The MCP server starts automatically when VS Code launches! Just configure your AI tool to connect:
🤖 MCP Configuration
Add to your MCP client configuration:
{
"mcpServers": {
"vscode": {
"url": "http://localhost:4000/mcp",
"description": "VS Code semantic code navigation"
}
}
}
🔗 URI Protocol
Launch VS Code and control the MCP server via URI:
vscode://codingwithcalvin.mcp/start # Start MCP server
vscode://codingwithcalvin.mcp/start?port=4000 # Start on specific port
vscode://codingwithcalvin.mcp/open?folder=/path/to/dir # Open folder and start
⚙️ Configuration
| Setting | Default | Description |
|---|---|---|
codingwithcalvin.mcp.autoStart |
true |
Auto-start server on VS Code launch |
codingwithcalvin.mcp.port |
4000 |
MCP server port |
codingwithcalvin.mcp.bindAddress |
127.0.0.1 |
Bind address (localhost only) |
💻 Commands
Access these from the Command Palette (Ctrl+Shift+P):
- ▶️ MCP Server: Start - Start the MCP server
- ⏹️ MCP Server: Stop - Stop the MCP server
- 🔄 MCP Server: Restart - Restart the MCP server
- 📋 MCP Server: Show Available Tools - View all available MCP tools
🔒 Security
- 🏠 Localhost Only - Binds only to
127.0.0.1 - 🛡️ DNS Rebinding Protection - Validates Host header
- ✅ Same-machine Trusted - No authentication required for local access
📋 Requirements
- 💻 Visual Studio Code 1.85.0 or later
- 🟢 Node.js (bundled with VS Code)
🤝 Contributing
Contributions are welcome! Whether it's bug reports, feature requests, or pull requests - all feedback helps make this extension better.
🔧 Development Setup
- Clone the repository
- Run
npm install - Run
npm run build - Press F5 to launch the Extension Development Host 🎉
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👥 Contributors
<!-- readme: contributors -start --> <a href="https://github.com/CalvinAllen"><img src="https://avatars.githubusercontent.com/u/41448698?v=4&s=64" width="64" height="64" align="left" alt="CalvinAllen"></a> <br clear="all"> <!-- readme: contributors -end -->
<p align="center"> Made with ❤️ by <a href="https://github.com/CodingWithCalvin">Coding With Calvin</a> </p>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。