Skip to main content
VS Code supports MCP servers through GitHub Copilot’s Agent mode (available in VS Code 1.99+). The config uses a servers key (not mcpServers) and can be scoped globally or per-project.
MCP tool use requires GitHub Copilot Chat with Agent mode enabled. Make sure you’re running VS Code 1.99 or later.
No credentials are required in the config. Calling login opens a browser to Perfai’s own sign-in page (OAuth) and completes automatically — see Login below.

Global installation

The global MCP config is stored in VS Code’s user data directory.
File: ~/Library/Application Support/Code/User/mcp.json
VS Code uses "servers" as the top-level key — not "mcpServers". Using the wrong key means the server will not be discovered.

Project-scoped installation

Add .vscode/mcp.json to your project root. VS Code picks this up automatically when the workspace opens.
Prefer not to use the browser login (headless machines, CI)? Create a Perfai API key and add "env": { "PERFAI_API_KEY": "pfk_xxxxxxxxxxxx_..." } to the perfai-cloud-mcp entry. If you do, don’t commit .vscode/mcp.json — add it to .gitignore, keep the key in the global user config instead, or use VS Code’s ${input:...} variables to prompt for it rather than hardcoding it.

Verify the server is running

  1. Open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P).
  2. Run “MCP: List Servers” — confirm perfai-cloud-mcp appears and shows a running status.
  3. If it’s stopped, run “MCP: Restart Server” and select perfai-cloud-mcp.

Login

The prompts below run inside Copilot Chat (Agent mode), not your terminal. The only terminal/file steps are editing the config.
Open Copilot Chat, switch to Agent mode, and type:
This opens a browser to Perfai’s sign-in page (or uses PERFAI_API_KEY if you set it). Confirm with:

Register an app and run a scan


Fix and verify

One at a time:
All at once, prioritized by severity:
Then confirm the fixes landed: