mssql-mcp
v3.0.0MCP Server for MS SQL Server integration with Claude Desktop, Cursor, Windsurf and VS Code
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
mssql_connect_database Connect Database
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_database Disconnect Database
Closes the current database connection and releases the connection pool. Safe to call even if not connected. Idempotent.
mssql_connection_status Connection Status
Returns the current connection status, server address, database name, and connection pool metrics. Read-only. Safe to call at any time.
mssql_run_sql_query Run SQL Query
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}
| Parameter | Type | Description |
|---|---|---|
query * | string | SQL statement to execute |
parameters | object | Named parameters referenced in the query via @paramName |
response_format | string | Output format: 'json' for structured data, 'markdown' for human-readable table |
mssql_execute_query Execute Query (deprecated — use mssql_run_sql_query)
Deprecated alias for mssql_run_sql_query. Use mssql_run_sql_query instead. ⚠️ This tool can read AND modify data.
| Parameter | Type | Description |
|---|---|---|
query * | string | SQL query to execute |
parameters | object | Query parameters |
response_format | string |
mssql_list_schema_objects List Schema Objects
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
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max objects (default 20) |
objectType | string | Type of objects to list (default: tables) |
offset | integer | Skip N objects |
response_format | string | Output format: 'json' for structured data, 'markdown' for human-readable table |
schemaName | string | Filter to a specific schema (e.g. 'dbo') |
mssql_get_schema Get Schema (deprecated — use mssql_list_schema_objects)
Deprecated alias for mssql_list_schema_objects. Use mssql_list_schema_objects instead.
| Parameter | Type | Description |
|---|---|---|
objectType | string | |
response_format | string | |
schemaName | string |
mssql_describe_table_columns Describe Table Columns
Returns column definitions for a table: name, data type, length, nullability, default, and ordinal position. Read-only. Uses parameterized queries to prevent injection.
| Parameter | Type | Description |
|---|---|---|
tableName * | string | Table name |
response_format | string | Output format: 'json' for structured data, 'markdown' for human-readable table |
schemaName | string | Schema name (default: dbo) |
mssql_describe_table Describe Table (deprecated — use mssql_describe_table_columns)
Deprecated alias for mssql_describe_table_columns.
| Parameter | Type | Description |
|---|---|---|
tableName * | string | |
response_format | string | |
schemaName | string |
mssql_read_table_rows Read Table Rows
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
| Parameter | Type | Description |
|---|---|---|
tableName * | string | Table name |
columns | array | Columns to return (default: all) |
limit | integer | Max rows (1-200) |
offset | integer | Rows to skip |
orderBy | string | ORDER BY expression. Example: 'CreatedAt DESC, Id ASC' |
parameters | object | Values for WHERE clause @paramName placeholders |
response_format | string | Output format: 'json' for structured data, 'markdown' for human-readable table |
schemaName | string | Schema name (default: dbo) |
whereClause | string | WHERE predicate without WHERE keyword. Use @paramName for all values. Example: 'Status = @status AND Amount > @minAmount' |
mssql_get_table_data Get Table Data (deprecated — use mssql_read_table_rows)
Deprecated alias for mssql_read_table_rows. Use mssql_read_table_rows instead. ⚠️ whereClause must use @paramName placeholders for all values.
| Parameter | Type | Description |
|---|---|---|
tableName * | string | |
limit | integer | |
offset | integer | |
orderBy | string | |
parameters | object | |
response_format | string | |
schemaName | string | |
whereClause | string |
mssql_execute_stored_procedure Execute Stored Procedure
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'.
| Parameter | Type | Description |
|---|---|---|
procedureName * | string | Stored procedure name |
parameters | object | Procedure input parameters (key-value pairs) |
response_format | string | Output format: 'json' for structured data, 'markdown' for human-readable tables |
schemaName | string | Schema name (default: dbo) |
mssql_execute_procedure Execute Procedure (deprecated — use mssql_execute_stored_procedure)
Deprecated alias for mssql_execute_stored_procedure.
| Parameter | Type | Description |
|---|---|---|
procedureName * | string | Name of the stored procedure |
parameters | object | |
response_format | string | |
schemaName | string |
mssql_list_databases List Databases
Lists all databases visible on the connected SQL Server instance with state and recovery information. Read-only. Supports pagination.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max databases (default 20) |
offset | integer | Skip N databases |
response_format | string | Output format: 'json' for structured data, 'markdown' for human-readable table |