MCP server for dbatools — exposes SQL Server management commands as MCP tools
Connect Runs on your machine
claude mcp add dbatools-mcp-server -e DBATOOLS_SAFE_MODE=<DBATOOLS_SAFE_MODE> -e MAX_OUTPUT_ROWS=<MAX_OUTPUT_ROWS> -e COMMAND_TIMEOUT_SECONDS=<COMMAND_TIMEOUT_SECONDS> -e PWSH_EXE=<PWSH_EXE> -- npx -y [email protected]
{
"mcpServers": {
"dbatools-mcp-server": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DBATOOLS_SAFE_MODE": "<DBATOOLS_SAFE_MODE>",
"MAX_OUTPUT_ROWS": "<MAX_OUTPUT_ROWS>",
"COMMAND_TIMEOUT_SECONDS": "<COMMAND_TIMEOUT_SECONDS>",
"PWSH_EXE": "<PWSH_EXE>"
}
}
}
}
{
"mcpServers": {
"dbatools-mcp-server": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DBATOOLS_SAFE_MODE": "<DBATOOLS_SAFE_MODE>",
"MAX_OUTPUT_ROWS": "<MAX_OUTPUT_ROWS>",
"COMMAND_TIMEOUT_SECONDS": "<COMMAND_TIMEOUT_SECONDS>",
"PWSH_EXE": "<PWSH_EXE>"
}
}
}
}
{
"servers": {
"dbatools-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DBATOOLS_SAFE_MODE": "<DBATOOLS_SAFE_MODE>",
"MAX_OUTPUT_ROWS": "<MAX_OUTPUT_ROWS>",
"COMMAND_TIMEOUT_SECONDS": "<COMMAND_TIMEOUT_SECONDS>",
"PWSH_EXE": "<PWSH_EXE>"
}
}
}
}
Replace the values in angle brackets with your own. Keys stay on your machine; we never see them.
Tools
This server runs locally, so its tools are listed by your MCP client once it starts.
Environment variables
| Name | Description |
|---|---|
DBATOOLS_SAFE_MODEOptional | Set to 'false' to allow write/destructive dbatools operations. Defaults to true (read-only safe mode). |
MAX_OUTPUT_ROWSOptional | Maximum number of rows returned per command. Defaults to 100. Allowed range: 1–10000. |
COMMAND_TIMEOUT_SECONDSOptional | Timeout in seconds for each dbatools command. Defaults to 60. Allowed range: 5–3600. |
PWSH_EXEOptional | Path to the PowerShell executable. Defaults to 'pwsh'. |
Details
| Package | [email protected] (NPM, stdio) |
| First published | 18 Apr 2026 |
| Last updated | 18 Apr 2026 |
| Registry name | io.github.dataplat/dbatools-mcp-server |
More databases servers See all
Listing data from the official MCP registry. Status and tools from NestDaddy's daily check. Browse all MCP servers.
