Dbatools MCP Server

MCP server for dbatools — exposes SQL Server management commands as MCP tools

Local serverstdioTypeScript

What is the Dbatools MCP server?

MCP server for dbatools — exposes SQL Server management commands as MCP tools. That is what the dbatools mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

Exposes dbatools commands as MCP tools so AI assistants (GitHub Copilot, Claude, etc.) can discover, explain, and execute dbatools commands directly — with all metadata sourced from dbatools' own comment-based help.

  • list_dbatools_commands — — search commands by verb, noun, keyword, or risk level
  • get_dbatools_command_help — — full normalized help (synopsis, parameters, examples) from Get-Help -Full
  • invoke_dbatools_command — — execute any dbatools command with safe parameter validation, risk gating, and structured JSON output
  • check_dbatools_environment — — verify PowerShell + dbatools installation, index freshness, and version alignment
  • Version mismatch detection — — warns when installed dbatools version differs from the indexed version
  • Safe mode — — non-readonly commands require explicit confirm: true to execute

Getting it running

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

What it needs from you

Configuration is passed through the environment: DBATOOLS_SAFE_MODE, MAX_OUTPUT_ROWS, COMMAND_TIMEOUT_SECONDS. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How it compares

Plenty of database access servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. It is maintained by dataplat; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Configuration

VariableDescriptionRequired
DBATOOLS_SAFE_MODEConfiguration value read at startup.Optional
MAX_OUTPUT_ROWSConfiguration value read at startup.Optional
COMMAND_TIMEOUT_SECONDSConfiguration value read at startup.Optional

Frequently asked questions

It connects Dbatools to MCP-compatible AI assistants such as Claude and Cursor. Instead of copying data back and forth by hand, the assistant works with Dbatools directly.