Skip to main content

Use Lens Studio MCP in VS Code

Connect GitHub Copilot in VS Code to the Lens Studio MCP server, so Copilot agent mode can work in the project you have open in Lens Studio.

GitHub Copilot in VS Code can use the Lens Studio MCP server, so agent mode can read and change the project you have open in Lens Studio. CLAD's agents and skills aren't available in VS Code; for those, use Claude Code, Codex, or Cursor.

Before you start

  • Lens Studio 5.25 or later, with your project saved and open, and the Lens Studio MCP server running. See Connect Your Agent to Lens Studio.
  • VS Code with GitHub Copilot.

Open the Lens Studio project in VS Code

  1. In VS Code, select File > Open Folder and choose your Lens Studio project folder. It holds the .vscode/mcp.json file that points VS Code at this Lens Studio window.
  2. When VS Code asks whether you trust the authors of the files in this folder, select Yes, I trust the authors. VS Code starts servers from .vscode/mcp.json only in a trusted workspace.

Check that VS Code is connected to Lens Studio

  1. Open the Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows) and run MCP: List Servers.
  2. Select lens-studio. If it isn't running, select Start Server.
  3. In the Copilot chat, switch to agent mode and select Configure Tools in the chat input to see the Lens Studio tools.

If lens-studio won't start, select Show Output in the same list to read why, and see Troubleshoot Lens Studio MCP.

Add the Lens Studio server to VS Code by hand

For a folder without .vscode/mcp.json, create the file with the server's address and token. VS Code uses servers as the top-level key, where Copy MCP Config gives mcpServers:

.vscode/mcp.json
{
"servers": {
"lens-studio": {
"type": "http",
"url": "http://localhost:<port>/mcp",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}

Get the port and token from Copy MCP Config; see Connect Your Agent to Lens Studio. The port can change when Lens Studio restarts.

Give Copilot Lens Studio instructions with a custom agent

A custom agent keeps your Lens Studio instructions in one file that you select in the chat. Create it as a .agent.md file in .github/agents/ in the project folder, or with Chat: New Custom Agent in the Command Palette. Custom agents were called chat modes in earlier versions of VS Code. See Custom agents in the VS Code documentation, and Give Your AI Agent Lens Studio Context for what to put in it.