
Dbatools Mcp Server
Let your coding agent run read-only (or gated) dbatools commands against SQL Server for health checks, inventory, and DBA tasks from the IDE.
Overview
io.github.dataplat/dbatools-mcp-server is an Operate-phase MCP server that exposes dbatools SQL Server management commands to AI coding agents over stdio.
What is this MCP server?
- Exposes dbatools SQL Server management as MCP tools over stdio npm package dbatools-mcp-server v0.5.0
- DBATOOLS_SAFE_MODE defaults to true so write/destructive ops stay off until you explicitly set false
- Output caps via MAX_OUTPUT_ROWS (default 100, range 1–10000) and COMMAND_TIMEOUT_SECONDS (default 60, range 5–3600)
- Configurable PWSH_EXE for PowerShell execution on Windows or cross-platform pwsh
- GitHub source at dataplat/dbatools-mcp-server with dbatools.io branding assets
- Server schema version 0.5.0
- DBATOOLS_SAFE_MODE defaults to true (read-only safe mode)
- MAX_OUTPUT_ROWS defaults to 100 (allowed 1–10000)
Community signal: 3 GitHub stars.
What problem does it solve?
You need SQL Server answers from your agent without copying dozens of PowerShell one-liners or risking unreviewed destructive dbatools calls.
Who is it for?
Indie builders or tiny teams on SQL Server who want agent-driven inventory and diagnostics with read-only defaults.
Skip if: Greenfield projects on Postgres-only stacks or anyone who refuses to install PowerShell and dbatools on the host.
What do I get? / Deliverables
After you register the server, your agent can run bounded, timeout-limited dbatools operations with safe mode controlling write access.
- MCP-callable dbatools command results capped by MAX_OUTPUT_ROWS
- Configurable read-only or write-enabled SQL Server operations via DBATOOLS_SAFE_MODE
- Timeout-bounded command execution per COMMAND_TIMEOUT_SECONDS
Recommended MCP Servers
Journey fit
Canonical shelf is Operate because the server targets live SQL Server instances, uptime, and DBA-style commands rather than greenfield app coding. Infra subphase fits instance management, connectivity, and platform maintenance exposed through dbatools.
How it compares
SQL Server MCP integration over dbatools, not a schema migration framework or ORM skill.
Common Questions / FAQ
Who is io.github.dataplat/dbatools-mcp-server for?
Solo builders and small ops-minded developers who manage SQL Server and want those workflows callable from Claude Code, Cursor, or Codex via MCP.
When should I use io.github.dataplat/dbatools-mcp-server?
Use it during Operate when you need agent-assisted instance checks, reporting, or approved maintenance commands instead of manual PowerShell sessions.
How do I add io.github.dataplat/dbatools-mcp-server to my agent?
Add the npm stdio server dbatools-mcp-server to your MCP config, set PWSH_EXE if needed, optionally tune DBATOOLS_SAFE_MODE and MAX_OUTPUT_ROWS, then restart the agent.