mcp-sqlserver
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MSSQL_HOST | No | SQL Server hostname | |
| MSSQL_PORT | No | SQL Server port (default: 1433) | 1433 |
| MSSQL_USER | No | SQL auth username | |
| MSSQL_DATABASE | No | Default database | |
| MSSQL_PASSWORD | No | SQL auth password | |
| MSSQL_MCP_CONFIG | No | Path to YAML config file |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_serversA | List all configured SQL Server connections and their details (host, database, auth type, security mode) |
| list_databasesA | List all accessible databases on the SQL Server instance |
| list_schemasA | List all schemas in the current database |
| list_tablesA | List all tables in a database, optionally filtered by schema |
| list_viewsA | List all views in a database, optionally filtered by schema |
| describe_tableA | Get detailed column information for a table or view (columns, types, defaults, nullability, identity, computed) |
| get_foreign_keysC | Get foreign key relationships for a table |
| get_indexesC | Get index information for a table |
| get_constraintsB | Get constraints (PK, unique, check, default) for a table |
| get_triggersB | Get triggers defined on a table |
| execute_queryB | Execute a read-only SQL query (SELECT). Automatically applies row limits from configuration. |
| list_proceduresA | List all stored procedures in a database, optionally filtered by schema |
| describe_procedureA | Get parameter information and source code for a stored procedure |
| get_query_planA | Get the estimated execution plan for a SQL query (without executing it) |
| get_active_queriesB | Show currently running queries on the server (from sys.dm_exec_requests) |
| get_table_statsB | Get table statistics: row count, total size, index size, and fragmentation |
| get_index_usageC | Get index usage statistics: seeks, scans, lookups, and updates (from sys.dm_db_index_usage_stats) |
| get_missing_indexesC | Get missing index suggestions from SQL Server DMVs (sys.dm_db_missing_index_details) |
| get_server_infoA | Get SQL Server instance information: version, edition, OS, memory, CPU |
| get_database_infoC | Get detailed database information: size, files, status, recovery model |
| compare_schemasB | Compare schemas between two databases — shows tables, columns, and indexes that differ (useful for dev vs prod comparison) |
| generate_codeB | Generate TypeScript interface, C# class, or CREATE TABLE script from a table's schema |
| generate_insert_scriptsA | Generate INSERT statements from existing table data (for migration/seeding) |
| generate_er_diagramB | Generate a Mermaid ER diagram from database foreign key relationships |
| sample_tableA | Get a random sample of rows from a table (useful for understanding data patterns) |
| export_queryB | Execute a SELECT query and return results as CSV or JSON format |
| get_wait_statsB | Get top server wait statistics — identifies performance bottlenecks (CPU, I/O, locks, etc.) |
| get_deadlocksA | Get recent deadlock events from the system_health Extended Events session |
| get_blocking_chainsB | Show current blocking chains — which sessions are blocking others |
| get_long_transactionsB | Show long-running open transactions that may be holding locks |
| get_space_usageC | Get detailed disk space usage by table in a database |
| get_backup_historyB | Get recent backup history for a database from msdb |
| get_query_store_statsA | Get top resource-consuming queries from Query Store (SQL Server 2016+). Query Store must be enabled on the database. |
| generate_test_dataB | Generate INSERT statements with realistic fake/test data based on table schema |
| health_checkC | Check SQL Server connection health and basic responsiveness |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 35 tools
Most tools target a distinct resource/action (e.g., list_tables vs describe_table vs get_indexes), and performance monitoring tools are separated by clear DMV-based descriptions. However, execute_query, export_query, and sample_table all execute or return query results, so an agent could sometimes confuse which one to use.
All tool names follow a consistent verb_noun snake_case pattern, such as list_tables, get_indexes, describe_procedure, and compare_schemas. There is no mixing of naming conventions or vague generic verbs.
With 35 tools, the surface is well beyond the typical well-scoped range and falls into the 25+ too-many category. While tools cover distinct areas, several could be consolidated or grouped into parameterized tools to reduce cognitive load.
The toolkit provides broad read-only coverage of SQL Server metadata, querying, schema generation, and performance monitoring, with no major dead ends for that scope. Missing write/DDL tools and user/permission introspection are notable but appear outside this server's read-only intent.