Skip to content

Troubleshooting

Environment variables are not configured or are incorrect.

Ventana de terminal
echo "Server: $MSSQL_SERVER"
echo "Database: $MSSQL_DATABASE"
echo "User: $MSSQL_USER"

”TLS handshake failed” / “Certificate signed by unknown authority”

Section titled “”TLS handshake failed” / “Certificate signed by unknown authority””

Development: Set DEVELOPER_MODE=true to accept self-signed certificates.

SQL Server 2008/2012: These servers don’t support TLS 1.2. Add MSSQL_ENCRYPT=false together with DEVELOPER_MODE=true.

Ventana de terminal
DEVELOPER_MODE=true
MSSQL_ENCRYPT=false

Production: Install valid SSL certificates on SQL Server or configure the CA on the system.

  • Verify username and password
  • Confirm that SQL Server is in mixed authentication mode (SQL + Windows)
  • Verify that the user has access to the specified database

”Network error” / “Connection refused”

Section titled “”Network error” / “Connection refused””
  • Confirm that SQL Server is listening on the correct port (default 1433)
  • Check firewall rules
  • Verify that the SQL Server service is running

The query is trying to modify data and MSSQL_READ_ONLY=true is active. If you need to modify specific tables, add them to MSSQL_WHITELIST_TABLES.

The table referenced in a write operation is not in MSSQL_WHITELIST_TABLES. Check the exact table name.

Verify that SQL Server accepts Windows authentication and that the Windows user has a configured login.

When Claude receives a “Database not connected” error, it can now automatically call get_database_info to obtain:

  • Current configuration: server, database, authentication mode, encryption, port
  • Possible causes: missing variables, TLS incompatibility, permission issues
  • Specific solutions: based on the detected scenario (SQL 2008, integrated auth, etc.)

This allows Claude to diagnose and resolve connection issues without manual intervention.

Ventana de terminal
cd test
go run test-connection.go