MCP server for dbatools β exposes SQL Server management commands as MCP tools
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
A Model Context Protocol (MCP) server for the dbatools PowerShell module.
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 levelget_dbatools_command_help β full normalized help (synopsis, parameters, examples) from Get-Help -Fullinvoke_dbatools_command β execute any dbatools command with safe parameter validation, risk gating, and structured JSON outputcheck_dbatools_environment β verify PowerShell + dbatools installation, index freshness, and version alignmentconfirm: true to executeSqlCredential: { username, password } for SQL auth instancespwsh)Then open the folder in VS Code β the .vscode/mcp.json file automatically registers the MCP server.
The included .vscode/mcp.json registers the server as a local STDIO MCP server.
Open this folder in VS Code and the server will appear in the GitHub Copilot MCP panel.
All settings are controlled via environment variables (set in .vscode/mcp.json or your shell):
| Variable | Default | Description |
|---|---|---|
PWSH_EXE | pwsh | Path to PowerShell executable |
DBATOOLS_SAFE_MODE | true | When true, non-readonly commands require confirm: true |
MAX_OUTPUT_ROWS | 100 | Maximum rows returned per command execution |
COMMAND_TIMEOUT_SECONDS | 60 | Seconds before PowerShell process is killed |
The help index (generated/dbatools-help.json) is generated from your locally installed dbatools module.
Re-run whenever dbatools is updated:
The server detects version mismatches at runtime and warns you when the index is stale.
Commands are automatically classified by verb:
| Risk Level | Verbs | Behavior |
|---|---|---|
readonly | Get, Test, Find, Compare, β¦ | Always allowed |
change | Set, New, Add, Copy, Enable, β¦ | Requires confirm: true in safe mode |
destructive | Remove, Drop, Disable, Reset, β¦ | Requires confirm: true in safe mode |
For SQL-auth-only instances (e.g. Docker), pass credentials via the SqlCredential parameter:
Contributions are welcome! Please open an issue first for significant changes.
This project follows the same community spirit as dbatools.
MIT β Β© 2026 DataPlat contributors
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/dbatools-mcp-server)<a href="https://allmcps.com/mcp/dbatools-mcp-server"><img src="https://allmcps.com/api/badge/dbatools-mcp-server?style=directory" alt="Dbatools MCP Server on AllMCPs" /></a>