feat: auto-configure DevStar MCP Server for Github Copilot and Trae #6

Merged
lat5211 merged 2 commits from feature/auto-configure-mcp into main 2026-01-09 12:18:33 +00:00
Owner

Summary

Implement automatic MCP Server configuration for Github Copilot and Trae.

Background

AI IDEs run in different environments and therefore read MCP configurations from different locations:

Trae IDE (Container-based):

  • Runs inside the container
  • Reads MCP config from inside the container at /root/.trae-server/data/Machine/mcp.json
  • Requires SSH to write configuration

GitHub Copilot (Local VSCode Extension):

  • Runs outside the container on the user's local machine
  • Reads MCP config from local file system:
    • macOS: ~/Library/Application Support/Code/User/mcp.json
    • Windows: %APPDATA%/Code/User/mcp.json

This PR configures DevStar MCP Server in both locations automatically when opening a container.

Changes

1. Container MCP Configuration (for Trae IDE)

  • Add configureMCPServerInContainer method
  • SSH into container and write config to /root/.trae-server/data/Machine/mcp.json
  • Use mcpServers format
  • Dynamic DevStar domain URL resolution

2. Local VSCode MCP Configuration (for GitHub Copilot)

  • Add configureMCPServerLocally method
  • Write config to local VSCode User settings (outside container)
  • Cross-platform support (macOS/Windows)
  • Use servers format
  • Preserve existing MCP servers from other providers

Configuration Locations

IDE Runtime Config Location Format
Trae IDE Container (inside) /root/.trae-server/data/Machine/mcp.json mcpServers
GitHub Copilot Local (outside) ~/Library/Application Support/Code/User/mcp.json (macOS)
%APPDATA%/Code/User/mcp.json (Windows)
servers

Testing

Tested on macOS with local VSCode MCP auto-configuration. Config deduplication and error handling verified.

How It Works

When opening a remote container via "Open with VSCode":

  1. Configure local VSCode MCP Server (for GitHub Copilot running on local machine)
  2. Configure container MCP Server (for Trae IDE running inside container)
  3. Both use user's DevStar token and domain
## Summary Implement automatic MCP Server configuration for Github Copilot and Trae. ## Background AI IDEs run in different environments and therefore read MCP configurations from different locations: **Trae IDE (Container-based):** - Runs **inside the container** - Reads MCP config from **inside the container** at `/root/.trae-server/data/Machine/mcp.json` - Requires SSH to write configuration **GitHub Copilot (Local VSCode Extension):** - Runs **outside the container** on the user's local machine - Reads MCP config from **local file system**: - macOS: `~/Library/Application Support/Code/User/mcp.json` - Windows: `%APPDATA%/Code/User/mcp.json` This PR configures DevStar MCP Server in both locations automatically when opening a container. ## Changes ### 1. Container MCP Configuration (for Trae IDE) - Add `configureMCPServerInContainer` method - SSH into container and write config to `/root/.trae-server/data/Machine/mcp.json` - Use `mcpServers` format - Dynamic DevStar domain URL resolution ### 2. Local VSCode MCP Configuration (for GitHub Copilot) - Add `configureMCPServerLocally` method - Write config to local VSCode User settings (outside container) - Cross-platform support (macOS/Windows) - Use `servers` format - Preserve existing MCP servers from other providers ## Configuration Locations | IDE | Runtime | Config Location | Format | |-----|---------|-----------------|--------| | Trae IDE | Container (inside) | `/root/.trae-server/data/Machine/mcp.json` | `mcpServers` | | GitHub Copilot | Local (outside) | `~/Library/Application Support/Code/User/mcp.json` (macOS)<br>`%APPDATA%/Code/User/mcp.json` (Windows) | `servers` | ## Testing Tested on macOS with local VSCode MCP auto-configuration. Config deduplication and error handling verified. ## How It Works When opening a remote container via "Open with VSCode": 1. Configure local VSCode MCP Server (for GitHub Copilot running on local machine) 2. Configure container MCP Server (for Trae IDE running inside container) 3. Both use user's DevStar token and domain
shizi added 2 commits 2026-01-07 13:20:11 +00:00
feat: auto-configure local VSCode MCP Server for GitHub Copilot
All checks were successful
CI/CD Pipeline for DevStar Extension / build (pull_request) Successful in 7m18s
a816e9cd91
lat5211 merged commit dcf190067c into main 2026-01-09 12:18:33 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: devstar/devstar-vscode#6
No description provided.