SQL-AI-samples icon indicating copy to clipboard operation
SQL-AI-samples copied to clipboard

Browser opens for authentication while using sql or windows auth type

Open christophedemey opened this issue 4 months ago • 2 comments

Hi

How do we circumvent this behaviour, this is not required for windows or sql authentication.

Thanks

christophedemey avatar Sep 19 '25 08:09 christophedemey

Are you using Linux/WSL? If so, I got this to work by:

  1. install dotnet in WSL
  2. Clone repo and build the dotnet version
  3. Update .claude.json
"mcpServers": {
		  "mssql": {
			"command": "/usr/bin/dotnet",
			"args": ["/home/myuser/repos/SQL-AI-samples/MssqlMcp/dotnet/MssqlMcp/bin/Debug/net8.0/MssqlMcp.dll"],
			"env": {
			  "CONNECTION_STRING": "Server=host.docker.internal,1433;Database=DB;User Id=sa;Password=yourpassword;TrustServerCertificate=true;"
			}
		}

If you are using Windows and Claude Desktop, the config would be:

mcpServers": {
"mssql": { 
			"type": "stdio",
			"command": "C:\\Users\\youruser\\repos\\SQL-AI-samples\\MssqlMcp\\dotnet\\MssqlMcp\\bin\\Debug\\net8.0\\MssqlMcp.exe", 
			"args": [ ],
			"env": { 
"CONNECTION_STRING":"Server=localhost,1434;Database=DB;Trusted_Connection=False;TrustServerCertificate=True;UID=sa;PWD=yourpwd"
			}
		 }
}

TjWheeler avatar Sep 19 '25 09:09 TjWheeler

I am on windows using vscode and claude sonnet 4 with copilot.

		"sql": {
			"type": "stdio",
			"command": "node",
			"args": [
				"C:/src/SQL-AI-samples-main/MssqlMcp/Node/dist/index.js"
			],
			"env": {
				"SERVER_NAME": "my-host.com",
				"DATABASE_NAME": "my-database",
				"READONLY": "true",
				"AUTH_TYPE": "sql",
				"TRUST_SERVER_CERTIFICATE": "true",
				"SQL_USER": "sa",
				"SQL_PASSWORD": "AmazingPassword"
			

christophedemey avatar Sep 19 '25 09:09 christophedemey