MS SQL Server MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DB_PORT | No | SQL Server port | 1433 |
| DB_USER | No | Username | |
| DB_SERVER | Yes | SQL Server hostname | |
| DB_ENCRYPT | No | Enable TLS encryption (required for Azure SQL) | true |
| DB_DATABASE | No | Database name | |
| DB_PASSWORD | No | Password | |
| DB_REQUEST_TIMEOUT | No | Request timeout (ms) | 30000 |
| DB_CONNECTION_TIMEOUT | No | Connection timeout (ms) | 30000 |
| DB_TRUST_SERVER_CERTIFICATE | No | Trust self-signed certificates | 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
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| mssql_connect_databaseA | Connects to MS SQL Server using environment variables (DB_SERVER, DB_DATABASE, DB_USER, DB_PASSWORD, DB_PORT, DB_ENCRYPT, DB_TRUST_SERVER_CERTIFICATE). No credentials accepted as parameters — all connection settings come from the server environment only. Idempotent: calling again reconnects. |
| mssql_disconnect_databaseA | Closes the current database connection and releases the connection pool. Safe to call even if not connected. Idempotent. |
| mssql_connection_statusA | Returns the current connection status, server address, database name, and connection pool metrics. Read-only. Safe to call at any time. |
| mssql_run_sql_queryA | Executes an arbitrary SQL statement against the connected database. ⚠️ WARNING: This tool can read AND modify data (INSERT, UPDATE, DELETE, DDL). Always prefer parameterized inputs via the 'parameters' field — never embed user-supplied values directly in the query string. Example: query='SELECT * FROM dbo.Users WHERE Id = @id', parameters={id: 42} |
| mssql_execute_queryA | Deprecated alias for mssql_run_sql_query. Use mssql_run_sql_query instead. ⚠️ This tool can read AND modify data. |
| mssql_list_schema_objectsA | Lists tables, views, stored procedures, or functions in the connected database. Read-only. Supports filtering by schema name and pagination. Example: objectType='tables', schemaName='dbo', limit=20 |
| mssql_get_schemaA | Deprecated alias for mssql_list_schema_objects. Use mssql_list_schema_objects instead. |
| mssql_describe_table_columnsA | Returns column definitions for a table: name, data type, length, nullability, default, and ordinal position. Read-only. Uses parameterized queries to prevent injection. |
| mssql_describe_tableA | Deprecated alias for mssql_describe_table_columns. |
| mssql_read_table_rowsA | Returns rows from a table with optional column projection, WHERE filtering, ORDER BY, and pagination. Read-only. Table and schema names are validated as safe identifiers. WHERE clause values MUST be passed via 'parameters' using @paramName placeholders. Pagination: limit (1-200, default 20) and offset. Example: tableName='Orders', schemaName='dbo', columns=['OrderId','Total'], limit=50 |
| mssql_get_table_dataA | Deprecated alias for mssql_read_table_rows. Use mssql_read_table_rows instead. ⚠️ whereClause must use @paramName placeholders for all values. |
| mssql_execute_stored_procedureA | Executes a stored procedure by name. ⚠️ May modify data — use only when an action is intended. Schema and procedure names are validated as safe identifiers. Pass all value parameters via 'parameters'. |
| mssql_execute_procedureA | Deprecated alias for mssql_execute_stored_procedure. |
| mssql_list_databasesA | Lists all databases visible on the connected SQL Server instance with state and recovery information. Read-only. Supports pagination. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| connection-info | Current MSSQL connection status and configuration (no credentials exposed). |
| databases | Snapshot list of all databases on the SQL Server instance. |
| schemas | Snapshot list of all schemas in the current database. |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bymcs/mssql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server