Skip to main content

Visual Studio Code

VS Code MCP Integration

VS Code with GitHub Copilot supports MCP servers natively. For detailed configuration instructions, visit the official documentation.

Setting up OAuth

Connecting with OAuth lets VS Code sign you in through your organization's identity provider automatically, using MCP OAuth with Dynamic Client Registration (DCR). For the full client and admin setup, follow the OAuth Setup guide.

VS Code is a strict MCP client - it validates the server's OAuth metadata with an exact URL match, so it's important to use the full server URL, including the trailing slash.

Add the MCP Server​

  1. Create (or edit) .vscode/mcp.json in your workspace - or run MCP: Add Server from the Command Palette:

    {
    "servers": {
    "timbr": {
    "type": "http",
    "url": "https://<your-timbr-server>/timbr/api/mcp/"
    }
    }
    }

    No x-api-key header is required - VS Code triggers the OAuth flow automatically when the server responds with 401 Unauthorized.

  2. Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) → MCP: List Servers → select timbr → Start Server.

  3. VS Code discovers the OAuth endpoints automatically via Dynamic Client Registration and opens your browser so you can sign in through your organization's identity provider.

    Sign in via your identity provider

Setting up OAuth

Make sure the required redirect URIs are registered with your identity provider, and that the full MCP OAuth setup is in place. Follow the OAuth Setup guide for more information.

  1. Once connected, Timbr's tools (query_data, ask_question, generate_sql, identify_concept, and more) become available to GitHub Copilot Chat in Agent Mode.
Dynamic Client Registration

VS Code registers as a public OAuth client (token_endpoint_auth_method: "none") using one of these redirect URIs: http://127.0.0.1/, http://127.0.0.1:33418/, https://vscode.dev/redirect, https://insiders.vscode.dev/redirect. If your identity provider (e.g. Azure AD) doesn't natively support Dynamic Client Registration, your IT admin can enable it on the server by setting MCP_OAUTH_DCR_ENABLED=true together with MCP_OAUTH_CLIENT_ID and MCP_OAUTH_CLIENT_SECRET, and register the redirect URIs above on the identity provider app. See the OAuth Setup guide for the complete provider configuration.

Troubleshooting​

ErrorCauseFix
"User did not provide client details" promptDynamic Client Registration failed, so VS Code fell back to a manual client-details promptEnable DCR on the server (MCP_OAUTH_DCR_ENABLED=true), or supply the client ID/secret when prompted
Connection fails right after the initial 401The configured server URL doesn't exactly match the OAuth resource metadata (trailing slash mismatch)Use the exact URL https://<your-timbr-server>/timbr/api/mcp/, including the trailing slash
AADSTS50011 in browserRedirect URI not registered on the identity provider appAdd the VS Code redirect URIs listed above to the app registration
Nothing happens after Start ServerFlow stuck at discoveryCheck Output panel → MCP: timbr for the detailed request/response log

API Key Authentication​

If interactive sign-in isn't practical - for example on a shared machine - you can connect with a static Timbr API key instead of OAuth.

Option 1: GitHub Copilot MCP Integration​

VS Code with GitHub Copilot supports MCP servers natively. Configure in your workspace or user settings:

Workspace Configuration (.vscode/mcp.json)​

{
"servers": {
"timbr": {
"type": "http",
"url": "https://<your-timbr-server>/timbr/api/mcp/",
"headers": {
"x-api-key": "${env:TIMBR_API_KEY}"
}
}
}
}

With Default Agent​

{
"servers": {
"timbr": {
"type": "http",
"url": "https://<your-timbr-server>/timbr/api/mcp/",
"headers": {
"x-api-key": "${env:TIMBR_API_KEY}",
"x-agent": "agent_name"
}
}
}
}

With Default Ontology​

{
"servers": {
"timbr": {
"type": "http",
"url": "https://<your-timbr-server>/timbr/api/mcp/",
"headers": {
"x-api-key": "${env:TIMBR_API_KEY}",
"x-ontology": "my_ontology"
}
}
}
}

User Settings Configuration​

Add to your VS Code settings.json:

{
"github.copilot.chat.mcp.servers": {
"timbr": {
"type": "http",
"url": "https://<your-timbr-server>/timbr/api/mcp/",
"headers": {
"x-api-key": "${env:TIMBR_API_KEY}",
"x-ontology": "my_ontology"
}
}
}
}

Option 2: Generic MCP Extension​

If using a third-party MCP extension, create a configuration file as specified by the extension. Most extensions support a similar format:

With Agent​

{
"mcpServers": {
"timbr": {
"transport": "http",
"url": "https://<your-timbr-server>/timbr/api/mcp/",
"headers": {
"x-api-key": "tk_your_api_key_here",
"x-agent": "agent_name"
}
}
}
}

With Ontology​

{
"mcpServers": {
"timbr": {
"transport": "http",
"url": "https://<your-timbr-server>/timbr/api/mcp/",
"headers": {
"x-api-key": "tk_your_api_key_here",
"x-ontology": "my_ontology"
}
}
}
}

Environment Variable Setup (Windows)​

Set the API key as an environment variable:

# PowerShell (current session)
$env:TIMBR_API_KEY = "tk_your_api_key_here"

# PowerShell (permanent - user level)
[Environment]::SetEnvironmentVariable("TIMBR_API_KEY", "tk_your_api_key_here", "User")

Environment Variable Setup (macOS/Linux)​

# Current session
export TIMBR_API_KEY="tk_your_api_key_here"

# Permanent (add to ~/.bashrc or ~/.zshrc)
echo 'export TIMBR_API_KEY="tk_your_api_key_here"' >> ~/.zshrc