> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcollate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started with VS Code

> Connect your Collate MCP Server to Visual Studio Code for AI-powered metadata exploration.

# Getting Started with VS Code

Connect your Collate instance to Visual Studio Code for AI-powered metadata exploration using GitHub Copilot's MCP support.

## Prerequisites

Before you begin, ensure you have:

1. **Collate v1.8.0+** running
2. **MCP Application** installed in Collate
   * Navigate to `<YOUR-Collate-SERVER>/marketplace/apps/McpApplication`
   * Install **McpApplication** if not already installed
3. **Visual Studio Code** with MCP support enabled

## Connect with OAuth 2.0 (Recommended)

OAuth lets you authenticate using your existing Collate login, with no tokens to manage.

### Step 1: Open the Command Palette

Open VS Code and launch the Command Palette:

* **macOS**: `Cmd + Shift + P`
* **Windows/Linux**: `Ctrl + Shift + P`

Search for **MCP: Add Server...** and select it.

<img noZoom src="https://mintcdn.com/collatedocs/img23MnO9HDWyvbG/public/images/how-to-guides/mcp/vscode-mcp-add-server.png?fit=max&auto=format&n=img23MnO9HDWyvbG&q=85&s=81fcd617f891eb6d6071ef3416124910" alt="VS Code Command Palette showing MCP: Add Server" width="1230" height="738" data-path="public/images/how-to-guides/mcp/vscode-mcp-add-server.png" />

### Step 2: Select HTTP Type

When prompted, choose **HTTP** as the server type.

### Step 3: Enter Your MCP Server URL

Enter your Collate MCP Server URL:

```
https://<YOUR-Collate-SERVER>/mcp
```

For example: `https://your-collate-instance.com/mcp`

### Step 4: Name Your Server

Give your MCP server a name (e.g., `Collate`).

VS Code will automatically generate the configuration in your `mcp.json` file:

```json theme={null}
{
  "servers": {
    "Collate": {
      "url": "https://<YOUR-Collate-SERVER>/mcp",
      "type": "http"
    }
  },
  "inputs": []
}
```

<img noZoom src="https://mintcdn.com/collatedocs/img23MnO9HDWyvbG/public/images/how-to-guides/mcp/vscode-oauth-mcp-json.png?fit=max&auto=format&n=img23MnO9HDWyvbG&q=85&s=0a77b1f359c71ba5e6b636c76e15074e" alt="VS Code mcp.json with generated MCP server configuration" width="1314" height="574" data-path="public/images/how-to-guides/mcp/vscode-oauth-mcp-json.png" />

### Step 5: Authenticate

VS Code will open a browser window prompting you to sign in with your Collate credentials. Follow the on-screen instructions based on your configured authentication method:

* **SSO (Google, Azure, Okta, etc.)**: You will be redirected to your SSO provider's login page
* **Basic Auth**: Enter your Collate username and password

Once authenticated, VS Code connects to your Collate MCP Server automatically.

<Note>
  The `mcp.json` configuration file is located at:

  * **macOS**: `~/Library/Application Support/Code/User/mcp.json`
  * **Linux**: `~/.config/Code/User/mcp.json`
  * **Windows**: `%APPDATA%\Code\User\mcp.json`
</Note>

## Connect with Personal Access Token (PAT)

If you prefer token-based authentication or OAuth is not available in your environment, you can use a Personal Access Token.

### Step 1: Generate a PAT

Follow the [Personal Access Token guide](/collate-ai/mcp#adding-a-personal-access-token-to-your-mcp-client) to generate your token.

### Step 2: Configure MCP Server

Open the Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`), search for **MCP: Add Server...**, select **HTTP**, and enter your server URL.

Then edit the generated `mcp.json` to include your authorization header:

```json theme={null}
{
  "servers": {
    "Collate": {
      "url": "https://<YOUR-Collate-SERVER>/mcp",
      "type": "http",
      "headers": {
        "Authorization": "Bearer <YOUR-Collate-PAT>"
      }
    }
  }
}
```

Replace `<YOUR-Collate-SERVER>` with your Collate instance URL and `<YOUR-Collate-PAT>` with your Personal Access Token.

## Try It Out

Once connected, test your setup by asking questions in VS Code's Copilot chat:

> "What tables do you have access to in Collate?"

> "Imagine you're a data analyst tasked with building a customer retention dashboard. Find relevant customer and transaction tables in the metadata catalog."

You should see VS Code using the Collate MCP tools to search and retrieve information from your metadata catalog.

## Troubleshooting

If you encounter connection issues:

1. **Verify Collate is running**: `curl <YOUR-Collate-SERVER>/api/health`
2. **Check MCP endpoint**: `curl <YOUR-Collate-SERVER>/mcp` (should return 401)
3. **Verify MCP Application is installed**: Visit `<YOUR-Collate-SERVER>/marketplace/apps/McpApplication`
4. **Re-authenticate**: Remove and re-add the server in VS Code to trigger a fresh OAuth login
5. **Check configuration file**: Ensure `mcp.json` has valid JSON syntax
6. **Restart VS Code** after making configuration changes

## Additional Resources

* [Collate MCP Documentation](/collate-ai/mcp)
* [OAuth 2.0 Authentication](/collate-ai/mcp/oauth)
* [MCP Protocol Specification](https://modelcontextprotocol.io)
* [VS Code MCP Documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)
