mssql-mcp-node

v3.0.4
mssql-mcp-node Checked 16 hours ago Published 2 months ago

MCP 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.

ParameterTypeDescription
query *stringRead-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…
dbKeystringDatabase key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys.
limitintegerMax rows to return (1..1000).
offsetintegerRow 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`.

ParameterTypeDescription
query *stringMutating SQL (INSERT/UPDATE/DELETE/MERGE/DDL). Disabled unless MSSQL_ENABLE_WRITES=true.
dbKeystringDatabase 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.

ParameterTypeDescription
dbKeystringDatabase 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.

ParameterTypeDescription
dbKeystringDatabase key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys.
limitintegerMax rows to return (1..1000).
offsetintegerRow offset for pagination.

list_views List Views

Paginated list of views. Use `offset`/`limit` to walk the catalog.

ParameterTypeDescription
dbKeystringDatabase key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys.
limitintegerMax rows to return (1..1000).
offsetintegerRow 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.

ParameterTypeDescription
table *string
dbKeystringDatabase 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.

ParameterTypeDescription
dbKeystringDatabase key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys.
limitintegerMax rows to return (1..1000).
offsetintegerRow offset for pagination.
tablestring

list_stored_procedures List Stored Procedures

Paginated list of stored procedures.

ParameterTypeDescription
dbKeystringDatabase key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys.
limitintegerMax rows to return (1..1000).
offsetintegerRow offset for pagination.

describe_table Describe Table

Column schema for a table. Accepts bare or `schema.table` identifiers (e.g. `dbo.Users`).

ParameterTypeDescription
table *string
dbKeystringDatabase 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`).

ParameterTypeDescription
procedure *string
dbKeystringDatabase key (lowercased). Optional in single-database mode. Call `list_databases` to discover valid keys.