SQL Server MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DB_NAME | No | Database name for single database configuration. | |
| DB_USER | No | SQL Server username for single database configuration. | |
| DB_SERVER | No | SQL Server host or instance for single database configuration. | |
| DB_PASSWORD | No | SQL Server password for single database configuration. | |
| DB_CONNECTIONS | No | JSON array string of connection objects. Used as an alternative to CONNECTIONS_FILE or individual DB_* variables. | |
| CONNECTIONS_FILE | No | Path to a JSON file containing an array of connection objects. Used as an alternative to DB_CONNECTIONS. |
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 | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| sql_run_queryA | Execute a SELECT query against the configured SQL Server database and return formatted results. Only SELECT statements are allowed here — for writes, use sql_run_write. |
| sql_run_writeA | Execute a write SQL statement (INSERT, UPDATE, DELETE, DROP TABLE, ALTER TABLE, CREATE, TRUNCATE, EXEC stored proc, etc.). IMPORTANT PERMISSION RULE:
Always call with confirm=false first to show the user what will happen, then call again with confirm=true only after the user explicitly approves. |
| sql_list_tablesA | List all user tables (and optionally views) in the active database, with row counts. |
| sql_inspect_tableA | Show full details about a table: columns with types/nullability/defaults, primary keys, foreign keys, indexes, and row count. |
| sql_list_stored_procsB | List all stored procedures in the active database. |
| sql_get_stored_proc_defC | Get the full definition (source code) of a stored procedure. |
| sql_find_dataA | Search for a value across all (or specific) columns in a table. Useful when you know a value exists but don't know which column it's in. |
| sql_check_foreign_keysA | Find foreign key violations in a table — records that reference non-existent parent rows (orphaned data). Very useful for diagnosing referential integrity issues. |
| sql_count_and_sampleB | Get the row count and a sample of rows from a table. Useful for quickly understanding what data exists without writing a full query. |
| sql_check_nullsB | Find rows with NULL values in specified columns. Useful for finding missing/incomplete data that might be causing bugs. |
| sql_compare_countsA | Compare row counts between a parent and child table (joined by FK) to detect missing or extra records. Useful for finding data gaps. |
| sql_diagnose_issueB | Run a comprehensive diagnostic on a table: counts, NULLs in all columns, FK violations, and recent rows. Great starting point when you notice something wrong. |
| sql_get_query_planA | Get the estimated execution plan for a SELECT query as text (SET SHOWPLAN_ALL). Useful for diagnosing slow queries. |
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 13 tools
Each tool targets a clearly distinct purpose: listing tables, inspecting schemas, running queries, writes, diagnostics, data exploration, and plan inspection. The 'find_data', 'check_nulls', 'check_foreign_keys', and 'compare_counts' tools are individually distinguishable by their focused data-quality functions, and even the three diagnostic tools have clear boundaries.
All tools follow a consistent 'sql_' prefix followed by verb_noun patterns (get_stored_proc_def, inspect_table, run_query, run_write, list_tables, check_nulls, compare_counts, diagnose_issue). The naming convention is uniform and predictable throughout all 13 tools.
13 tools is a well-scoped set for a SQL Server MCP server. Each tool covers a distinct capability area: navigation, inspection, execution, diagnostics, and performance tuning. No redundancy and no obvious bloat; the count feels appropriate for the breadth of operations a SQL server agent needs.
The surface covers the core workflows well: listing objects, inspecting schemas, querying data, writing data, and running diagnostics. Minor gaps exist — there's no tool for viewing indexes in isolation, no tool for listing views separately from tables, and no explicit transaction-control capability, but these are edge cases agents can typically work around.