1.0.3npm · sql-server-mcp · current release
Observed 2026-08-21T20:25:15.887Z using mcpSecurity-inventory. Status: succeeded. Negotiated protocol: 2025-06-18.
{
"tools": {}
}| Tool | Category | Annotations | Risk |
|---|---|---|---|
sql_check_foreign_keysFind foreign key violations in a table — records that reference non-existent parent rows (orphaned data). Very useful for diagnosing referential integrity issues.Input schema{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Specific table to check. If omitted, checks ALL tables."
}
}
} | — | — · — | — |
sql_check_nullsFind rows with NULL values in specified columns. Useful for finding missing/incomplete data that might be causing bugs.Input schema{
"type": "object",
"required": [
"table",
"columns"
],
"properties": {
"table": {
"type": "string",
"description": "Table name"
},
"columns": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of column names to check for NULLs"
}
}
} | — | — · — | — |
sql_compare_countsCompare row counts between a parent and child table (joined by FK) to detect missing or extra records. Useful for finding data gaps.Input schema{
"type": "object",
"required": [
"parentTable",
"childTable",
"joinColumn"
],
"properties": {
"parentTable": {
"type": "string",
"description": "Parent/reference table (e.g. 'Customers')"
},
"childTable": {
"type": "string",
"description": "Child table (e.g. 'Orders')"
},
"joinColumn": {
"type": "string",
"description": "The FK column name that links them (e.g. 'CustomerId')"
}
}
} | — | — · — | — |
sql_count_and_sampleGet the row count and a sample of rows from a table. Useful for quickly understanding what data exists without writing a full query.Input schema{
"type": "object",
"required": [
"table"
],
"properties": {
"table": {
"type": "string",
"description": "Table name"
},
"sampleSize": {
"type": "number",
"description": "Number of sample rows to show (default: 10)"
},
"where": {
"type": "string",
"description": "Optional WHERE clause to filter (e.g. 'Status = 1')"
}
}
} | — | — · — | — |
sql_diagnose_issueRun a comprehensive diagnostic on a table: counts, NULLs in all columns, FK violations, and recent rows. Great starting point when you notice something wrong.Input schema{
"type": "object",
"required": [
"table"
],
"properties": {
"table": {
"type": "string",
"description": "Table to diagnose"
}
}
} | — | — · — | — |
sql_find_dataSearch for a value across all (or specific) columns in a table. Useful when you know a value exists but don't know which column it's in.Input schema{
"type": "object",
"required": [
"table",
"value"
],
"properties": {
"table": {
"type": "string",
"description": "Table to search in (e.g. 'Orders' or 'dbo.Orders')"
},
"value": {
"type": "string",
"description": "Value to search for (will search as text across all varchar/nvarchar/int columns)"
}
}
} | — | — · — | — |
sql_get_query_planGet the estimated execution plan for a SELECT query as text (SET SHOWPLAN_ALL). Useful for diagnosing slow queries.Input schema{
"type": "object",
"required": [
"sql"
],
"properties": {
"sql": {
"type": "string",
"description": "The SELECT query to analyse"
}
}
} | — | — · — | — |
sql_get_stored_proc_defGet the full definition (source code) of a stored procedure.Input schema{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "Stored procedure name"
}
}
} | — | — · — | — |
sql_inspect_tableShow full details about a table: columns with types/nullability/defaults, primary keys, foreign keys, indexes, and row count.Input schema{
"type": "object",
"required": [
"table"
],
"properties": {
"table": {
"type": "string",
"description": "Table name (e.g. 'Orders' or 'dbo.Orders')"
}
}
} | — | — · — | — |
sql_list_stored_procsList all stored procedures in the active database.Input schema{
"type": "object",
"properties": {
"filter": {
"type": "string",
"description": "Optional: filter by name pattern (e.g. 'Get%')"
}
}
} | — | — · — | — |
sql_list_tablesList all user tables (and optionally views) in the active database, with row counts.Input schema{
"type": "object",
"properties": {
"schema": {
"type": "string",
"description": "Filter by schema name (e.g. 'dbo'). Default: all schemas."
},
"includeViews": {
"type": "boolean",
"description": "Also list views (default: false)"
}
}
} | — | — · — | — |
sql_run_queryExecute a SELECT query against the configured SQL Server database and return formatted results. Only SELECT statements are allowed here — for writes, use sql_run_write.Input schema{
"type": "object",
"required": [
"sql"
],
"properties": {
"sql": {
"type": "string",
"description": "The SELECT SQL query to execute"
},
"maxRows": {
"type": "number",
"description": "Max rows to display (default: 500). Query will auto-add TOP N if not present."
}
}
} | — | — · — | — |
sql_run_writeExecute a write SQL statement (INSERT, UPDATE, DELETE, DROP TABLE, ALTER TABLE, CREATE, TRUNCATE, EXEC stored proc, etc.).
**IMPORTANT PERMISSION RULE:**
- When `confirm` is false (default): returns a DRY-RUN PREVIEW — nothing is executed.
- When `confirm` is true: actually executes the statement.
Always call with confirm=false first to show the user what will happen, then call again with confirm=true only after the user explicitly approves.Input schema{
"type": "object",
"required": [
"sql"
],
"properties": {
"sql": {
"type": "string",
"description": "The SQL statement to execute (INSERT/UPDATE/DELETE/DDL/EXEC etc.)"
},
"confirm": {
"type": "boolean",
"description": "Set to true ONLY after the user has seen the preview and explicitly approved execution. Default: false."
}
}
} | — | — · — | — |