- Home
- MCP servers
- MSSQL DBA MCP Stdio Server
MSSQL DBA MCP Stdio Server
- javascript
0
GitHub Stars
javascript
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"dba-i-mssql-dba": {
"command": "npx",
"args": [
"@dba-i/mssql-dba"
],
"env": {
"IDLE": "30000",
"DB_HOST": "db.example.com",
"DB_NAME": "YourDatabase",
"DB_PORT": "1433",
"DB_USER": "dbai",
"ENCRYPT": "false",
"MAX_POOL": "10",
"MIN_POOL": "0",
"DB_PASSWORD": "YOUR_PASSWORD",
"TRUST_SERVER_CERTIFICATE": "true"
}
}
}
}You can use this MCP server to provide a contextual assistant for MSSQL Database Administration tasks, enabling the model to analyze queries, table health, indexes, and related server data to optimize performance and identify missing indexes. This guide shows how to connect a client to the MCP server, run optimization prompts, and leverage the built-in tooling to improve your SQL workloads.
How to use
To use the MSSQL DBA MCP Stdio Server, connect your MCP client using the provided stdio configuration. You will supply the required database connection parameters through environment variables, and your client can invoke prompts to optimize queries, assess index health, and retrieve server or database details. Use the prompt names described in the available prompts to perform targeted optimizations, and rely on the server to generate schema changes, rollback scripts, and documentation to accompany any changes.
How to install
Install prerequisites and set up the MCP client integration as follows. Ensure you have Node.js and npm installed on your machine before proceeding.
# Prerequisites
- Node.js (14.x or later) and npm
- Access to an MSSQL Server instance
- A client that supports MCP via stdio configuration
# Install and run the MCP client integration (example approach)
# The client command shown is the exact startup used for this MCP server
npx @dba-i/mssql-dba
Configuration and usage with MCP client
Configure your MCP client to connect to the MSSQL DBA MCP Stdio Server by using the stdio command and its environment variables. The following example shows the complete configuration you would place in your client’s config file.
+```json
{
"mcpServers": {
"mssql-dba": {
"command": "npx",
"args": ["@dba-i/mssql-dba"],
"env": {
"DB_HOST": "host",
"DB_PORT": "1433",
"DB_USER": "dbai",
"DB_PASSWORD": "password",
"DB_NAME": "database name",
"TRUST_SERVER_CERTIFICATE": "true",
"ENCRYPT": "false",
"MAX_POOL": "10",
"MIN_POOL": "0",
"IDLE": "30000"
}
}
}
}
## Available tools
### Query Store Tools
Tools to interact with SQL Server Query Store data, including retrieving query statistics and execution plans.
### Table-Level Tools
Tools to fetch table metadata, assess index health, and identify missing indexes for specified tables.
### Server-Level Tools
Tools to obtain server version and timezone information from the SQL Server instance.
### Database-Level Tools
Tools to retrieve missing indexes, wait statistics, collation details, and mismatches at the database level.