dbatools-mcp-server
OfficialClick on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dbatools-mcp-serverlist all commands related to backup"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dbatools-mcp-server
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.
Features
list_dbatools_commands— search commands by verb, noun, keyword, or risk levelget_dbatools_command_help— full normalized help (synopsis, parameters, examples) fromGet-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 alignmentVersion mismatch detection — warns when installed dbatools version differs from the indexed version
Safe mode — non-readonly commands require explicit
confirm: trueto executeSQL Authentication support — pass
SqlCredential: { username, password }for SQL auth instances
Related MCP server: MSSQL MCP Server
Prerequisites
Node.js 20+
PowerShell 7+ (
pwsh)dbatools PowerShell module
Install-Module dbatools -Scope CurrentUserQuick Start
# 1. Clone the repo
git clone https://github.com/Dataplat/dbatools-mcp-server.git
cd dbatools-mcp-server
# 2. Install Node dependencies
npm install
# 3. Generate the help index from your local dbatools installation
npm run refresh-help
# 4. Build
npm run buildThen open the folder in VS Code — the .vscode/mcp.json file automatically registers the MCP server.
Connecting to VS Code
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.
{
"servers": {
"dbatools": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/dist/server.js"],
"env": {
"DBATOOLS_SAFE_MODE": "true",
"MAX_OUTPUT_ROWS": "100",
"COMMAND_TIMEOUT_SECONDS": "60"
}
}
}
}Configuration
All settings are controlled via environment variables (set in .vscode/mcp.json or your shell):
Variable | Default | Description |
|
| Path to PowerShell executable |
|
| When |
|
| Maximum rows returned per command execution |
|
| Seconds before PowerShell process is killed |
Refreshing the Help Index
The help index (generated/dbatools-help.json) is generated from your locally installed dbatools module.
Re-run whenever dbatools is updated:
Update-Module dbatools -Scope CurrentUser
npm run refresh-helpThe server detects version mismatches at runtime and warns you when the index is stale.
Risk Levels
Commands are automatically classified by verb:
Risk Level | Verbs | Behavior |
| Get, Test, Find, Compare, … | Always allowed |
| Set, New, Add, Copy, Enable, … | Requires |
| Remove, Drop, Disable, Reset, … | Requires |
SQL Authentication
For SQL-auth-only instances (e.g. Docker), pass credentials via the SqlCredential parameter:
{
"SqlInstance": "localhost,1433",
"SqlCredential": { "username": "<SqlLogin>", "password": "YourPassword" }
}Project Structure
dbatools-mcp-server/
├── src/
│ ├── server.ts # MCP server entry point, tool definitions
│ ├── powershell.ts # PowerShell process runner, health checks, version detection
│ ├── help-indexer.ts # Help manifest loader and command search
│ ├── tool-registry.ts # Risk classification, safe argument builder
│ └── types.ts # Shared TypeScript interfaces
├── scripts/
│ └── refresh-help.ps1 # Generates generated/dbatools-help.json
├── generated/ # Help index (gitignored, generated locally)
├── .vscode/
│ └── mcp.json # VS Code MCP local server registration
└── dist/ # Compiled output (gitignored)Contributing
Contributions are welcome! Please open an issue first for significant changes.
This project follows the same community spirit as dbatools.
License
MIT — © 2026 DataPlat contributors
Available Tools
4 toolscheck_dbatools_environmentA
Verify that PowerShell and the dbatools module are installed and report the help-index status.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, but description covers key behaviors: verifies installation and reports help-index status. It is a read-only check, no side effects mentioned.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, clear and front-loaded. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Simple tool with no output schema; description fully explains purpose and result.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist; baseline score of 4 applies as description does not need to add parameter info.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states verb 'Verify' and resources 'PowerShell and the dbatools module', plus 'report the help-index status'. Distinguishes from siblings that deal with commands.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies usage as a prerequisite check but does not explicitly state when to use or alternatives. No guidance on when not to use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_dbatools_command_helpA
Get the full normalized help for a specific dbatools command, including parameters and examples sourced from comment-based help.
| Name | Required | Description | Default |
|---|---|---|---|
| commandName | Yes | Exact command name, e.g. Get-DbaDatabase |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It accurately states the tool provides help (a read operation), but it does not disclose behavior such as response format size, performance impact, or required permissions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that conveys the tool's purpose, output content (parameters and examples), and source (comment-based help) without any extraneous words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is adequate for a simple tool with one parameter and no output schema. It explains the output includes parameters and examples. However, it could be improved by clarifying what 'normalized help' means or specifying the output format (e.g., text).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description does not add meaning beyond the schema; the schema already describes the parameter with the same example. Since schema coverage is 100%, the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'Get' and identifies the resource as 'full normalized help for a specific dbatools command.' It clearly distinguishes from sibling tools like list_dbatools_commands (which lists commands) and invoke_dbatools_command (which executes commands).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool should be used when help on a specific dbatools command is needed, but it does not explicitly state when to use it or when to avoid it, nor does it mention alternatives among the sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
invoke_dbatools_commandA
Execute a dbatools command via PowerShell and return structured JSON output.
SAFETY: For any destructive or change command (Remove, Drop, Disable, Reset, etc.), always explain the consequences to the user and ask for explicit confirmation before running. Only proceed with confirm:true if the user has clearly confirmed their intent. Respect DBATOOLS_SAFE_MODE: never bypass safety checks. For any command that modifies or deletes data, double-check with the user before proceeding. Show the exact command and output for transparency. Non-readonly commands require confirm:true when safe mode is enabled.
| Name | Required | Description | Default |
|---|---|---|---|
| commandName | Yes | Exact dbatools command name to execute, e.g. Get-DbaDatabase | |
| parameters | No | Key-value map of parameters. Strings, numbers, and booleans map directly to PowerShell parameters. For SQL authentication pass SqlCredential as an object: { "username": "sa", "password": "secret" }. Example: { "SqlInstance": "localhost,2022", "SqlCredential": { "username": "sa", "password": "P@ssw0rd" } } | |
| confirm | No | Set to true to allow execution of change/destructive commands (required when safeMode is on) | |
| selectProperties | No | List of property names to select from the output (e.g. ['Name', 'Status', 'SizeMB']). Use this to reduce output size for commands that return complex objects like SMO database or login objects. When omitted, all properties are returned. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It transparently explains safety behaviors: requiring user confirmation for destructive commands, respecting safe mode, and the need for confirm:true. It does not cover error handling or rate limits, but safety is well addressed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured: a concise purpose statement followed by a necessary safety block. While the safety paragraph is somewhat long, it is essential and not redundant. Slight trimming possible.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and missing annotations, the description covers safety well and provides an example for the parameters parameter. It could be improved by describing the output structure or error behavior, but it is fairly complete for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description reinforces the confirm parameter's safety role but does not add new semantic meaning beyond the schema for other parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Execute a dbatools command via PowerShell and return structured JSON output.' This is a specific verb+resource combination that distinguishes it from sibling tools like check, get help, and list commands.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides detailed safety guidelines for using the tool, such as asking for confirmation for destructive commands and respecting safe mode. However, it lacks explicit guidance on when to use this tool versus alternative tools, though the sibling names imply execution is the role.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_dbatools_commandsB
Search and list dbatools commands. Filter by verb, noun, keyword, or risk level.
| Name | Required | Description | Default |
|---|---|---|---|
| verb | No | PowerShell verb (e.g. Get, Set, New, Remove, Test) | |
| noun | No | Noun fragment to match (e.g. Database, Login, AgentJob) | |
| keyword | No | Keyword to search in name, synopsis, and description | |
| riskLevel | No | Filter by risk tier | |
| limit | No | Maximum number of results (default 50, max 200) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry behavioral disclosure. It only states 'Search and list' without revealing whether the operation is read-only, requires permissions, or any side effects. The description adds minimal behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that front-loads the core purpose. It could be slightly more informative without adding length, but it is not wasteful.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 5 parameters and no output schema, the description is minimal. It does not explain the return format, pagination, or how to interpret results, leaving significant gaps for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The description adds 'Filter by verb, noun, keyword, or risk level' which mirrors the schema but does not enrich meaning beyond what the parameter descriptions already provide.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's verb ('Search and list') and resource ('dbatools commands'), and distinguishes from siblings (e.g., get help, invoke, check environment) by focusing on listing/searching.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for searching/filtering commands but does not provide explicit guidance on when to use this tool vs alternatives like get_dbatools_command_help for detailed help or invoke_dbatools_command for execution.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
4 tool updates
v0.5.0- First observed
check_dbatools_environment - First observed
get_dbatools_command_help - First observed
invoke_dbatools_command - First observed
list_dbatools_commands
TDQS
Each tool has a clearly distinct purpose: environment verification, help retrieval, command execution, and command listing. No overlap exists.
All tool names follow a consistent verb_noun pattern with underscores (check, get, invoke, list) and refer to the dbatools domain.
Four tools are well-scoped for the server's function—covering essential operations without unnecessary overhead.
The tool set covers the full workflow for using dbatools commands (list, get help, execute, check environment). Minor gap: no tool for updating or configuring dbatools itself, but that is beyond the stated purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
MCP server exposing the Backtest360 engine API as tools for AI agents.
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Related MCP Servers
- FlicenseCqualityDmaintenanceA Model Context Protocol server that enables AI assistants to execute PowerShell commands, retrieve system information, manage modules, and run scripts on Windows systems.62-
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides comprehensive access to Microsoft SQL Server databases, enabling Language Models to inspect schemas, execute queries, manage database objects, and perform advanced database operations.8-
- AlicenseNot gradedqualityFmaintenanceA Model Context Protocol (MCP) server that enables AI agents to interact with Microsoft SQL Server databases through secure, intelligent database operations. This server provides comprehensive CRUD capabilities, schema introspection, stored procedure execution, transaction management, and bulk opera82940MIT
- AlicenseAqualityFmaintenanceA comprehensive Model Context Protocol (MCP) server that enables Claude and other LLM applications to execute PowerShell commands, scripts, and perform system operations on Windows systems.1025MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dataplat/dbatools-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server