npm install -g @bilims/mcp-sqlserverAdd to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"sqlserver": {
"command": "mcp-sqlserver",
"env": {
"SQLSERVER_HOST": "your-server",
"SQLSERVER_USER": "your-username",
"SQLSERVER_PASSWORD": "your-password",
"SQLSERVER_DATABASE": "your-database"
}
}
}
}"Test the SQL Server connection"
"Test the SQL Server connection""Show me server information""List all databases"
"What tables are in this database?""Describe the Users table structure""Show me foreign key relationships"
"Give me a sample from the Orders table""What are the largest tables?""Show me tables with the most rows"
"env": {
"SQLSERVER_HOST": "myserver.database.windows.net",
"SQLSERVER_ENCRYPT": "true",
"SQLSERVER_TRUST_CERT": "false"
}"env": {
"SQLSERVER_HOST": "sql-server.company.com",
"SQLSERVER_ENCRYPT": "true",
"SQLSERVER_TRUST_CERT": "true"
}"env": {
"SQLSERVER_HOST": "localhost\\SQLEXPRESS",
"SQLSERVER_ENCRYPT": "false",
"SQLSERVER_TRUST_CERT": "true"
}| Tool | Purpose |
|---|---|
test_connection |
Test connectivity and permissions |
list_databases |
Show all databases |
list_tables |
Show tables in database/schema |
describe_table |
Get table structure details |
execute_query |
Run SELECT queries safely |
get_foreign_keys |
Show table relationships |
get_server_info |
Get SQL Server version info |
get_table_stats |
Get table size and row counts |
✅ Read-only operations only
✅ SQL injection protection
✅ Query validation
✅ Encrypted connections
✅ Row limits enforced
- Check server hostname/IP
- Verify username/password
- Confirm network access
- Check firewall settings
- Ensure user has SELECT permissions
- Check database exists
- Verify schema access
- Use LIMIT in queries
- Focus on specific tables
- Check table sizes first
- Full Documentation: README.md
- Usage Examples: examples/usage-examples.md
- Installation Guide: INSTALL.md
- GitHub: https://github.com/bilims/mcp-sqlserver
- npm: https://www.npmjs.com/package/@bilims/mcp-sqlserver
Need help? Open an issue on GitHub