sql-server-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_MAX_ROWS | No | Max rows returned per tool call (default: 25) | 25 |
| MCP_SQL_PASSWORD | No | SQL login password. Must be set together with `MCP_SQL_USERNAME` | |
| MCP_SQL_USERNAME | No | SQL login username. If set, the server uses username + password authentication instead of Entra ID (and `MCP_AZURE_TENANT_ID` is not needed) | |
| MCP_SQL_LEGACY_TLS | No | Set to `true` for old SQL Server hosts (e.g. SQL Server 2012) that reset the connection during the TLS handshake (`TCP Provider: Error code 0x2746`). Lowers OpenSSL's security level to 0 for this process (and its child processes), so it requires SQL login and is best avoided elsewhere. Default: `false` | false |
| MCP_AZURE_TENANT_ID | No | The Entra ID tenant ID — pins auth to this directory even if your machine has other `az login` sessions active | |
| MCP_SQL_SERVER_NAME | Yes | SQL Server / Fabric SQL endpoint hostname, e.g. `xyz-xyz.datawarehouse.fabric.microsoft.com` | |
| MCP_SQL_DATABASE_NAME | Yes | Default database to connect to | |
| MCP_SQL_TRUST_SERVER_CERTIFICATE | No | Set to `true` to skip server certificate validation (needed for servers with self-signed or otherwise untrusted certificates, e.g. older on-prem SQL Server). Default: `false` | false |
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
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| extensions | {
"io.modelcontextprotocol/ui": {}
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| queryA | Execute a single read-only SELECT statement. Returns at most 25 rows. Table references must be fully qualified as database.schema.table - there is no mutable 'active database'. |
| list_databasesA | List all user databases with status and metadata. Returns at most 25 rows. |
| search_schemaB | Search table or column metadata across databases via INFORMATION_SCHEMA. Omit |
| export_queryA | Execute a single read-only SELECT statement and write the full, uncapped result to a local Parquet or CSV file instead of returning it. Use this instead of |
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 4 tools
Each tool has a clearly distinct purpose: `query` for capped inline SELECTs, `export_query` for uncapped file output, `list_databases` for database enumeration, and `search_schema` for metadata lookup. The `query` vs `export_query` overlap is explicitly resolved by the description telling agents to prefer `export_query` for large results.
Three tools follow a clear verb_noun pattern (`list_databases`, `search_schema`, `export_query`), while `query` is a bare verb/noun that slightly breaks the pattern. The deviation is minor and still readable in context.
Four tools is well-scoped for a read-only SQL server interface, with each tool covering a distinct essential workflow: querying, exporting, listing databases, and searching schema metadata. Nothing feels redundant or missing at the count level.
The surface covers core read-only workflows well, including capped queries, large exports, database listing, and schema discovery via INFORMATION_SCHEMA. Minor gaps exist around dedicated table listing or describe-table convenience tools, but `search_schema` provides a workable path for those needs.