VS Claude
MCP server that integrates with VS Code to enable file operations, git diffs, and line highlighting via MCP clients like Claude.
README
VS Claude
A VS Code extension with an integrated MCP server that allows MCP clients like Claude to interact with Visual Studio Code.
Key Features
- Smart File Operations - Open files, diffs, and Git comparisons in VS Code
- Batch Operations - Open multiple files at once for efficient workflow
- Git Integration - View git diffs between different versions of files
- Line Highlighting - Jump to specific lines or highlight line ranges
Overview
VS Claude provides a simple tool for AI assistants to open files and diffs in VS Code through the MCP (Model Context Protocol) interface.
Navigation Tool
open - Open files, diffs, and git comparisons in VS Code
- Open files with optional line highlighting
- Show diffs between two files
- View git diffs (working changes, staged, commits)
- Open multiple files in a single operation
- See
mcp/main.gofor the full tool description
Installation
Option 1: From VS Code Extension Marketplace
- Open VS Code
- Go to Extensions (Cmd+Shift+X / Ctrl+Shift+X)
- Search for "VS Claude"
- Click Install
Option 2: Build from Source
- Build the VSIX package:
git clone https://github.com/your-username/vs-claude.git
cd vs-claude
npm install
npm run build
npm install -g @vscode/vsce
vsce package
- Install in VS Code:
- Press
Cmd+Shift+P(Mac) orCtrl+Shift+P(Windows/Linux) - Run "Extensions: Install from VSIX..."
- Select the generated
.vsixfile
- Press
Set up Claude Integration
After installation, you will be prompted to install the MCP server for Claude. Click "Install" to proceed.
If you need to install it later or manually:
- Open the Command Palette (
Cmd+Shift+Pon Mac orCtrl+Shift+Pon Windows/Linux) - Run "VS Claude: Install MCP"
- Restart Claude to activate
- Instruct Claude to use the vs-claude tools if appropriate for the task
Set up Integration with Other AI Assistants
If your AI assistant supports MCP servers:
- Open the Command Palette (
Cmd+Shift+Pon Mac orCtrl+Shift+Pon Windows/Linux) - Run "VS Claude: Install MCP"
- Click "Manual Setup"
- Follow the MCP server configuration instructions for your AI assistant
Architecture
VS Claude consists of two components:
VS Code Extension (TypeScript)
- Installs the MCP server with Claude CLI
- Implements the file opening logic using VS Code APIs
- Handles file-based IPC for communication with MCP clients
Commands:
VS Claude: Install MCP- Install the MCP server with ClaudeVS Claude: Uninstall MCP- Remove the MCP server from Claude
MCP Server (Go)
- Simple proxy that forwards tool calls from MCP clients to VS Code
- Returns responses from VS Code back to the MCP client
Communication Flow
MCP Client (Claude) ↔ MCP Server ↔ File System ↔ VS Code Extension
- MCP Server writes commands to
~/.vs-claude/{windowId}.in - VS Code Extension writes responses to
~/.vs-claude/{windowId}.out - Each VS Code window has a unique ID with metadata in
~/.vs-claude/{windowId}.meta.json - When multiple windows are open, the MCP server returns an error listing available windows
Development
Prerequisites
- Node.js 16+
- Go 1.21+
- VS Code
Scripts
npm run build # Build TypeScript and Go binaries
npm run build:debug # Build with Go debug symbols (no cross-compilation)
npm run check # Format with Biome, lint, and type check all code
npm run test # Run tests
npm run clean # Remove build artifacts
Build System
- Extension bundling with esbuild
- Cross-platform Go binaries for macOS (Intel/ARM), Linux, and Windows
Project Structure
vs-claude/
├── src/ # TypeScript extension source
│ ├── extension.ts # Main entry point
│ ├── tools/ # Tool implementations
│ │ ├── open-tool.ts # File opening logic
│ │ └── types.ts # TypeScript types
│ ├── command-handler.ts # Command dispatcher
│ ├── window-manager.ts # Window IPC management
│ ├── logger.ts # Logging system
│ └── setup.ts # MCP installation logic
├── mcp/ # Go MCP server source
│ └── main.go # MCP server implementation
├── scripts/ # Build scripts
│ ├── build-extension.js # Extension bundling
│ └── build-mcp-server.sh # Cross-platform Go compilation
├── test/ # Test suite
│ ├── suite/ # Test implementations
│ └── test-workspace/ # Sample project for testing
├── build/ # Build outputs (generated)
│ ├── mcp/ # Cross-platform Go binaries
│ └── extension/ # TypeScript compilation output
└── CLAUDE.md # Project-specific instructions
Testing
The project includes comprehensive tests that:
- Launch VS Code with the extension
- Test file opening functionality
- Verify the MCP integration
Run tests with:
npm test
Development
Press F5 to run the extension in development mode.
Troubleshooting
Tool Not Available
- Ensure VS Code is running with the extension installed
- Check that the MCP server is configured:
claude mcp list - Restart Claude after installation
Multiple VS Code Windows
When multiple windows are open, the MCP server returns an error listing available windows. The MCP client must then specify a windowId with each request:
mcp_vs-claude_open({
args: {"type": "file", "path": "/path/to/file.ts"},
windowId: "window-123"
})
Contributing
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.
Publishing to VS Code extension marketplace
- Go to https://dev.azure.com/badlogicgames/badlogicgames
- Sign in with badlogicgames@gmail.com
- Click the non-descriptive icon next to MZ in the top right
- Click on "Personal access tokens"
- Generate a new token, cause the old one likely expired. Select "All accessible organizations" for Organization, Scope Full access
vsce publish, enter the stupid token- Check https://marketplace.visualstudio.com/manage/publishers/mariozechner?noPrompt=true for status of publication
License
[License information here]
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。