mssqlclient-mcp-server

aadversteeg/mssqlclient-mcp-server

3.4

If you are the rightful owner of mssqlclient-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A comprehensive Microsoft SQL Server client implementing the Model Context Protocol (MCP).

Tools

Functions exposed to the LLM to take actions

execute_query

Execute a SQL query on the connected SQL Server database.

list_stored_procedures

List all stored procedures in the connected SQL Server database.

list_tables

List all tables in the connected SQL Server database.

get_table_schema

Get the schema of a table from the connected SQL Server database.

get_stored_procedure_definition

Get the definition of a stored procedure in the connected SQL Server database.

get_stored_procedure_parameters

Get parameter information for a stored procedure including names, types, and whether they are required.

This tool helps you understand what parameters a stored procedure expects before calling it. It supports two output formats:

  1. Table format (default): Shows a formatted table with parameter details and example usage
  2. JSON format: Returns JSON Schema compatible with the stored procedure parameters

Examples:

  • get_stored_procedure_parameters("sp_GetCustomerOrders")
  • get_stored_procedure_parameters("dbo.sp_UpdateCustomer", "table")
  • get_stored_procedure_parameters("sp_ProcessPayment", "json")

Table format shows parameter name, SQL data type, whether it's required or optional, direction (INPUT/OUTPUT), and default values. JSON format provides JSON Schema with SQL-specific extensions for parameter validation and documentation.

Note: This tool works within the current database context. For cross-database queries, use the server mode.

execute_stored_procedure

Execute a stored procedure on the connected SQL Server database.

Parameters should be provided as a JSON object with parameter names as keys. Both '@ParameterName' and 'ParameterName' formats are accepted.

Examples:

  • Simple parameters: {"CustomerID": 123, "OrderDate": "2024-01-01"}
  • With @ prefix: {"@CustomerID": 123, "@OrderDate": "2024-01-01"}
  • Mixed types: {"ID": 123, "Name": "Test", "IsActive": true, "Price": 99.99}
  • Null values: {"CustomerID": 123, "Notes": null}

The tool will automatically convert JSON values to the appropriate SQL types based on the stored procedure's parameter definitions. Use 'get_stored_procedure_parameters' tool first to see what parameters are expected.

server_capabilities

Get SQL Server capabilities

Prompts

Interactive templates invoked by user choice

No prompts

Resources

Contextual data attached and managed by the client

No resources