-
Notifications
You must be signed in to change notification settings - Fork 39k
MCP client authenticate using Kerberos/NTLM if the server replies with WWW-Authenticate: Negotiate #291587
Description
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:
- Set-up MCP connection string in VS Code
- 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.