mssql-mcp-node
v3.0.4MCP server for Microsoft SQL Server
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
execute_read_query Execute Read Query
Run a SELECT-style SQL query against a configured database. The query executes inside a transaction that is ALWAYS rolled back, so accidental DML/DDL is non-durable (this is a guardrail, not a sandbox: an explicit `COMMIT TRANSACTION` in the query string ends the wrapper and following writes will persist - rely on a least-privilege SQL login for real isolation). Results are streamed; the server cancels the underlying request once `offset + limit` rows have been seen, so `truncated:true` means more rows exist.
| Parameter | Type | Description |
|---|---|---|
query * | string | Read-only SQL query. Wrapped in a rollback-only transaction, so any incidental writes are discarded. Results are streamed and the underlying request is cancelled once `offset + limit` rows have been s… |
dbKey | string | Database key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys. |
limit | integer | Max rows to return (1..1000). |
offset | integer | Row offset for pagination. |
execute_write_query Execute Write Query
Run a mutating SQL statement. DISABLED unless MSSQL_ENABLE_WRITES=true. There is no keyword denylist - the database user's grants are the source of truth. Use a least-privilege account for the relevant `dbKey`.
| Parameter | Type | Description |
|---|---|---|
query * | string | Mutating SQL (INSERT/UPDATE/DELETE/MERGE/DDL). Disabled unless MSSQL_ENABLE_WRITES=true. |
dbKey | string | Database key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys. |
list_databases List Configured Databases
Lists every database the server has credentials for, plus connection-pool status. Passwords are never returned.
describe_database Describe Database
High-level summary of a configured database: object counts (tables/views/procs) and the current user.
| Parameter | Type | Description |
|---|---|---|
dbKey | string | Database key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys. |
list_tables List Tables
Paginated list of base tables. Use `offset`/`limit` to walk the catalog. Returns total row count for the caller to size pagination.
| Parameter | Type | Description |
|---|---|---|
dbKey | string | Database key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys. |
limit | integer | Max rows to return (1..1000). |
offset | integer | Row offset for pagination. |
list_views List Views
Paginated list of views. Use `offset`/`limit` to walk the catalog.
| Parameter | Type | Description |
|---|---|---|
dbKey | string | Database key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys. |
limit | integer | Max rows to return (1..1000). |
offset | integer | Row offset for pagination. |
list_indexes List Indexes
Indexes on a specific table, including columns and uniqueness/primary-key flags. Use to inform JOIN and WHERE choices.
| Parameter | Type | Description |
|---|---|---|
table * | string | |
dbKey | string | Database key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys. |
list_foreign_keys List Foreign Keys
Foreign-key relationships in the database, optionally filtered to one table. Paginated - large schemas should narrow with `table` or walk pages.
| Parameter | Type | Description |
|---|---|---|
dbKey | string | Database key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys. |
limit | integer | Max rows to return (1..1000). |
offset | integer | Row offset for pagination. |
table | string |
list_stored_procedures List Stored Procedures
Paginated list of stored procedures.
| Parameter | Type | Description |
|---|---|---|
dbKey | string | Database key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys. |
limit | integer | Max rows to return (1..1000). |
offset | integer | Row offset for pagination. |
describe_table Describe Table
Column schema for a table. Accepts bare or `schema.table` identifiers (e.g. `dbo.Users`).
| Parameter | Type | Description |
|---|---|---|
table * | string | |
dbKey | string | Database key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys. |
describe_procedure Describe Procedure
Parameters of a stored procedure. Accepts bare or `schema.procedure` identifiers (e.g. `dbo.usp_UpdateUser`).
| Parameter | Type | Description |
|---|---|---|
procedure * | string | |
dbKey | string | Database key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys. |