MSSQL LocalDB MCP

io.github.hermessilva由 GitHub 账号 hermessilva 发布v0.1.0更新于 Oct 24, 2026

MCP server for SQL Server Express LocalDB on Windows: manage instances, run T-SQL, discover DBs

已验证STDIO仅桌面数据库开发者工具

概览

AI 生成的概览

一个仅限 Windows 的 MCP 服务器,让助手控制 SQL Server Express LocalDB 实例:创建和管理实例、运行 T-SQL、附加项目中的数据库文件并查看架构。

可以做什么
在本机创建、启动、停止和管理 SQL Server Express LocalDB 实例。对 LocalDB 数据库运行 T-SQL 脚本和查询,可配置超时和返回行数上限。在允许的项目文件夹中查找散落的数据库文件并附加。查看数据库架构和结构。
适用场景
适合在 Windows 上使用 SQL Server Express LocalDB 的开发者,希望助手在不打开 SSMS 的情况下创建实例、附加项目数据库文件、运行脚本和查看架构。不适用于远程服务器或多数据库环境。
运行要求
Windows,且已安装 SQL Server Express LocalDB,SqlLocalDB.exe 位于 PATH 中。需要兼容的 MCP 客户端。需在 %APPDATA% 下提供 config.toml 并至少配置一个允许扫描的根目录,否则文件夹扫描会拒绝运行。以打包的 Windows 二进制分发;从源码构建需要 Rust。
安装前请注意
该服务器可执行任意 T-SQL,包括破坏性语句;README 称 DROP、TRUNCATE、DELETE 和 ALTER 需要显式确认,但仍应留意助手实际执行的内容。文件夹扫描仅限 config.toml 中允许的根目录。仅使用 Windows 集成身份验证,助手将以你的 Windows 账户的数据库权限操作。

安装

在 SourceWeft 中

  1. 打开 控制台中的 MSSQL LocalDB MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mssql-localdb-mcp

Rust MCP server for SQL Server Express LocalDB on Windows. Gives AI agents (Claude Desktop, Claude Code, and any MCP client) full control over LocalDB instances: create/manage instances, run any T-SQL script, find loose database files in project folders and attach them, introspect schema.

Status: MVP (Phase 1) functional and tested against real LocalDB — see docs/PLANNING.md for the roadmap and current phase.

Why

Existing MCP tools for SQL Server assume an already-configured remote server and require an external runtime (Python, .NET, Node). This project is:

  • Single Rust binary, no external runtime, no Docker.
  • LocalDB-focused: local dev workflow — find a loose .mdf in a project folder, attach it, run a script, no need to open SSMS.
  • Windows-only by design, not a generic multi-database abstraction.

Requirements

  • Windows with SQL Server Express LocalDB installed (SqlLocalDB.exe on PATH).
  • A compatible MCP client (Claude Desktop, Claude Code, etc.).

Installation

Via MCP Registry

Published on the official MCP Registry as io.github.hermessilva/mssql-localdb-mcp. Install through any MCP client that supports the registry.

Via VS Code extension

The vscode-extension/ directory packages the server as a VS Code extension that registers it automatically through the MCP provider API (VS Code 1.101+), with the Windows binary bundled — nothing to download or configure by hand. Build the .vsix locally with:

powershell
./build-vsix.ps1                 # bumps the build segment; -Version x.y.z or -NoBump to control itcode --install-extension .\mssql-localdb-mcp-1.0.1-win32-x64.vsix

The extension has its own version line, independent from Cargo.toml — the crate version is what the vX.Y.Z tag and the MCP Registry publish.

Via Claude Code plugin

The claude-plugin/ directory in this repo is a self-contained Claude Code plugin (bundles the Windows binary directly, no separate download). Load it directly with:

powershell
claude --plugin-dir path\to\LocalDB-MCP\claude-plugin

Submitted to the claude-community marketplace for review — once approved, install it with claude plugin marketplace add anthropics/claude-plugins-community followed by claude plugin install mssql-localdb-mcp@claude-community.

From source

Requires Rust and LocalDB installed.

powershell
git clone https://github.com/hermessilva/LocalDB-MCP.gitcd LocalDB-MCPcargo build --release

Binary at target\release\mssql-localdb-mcp.exe.

Configure config.toml

db_scan_folder requires at least one explicitly allowed root — without it, the tool refuses to run. Create %APPDATA%\mssql-localdb-mcp\config.toml:

toml
# Windows paths in TOML need single quotes (literal string) — double# quotes interpret \U... as a unicode escape and break parsing.scan_allowlist = ['C:\Users\YourUser\source\repos']scan_max_depth = 6default_query_timeout_secs = 30default_max_rows = 1000

Configure in your MCP client

Claude Desktop / Claude Code (claude_desktop_config.json or equivalent):

json
{  "mcpServers": {    "mssql-localdb": {      "command": "C:\\path\\to\\LocalDB-MCP\\target\\release\\mssql-localdb-mcp.exe"    }  }}

Claude Code via CLI:

powershell
claude mcp add mssql-localdb -- "C:\path\to\LocalDB-MCP\target\release\mssql-localdb-mcp.exe"

After that, the agent has access to the localdb_*, sql_*, and db_* tools — see docs/MCP_SPEC.md for the full list.

Documentation

Security — read before using

  • Windows Integrated Authentication only (no SQL Auth).
  • Every destructive action (DROP, TRUNCATE, DELETE, ALTER, etc.) requires explicit confirmation (confirm: true) — never executes silently.
  • Database discovery (db_scan_folder) only scans folders explicitly allowed in config.toml (allowlist).
  • Full detail in docs/SECURITY.md.

License

MIT.

来源:README.md,提交 c2a1185

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分