无头VSCode隧道控制工具

该项目提供通过MCP协议控制无头VSCode隧道的工具,适用于远程开发环境和AI辅助编程场景。

  • by maxgolov
  • Dockerfile
  • 本地部署
  • 更新于
在 GitHub 查看 maxgolov/vscode-headless

使用说明

VSCode无头隧道MCP控制

该项目评估并提供了在隧道模式下生成无头VSCode并通过MCP(模型上下文协议)对其进行控制的工具。

项目结构

vscode-headless/
├── external/           # Cloned projects for evaluation
│   ├── vsc-remote-mcp/
│   └── vscode-as-mcp-server-with-approvals/
├── scripts/            # PowerShell and Bash launch scripts
│   ├── launch-vscode-tunnel.ps1
│   └── launch-vscode-tunnel.sh
├── vscode-cli/         # (Auto-created) Isolated VSCode CLI
├── EVALUATION.md       # Detailed evaluation and comparison
└── README.md          # This file

快速开始

Windows(PowerShell)

# Basic launch
.\scripts\launch-vscode-tunnel.ps1

# With custom tunnel name and MCP extensions
.\scripts\launch-vscode-tunnel.ps1 -TunnelName "my-tunnel" -InstallExtensions

Linux/macOS(Bash)

# Make script executable
chmod +x scripts/launch-vscode-tunnel.sh

# Basic launch
./scripts/launch-vscode-tunnel.sh

# With options
./scripts/launch-vscode-tunnel.sh --tunnel-name my-tunnel --install-exts

评估项目

1.ruvnet/vsc远程mcp⭐

  • 存储库: https://github.com/ruvnet/vsc-remote-mcp
  • 最适合: 基于Docker的部署,多实例管理
  • 特征: 完整的MCP服务器、VSCode群管理、安全功能
  • 类型: NPM包+Docker

2.mikhail yaskou/vscode作为mcp服务器并获得批准⭐

  • 存储库: https://github.com/mikhail-yaskou/vscode-as-mcp-server-with-approvals
  • 最适合: 基于扩展的控制,本地开发
  • 特征: 代码更改、实时诊断、终端操作的批准UI
  • 类型: VSCode扩展

📖 看 评估.md 用于详细比较和架构
📊 看 功能_个性_分析.md 用于逐个特征的综合比较

什么是MCP?

模型上下文协议(MCP) 使AI助手(Claude等)能够与开发人员环境进行交互:

  • 📝 使用审批工作流进行代码编辑
  • 🔍 实时诊断和错误纠正
  • 💻 终端命令执行
  • 🌐 远程/隧道模式支持
  • 🔧 扩展和工作空间管理

特性

✅ 隔离的VSCode CLI安装 -不干扰主VSCode
✅ 隧道模式支持 -随时随地远程访问
✅ 跨平台脚本 -PowerShell(Windows)和Bash(Linux/macOS)
✅ MCP扩展自动安装 -可选 -InstallExtensions 旗帜
✅ 项目评估 -比较多种MCP控制方法

安装说明

  1. 克隆此存储库:

    git clone <your-repo-url>
    cd vscode-headless
    
  2. 选择您的方法:

    • 快速入门: 使用提供的脚本(请参阅上面的快速入门)
    • 基于扩展: 安装 vscode-as-mcp-server 来自VSCode市场
    • Docker/高级: 探索 external/vsc-remote-mcp
  3. 配置AI客户端(例如,Claude Desktop):

    // claude_desktop_config.json
    {
      "mcpServers": {
        "vscode": {
          "command": "npx",
          "args": ["vscode-as-mcp-server"]
        }
      }
    }
    
  4. 测试连接:

    • 启动隧道(通过脚本或手动)
    • 启动您的AI客户端(Claude Desktop等)
    • AI现在应该能够控制你的VSCode实例了!

建议

🎯 对于当地发展: 使用 vscode-as-mcp-server 扩展+自定义脚本
🎯 对于生产/团队: 使用 vsc-remote-mcp 使用Docker
🎯 评估: 比较这两种方法 external/ 目录

文档

安全说明

⚠️ 隧道身份验证: 首次运行将提示Microsoft/GitHub OAuth
⚠️ MCP权限: 通过审批界面审查和批准AI代码更改
⚠️ 独立安装: 脚本将VSCode CLI安装在单独的目录中

资源

许可证

MIT(用于此存储库中的自定义脚本)
请参阅中的单个项目 external/ 为了他们的许可证。