Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

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

README.md

dbatools-mcp-server

![Install in VS Code](https://insiders.vscode.dev/redirect/mcp/install?name=dbatools&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dbatools-mcp-server%40latest%22%5D%7D) ![Install in VS Code Insiders](https://insiders.vscode.dev/redirect/mcp/install?name=dbatools&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dbatools-mcp-server%40latest%22%5D%7D&quality=insiders)

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 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
  • SQL Authentication support — pass SqlCredential: { username, password } for SQL auth instances

---

Prerequisites

Install-Module dbatools -Scope CurrentUser

---

Quick 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 build

Then 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 | |---|---|---| | 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 |

---

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-help

The 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 | |---|---|---| | 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 |

---

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

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Databases servers.