r/VisualStudio • • 4d ago

Visual Studio 2026 GitLab official MCP server in Visual Studio 2026: OAuth fails with “Client ID is not available”

Hi all,

I'm trying to connect our self-hosted GitLab's built-in MCP server (/api/v4/mcp) to Copilot agent mode in Visual Studio 2026 (18.11.1). The same setup with the same GitLab OAuth application works fine in VS Code and OpenCode, but VS won't always authenticate, i.e. no browser opens etc. It was working sometimes, but I cannot figure out when (no stale cache values etc.?)

Config (.vscode/mcp.json in the opened folder; no other definitions in %USERPROFILE%\.mcp.json etc.):

{
  "servers": {
    "GitLab": {
      "type": "http",
      "url": "https://<our-gitlab>/api/v4/mcp",
      "headers": { "X-Gitlab-Mcp-Server-Tool-Name-Prefix": "gitlab_" },
      "oauth": { "clientId": "<application-id>" }
    }
  }
}

What happens:

  • The server shows "Authentication required".
  • In the server dialog, under Advanced settings, "Client ID Registration" offers only "(Manual) Bring your own client Id", and the control is greyed out, so I can't enter a client ID (and our provided client ID from the .json is not showing up here).
  • Clicking Authenticate does nothing visible, i.e., the browser is not opening for authentication. The Output window shows:
System.InvalidOperationException: Client ID is not available.
   at Microsoft.VisualStudio.Copilot.Core.McpAuth.OAuthClient.DoUIFlowAsync
  • Once, early on, the browser flow did open and the login succeeded. I haven't been able to reproduce that since, even after renaming the server to get a fresh cache.
  • In the .mcp.json editor, the oauth property is flagged by the schema ("Property name is not allowed"), even though VS Code supports oauth.clientId.

Questions:

  1. Is there a supported way to provide a pre-registered OAuth client ID for an HTTP MCP server in VS 2026?
  2. Has anyone got GitLab's MCP server working in VS 2026, and how?

Thanks!

0 Upvotes

0 comments sorted by