v1.3.0 — Multi-Server Support
Multi-Server Support
Define multiple named SQL Server connections (dev, staging, prod) in a single config file and switch between them with the server parameter on any tool call. Fully backward compatible — existing single-server configs work without any changes.
New Config Format
Use connections (plural) to define multiple servers:
defaultServer: dev
connections:
dev:
host: dev-server.example.com
database: MyDatabase
authentication:
type: sql
user: sa
password: DevPass123
security:
mode: admin
maxRowCount: 5000
prod:
host: prod-server.example.com
database: MyDatabase
authentication:
type: sql
user: readonly_user
password: ProdReadOnly
security:
mode: readonly
blockedDatabases: [master, msdb, tempdb, model]
# Global security defaults (applied to all servers unless overridden)
security:
maxRowCount: 1000
blockedKeywords: [xp_cmdshell, SHUTDOWN, DROP DATABASE]New Tool
| Tool | Description |
|---|---|
list_servers |
List all configured server connections with host, database, auth type, and security mode |
server Parameter on All Tools
Every existing tool now accepts an optional server parameter:
list_tables(server: "prod", database: "MyDatabase")
health_check(server: "dev")
execute_query(server: "prod", sql: "SELECT TOP 10 * FROM Orders")
compare_schemas(server: "dev", source_database: "DevDB", target_database: "StagingDB")
Omit server to use the defaultServer from config.
Per-Server Security
Each server can have its own security configuration:
- Security mode (readonly / readwrite / admin)
- Max row count
- Blocked databases
- Allowed/blocked schemas
- Column masking rules
Global security block serves as defaults; per-server security overrides specific settings.
Architecture
- Connection pools are now keyed by server name — each server gets its own dedicated pool
- DDL tools are registered if any configured server allows DDL (per-server permission check inside each handler)
- Environment variables (
MSSQL_HOST,MSSQL_PASSWORD, etc.) apply to the default server only
Files Changed
| File | Change |
|---|---|
src/config.ts |
New AppConfig type with servers map + resolveServer() helper + multi-server config loader |
src/database.ts |
Pool Map<string, ConnectionPool> keyed by server name |
src/server.ts |
New list_servers tool, DDL registration checks all servers |
src/index.ts |
Startup logging lists all configured servers |
src/tools/*.ts |
All 38 tools now accept optional server parameter |
config.example.yaml |
Multi-server configuration example added |
README.md |
v1.3 What's New, Server Management section, Multi-Server Configuration docs |
Stats
- 38 tools (37 existing + 1 new
list_servers) - 15 files changed, +681 / -245 lines
- 100% backward compatible — single-server
connectionformat still works
Full Changelog: v1.2.3...v1.3.0