Skip to content

MCP client authenticate using Kerberos/NTLM if the server replies with WWW-Authenticate: Negotiate #291587

@dagirard

Description

@dagirard

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.108.2
  • OS Version: 25HW 26200.7634

Some server software runs locally for development. This is typical for ERP software for example.
Those servers may offer a remote Http Streamable MCP implementation out of the box.

For example:

"MyServer": {
  "url": "http://localhost:7047/mcp",
  "type": "http",
  "headers": {
      "ServerHeader": "Sample"
  }
}

Those on-prem servers usually uses Windows authentication for APIs.

Repro step:

  1. Set-up MCP connection string in VS Code
  2. VS Code tries to authenticate to the server, it fails and it receives an HTTP 401 with WWW-Authenticate set to "Negotiate"

Expected:
VS Code see the WWW-Authenticate header set to "Negotiate", and it tries to use current user Windows authentication to connect to the MCP server. Which, succeed.

Actual:
VS Code initiate the MCP authorization flow. Trying to request all the .well-known etc... which are failing with HTTP 404. Then it falls back, and still ask the user to provide a client ID.
At the end, authentication failed and VSCode cannot connect.

Current workaround:
Using Fiddler as proxy, with the "Automatically Authenticate" feature enabling. So Fiddler automatically authenticate with the local MCP server and everything works fine.
But, if anything goes wrong, VS Code must be restarted. It is not a nice experience.
Remark: You must change localhost with your hostname, so the call goes through Fiddler proxy.

Metadata

Metadata

Labels

authenticationIssues with the Authentication platformchat-mcpfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions