# VS Code

VS Code reads MCP server config from `mcp.json` files at the workspace or user level. Add the Cakewalk gateway as one entry. The Command Palette walks you through it; you can also edit the JSON directly.

## Install Method

JSON config. Workspace scope (`.vscode/mcp.json` inside a project) loads only when that project is open. User scope loads in every VS Code workspace.

## Step 1: Open the MCP config

Open the Command Palette (`⇧⌘P` on Mac, `Ctrl+Shift+P` on Windows or Linux) and run one of:

* **MCP: Add Server**: guided form. Pick **Workspace** or **Global** as the target.
* **MCP: Open Workspace Folder Configuration**: edit `.vscode/mcp.json` directly.
* **MCP: Open User Configuration**: edit the user profile `mcp.json` directly.

## Step 2: Add the Cakewalk Gateway

In the JSON, add this entry:

```json
{
  "servers": {
    "cakewalk": {
      "type": "http",
      "url": "https://mcp-gateway.getcakewalk.io/mcp"
    }
  }
}
```

If the file already contains other servers, add `"cakewalk"` as a new entry inside the existing `servers` object. Save the file.

## Step 3: Authenticate

On first use of a Cakewalk tool, VS Code should initiate the OAuth flow in your browser. Sign in with your Cakewalk account and approve the Connection. If the flow does not start automatically, see Troubleshooting.

## Verifying It Works

Open the Command Palette and run **MCP: List Servers**. The cakewalk server appears with its current connection status. In Cakewalk, the VS Code card on **My Agents** flips to **Connected** after the first agent call.

## Troubleshooting

* **cakewalk does not appear in MCP: List Servers:** confirm the JSON parses cleanly. The Command Palette command **MCP: Open User Configuration** or **MCP: Open Workspace Folder Configuration** reopens the right file for inspection.
* **OAuth window never opens:** check VS Code's Output panel for an MCP server log. Most cases are a missing `url` field or a typo in the gateway URL.

## Learn more

* [MCP servers in VS Code](https://code.visualstudio.com/docs/copilot/customization/mcp-servers) from Microsoft.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.cakewalk.security/docs/ai-agent-access/connections-and-integrations/agent-platforms/vs-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
