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

# Getting Started with VS Code

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

# Getting Started with VS Code

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

## Prerequisites

Before you begin, ensure you have:

1. **OpenMetadata v1.8.0+** running
2. **MCP Application** installed in OpenMetadata
   * Navigate to `<YOUR-OpenMetadata-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 OpenMetadata 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/openmetadata/oMrqaOqRCTd0vWNF/public/images/how-to-guides/mcp/vscode-mcp-add-server.png?fit=max&auto=format&n=oMrqaOqRCTd0vWNF&q=85&s=b3313cb4e159e608b54598c945d7f584" 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 OpenMetadata MCP Server URL:

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

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

### Step 4: Name Your Server

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

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

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

<img noZoom src="https://mintcdn.com/openmetadata/oMrqaOqRCTd0vWNF/public/images/how-to-guides/mcp/vscode-oauth-mcp-json.png?fit=max&auto=format&n=oMrqaOqRCTd0vWNF&q=85&s=906a2b7194fff680429c50b3e34d1488" 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 OpenMetadata 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 OpenMetadata username and password

Once authenticated, VS Code connects to your OpenMetadata 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](/v1.12.x/how-to-guides/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": {
    "OpenMetadata": {
      "url": "https://<YOUR-OpenMetadata-SERVER>/mcp",
      "type": "http",
      "headers": {
        "Authorization": "Bearer <YOUR-OpenMetadata-PAT>"
      }
    }
  }
}
```

Replace `<YOUR-OpenMetadata-SERVER>` with your OpenMetadata instance URL and `<YOUR-OpenMetadata-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 OpenMetadata?"

> "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 OpenMetadata MCP tools to search and retrieve information from your metadata catalog.

## Troubleshooting

If you encounter connection issues:

1. **Verify OpenMetadata is running**: `curl <YOUR-OpenMetadata-SERVER>/api/health`
2. **Check MCP endpoint**: `curl <YOUR-OpenMetadata-SERVER>/mcp` (should return 401)
3. **Verify MCP Application is installed**: Visit `<YOUR-OpenMetadata-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

* [OpenMetadata MCP Documentation](/v1.12.x/how-to-guides/mcp)
* [OAuth 2.0 Authentication](/v1.12.x/how-to-guides/mcp/oauth)
* [MCP Protocol Specification](https://modelcontextprotocol.io)
* [VS Code MCP Documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)
