mssql-mcp-server
v1.3.0MCP server for Microsoft SQL Server database access and comprehensive schema exploration using tedious.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_connections List Available Connections
List all available named database connections configured in the server
test_connection Test Connection
Test the database connection and return basic server information
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
list_databases List Databases
List all databases available on the SQL Server instance
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
list_tables List Tables
List all tables in the connected database
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
schema | string | Schema name (default: dbo) |
describe_table Describe Table
Get detailed schema information for a specific table including columns, data types, and constraints
| Parameter | Type | Description |
|---|---|---|
tableName * | string | Name of the table to describe |
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
schema | string | Schema name (default: dbo) |
sample_data Sample Table Data
Retrieve sample data from a table (top 10 rows by default)
| Parameter | Type | Description |
|---|---|---|
tableName * | string | Name of the table to sample |
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
limit | number | Number of rows to return (default: 10, max: 100) |
schema | string | Schema name (default: dbo) |
execute_query Execute SQL Query
Execute a custom SQL SELECT query with automatic limit (top 20 rows). Disabled unless MSSQL_ENABLE_EXECUTE_QUERY=true.
| Parameter | Type | Description |
|---|---|---|
query * | string | SQL SELECT query to execute |
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
get_relationships Get Table Relationships
Get foreign key relationships between tables in the database
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
schema | string | Schema name (default: dbo) |
list_stored_procedures List Stored Procedures
List all stored procedures, functions, and their basic information
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
includeSystemObjects | boolean | Include system stored procedures (default: false) |
schema | string | Schema name (default: dbo) |
describe_stored_procedure Describe Stored Procedure
Get detailed information about a specific stored procedure including parameters and definition
| Parameter | Type | Description |
|---|---|---|
procedureName * | string | Name of the stored procedure to describe |
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
includeDefinition | boolean | Include the procedure definition/body (default: true) |
schema | string | Schema name (default: dbo) |
list_views List Views
List all views in the database with their basic information
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
includeSystemViews | boolean | Include system views (default: false) |
schema | string | Schema name (default: dbo) |
describe_view Describe View
Get detailed information about a specific view including its definition and dependencies
| Parameter | Type | Description |
|---|---|---|
viewName * | string | Name of the view to describe |
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
includeDefinition | boolean | Include the view definition (default: true) |
schema | string | Schema name (default: dbo) |
list_triggers List Triggers
List all triggers in the database with their associated tables
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
schema | string | Schema name (default: dbo) |
tableName | string | Filter by specific table name |
describe_trigger Describe Trigger
Get detailed information about a specific trigger including its definition and events
| Parameter | Type | Description |
|---|---|---|
triggerName * | string | Name of the trigger to describe |
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
includeDefinition | boolean | Include the trigger definition (default: true) |
list_functions List User-Defined Functions
List all user-defined functions (scalar, table-valued, etc.)
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
functionType | string | Filter by function type (default: ALL) |
schema | string | Schema name (default: dbo) |
list_indexes List Table Indexes
List all indexes on tables with usage statistics and detailed information
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
includeUsageStats | boolean | Include index usage statistics (default: true) |
schema | string | Schema name (default: dbo) |
tableName | string | Filter by specific table name |
analyze_table_stats Analyze Table Statistics
Get table row counts, size information, and last update statistics
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
schema | string | Schema name (default: dbo) |
tableName | string | Filter by specific table name |
find_missing_indexes Find Missing Indexes
Identify potentially missing indexes based on query execution patterns
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
minImpact | number | Minimum impact score to include (default: 1000) |
schema | string | Schema name (default: dbo) |
analyze_index_usage Analyze Index Usage
Show detailed index usage statistics to identify unused or underutilized indexes
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
schema | string | Schema name (default: dbo) |
showUnusedOnly | boolean | Show only unused indexes (default: false) |
tableName | string | Filter by specific table name |
analyze_database_size Analyze Database Size
Get comprehensive database size information including data and log file sizes
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
list_constraints List All Constraints
List all constraints (check, unique, foreign key, etc.) across tables in the database
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
constraintType | string | Filter by constraint type (default: ALL) |
schema | string | Schema name (default: dbo) |
analyze_check_constraints Analyze Check Constraints
Extract and analyze business rules from check constraints
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
schema | string | Schema name (default: dbo) |
tableName | string | Filter by specific table name |
list_user_defined_types List User-Defined Data Types
List all user-defined data types and their definitions
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
schema | string | Schema name (default: dbo) |
find_computed_columns Find Computed Columns
List computed columns and their formulas to understand derived business logic
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
schema | string | Schema name (default: dbo) |
tableName | string | Filter by specific table name |
list_default_constraints List Default Constraints
List all default value constraints and their definitions
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
schema | string | Schema name (default: dbo) |
tableName | string | Filter by specific table name |
analyze_data_distribution Analyze Data Distribution
Get data distribution patterns for columns to understand data quality and patterns
| Parameter | Type | Description |
|---|---|---|
tableName * | string | Name of the table to analyze |
columnName | string | Specific column to analyze (analyzes all if not provided) |
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
sampleSize | number | Sample size for analysis (default: 1000) |
schema | string | Schema name (default: dbo) |
find_lookup_tables Find Lookup Tables
Identify reference/lookup tables automatically based on table patterns
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
maxRows | number | Maximum rows to consider as lookup table (default: 1000) |
schema | string | Schema name (default: dbo) |
analyze_null_patterns Analyze NULL Patterns
Find columns with high null percentages and analyze null patterns
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
minNullPercentage | number | Minimum null percentage to include (default: 10) |
schema | string | Schema name (default: dbo) |
detect_audit_columns Detect Audit Columns
Identify common audit trail patterns (created/modified dates, user tracking)
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
schema | string | Schema name (default: dbo) |
get_stored_procedure_definition Get Stored Procedure Definition
Get the complete SQL query/definition of a stored procedure - this is the actual source code
| Parameter | Type | Description |
|---|---|---|
procedureName * | string | Name of the stored procedure to get definition for |
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
formatOutput | boolean | Format the SQL output for better readability (default: true) |
schema | string | Schema name (default: dbo) |
get_multiple_stored_procedure_definitions Get Multiple Stored Procedure Definitions
Get complete SQL definitions for multiple stored procedures at once
| Parameter | Type | Description |
|---|---|---|
procedureNames * | array | Array of stored procedure names to get definitions for |
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
includeMetadata | boolean | Include metadata like creation date, modification date (default: true) |
schema | string | Schema name (default: dbo) |
get_all_stored_procedure_definitions Get All Stored Procedure Definitions
Get complete SQL definitions for all stored procedures in a schema
| Parameter | Type | Description |
|---|---|---|
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
includeSystemProcedures | boolean | Include system stored procedures (default: false) |
maxResults | number | Maximum number of procedures to return (default: 50, max: 100) |
schema | string | Schema name (default: dbo) |
search_stored_procedures_by_content Search Stored Procedures by Content
Search for stored procedures containing specific text or patterns in their SQL definition
| Parameter | Type | Description |
|---|---|---|
searchText * | string | Text or pattern to search for in procedure definitions |
caseSensitive | boolean | Case sensitive search (default: false) |
connectionName | string | Named connection to use (e.g., 'production', 'staging') |
includeDefinitions | boolean | Include full procedure definitions in results (default: false) |
schema | string | Schema name (default: dbo) |