mssqlcl
Click on "Deploy 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., "@mssqlcl list my SQL Server connections and show the tables in the Sales database"
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.
Configure your SQL Server connections once in VS Code, Antigravity IDE (ms-mssql.mssql), or via mssqlcl conn save, and expose them safely to any MCP-compatible AI client (Antigravity, Claude Desktop, Claude Code, Cursor, etc.) over stdio.
flowchart LR
Client["AI Client<br/>(Antigravity / VS Code / Cursor / Claude)"] <-->|"stdio<br/>JSON-RPC 2.0"| Server["mssqlcl --mcp<br/>(Self-contained .NET 10)"]
Server -->|"Zero-config discovery"| IDE["VS Code / Antigravity IDE<br/>(ms-mssql.mssql + SecretStorage)"]
Server -->|"Fallback / Override"| Vault["Local DPAPI Vault<br/>(%USERPROFILE%\.mssqlcl)"]
Server -->|"Read-only guard<br/>& T-SQL"| SQL[("SQL Server /<br/>Azure SQL")]🎥 Quick Demo — End-to-End in Antigravity
✨ Features
Capability | What it gives you |
Zero-Config IDE Discovery | Automatically reads |
Automatic Credential Resolution | Supports Windows Auth ( |
11 Multi-Connection MCP Tools | Full server discovery, connection management, schema/object inspection, and query execution keyed by |
Token-Efficient Output | Compact CSV output by default (optional |
Read-Only Lexical Guard |
|
Clean | Diagnostics go exclusively to |
Related MCP server: DB Analyzer MCP Server
📋 Prerequisites
Operating System: Windows 10 / 11 (
x64) — required for Windows DPAPI and ElectronSecretStoragedecryption.**Connection Source (choose one):**
Recommended (Zero-Config): VS Code or Antigravity IDE with the SQL Server (
ms-mssql.mssql) extension and your connections already saved.Standalone (No IDE required): Manage profiles directly via
mssqlcl conn save(stored in%USERPROFILE%\.mssqlcl\encrypted with Windows DPAPI) orMSSQLCL_PWD_<PROFILE>environment variables.
Runtime:
End users (Release ZIP / Installer): No .NET installation required (self-contained binary).
Building from source: .NET 10 SDK.
If you already use thems-mssql.mssql extension in VS Code or Antigravity IDE, you don't need to re-enter passwords or maintain separate connection strings—mssqlcl discovers them automatically.
📦 Installation
Option 1: One-Command Online Installer (PowerShell, no .NET SDK required)
irm https://raw.githubusercontent.com/codevswia/mssqlcl/main/scripts/install.ps1 | iexDownloads the latest release ZIP to %LOCALAPPDATA%\Programs\mssqlcl and adds it to your User PATH (no Administrator privileges required).
Download
mssqlcl-vX.Y.Z-win-x64.zipfrom GitHub Releases.Extract it anywhere (for example
C:\tools\mssqlcl\).Choose how you want to run it:
Portable (zero system changes): Point your MCP config directly to
C:\tools\mssqlcl\mssqlcl.exe(noPATHchanges).Install to User
PATH(no Admin required): Double-clickinstall.cmd(or runpowershell -ExecutionPolicy Bypass -File .\install-local.ps1) to copymssqlcl.exeto%LOCALAPPDATA%\Programs\mssqlcland add it to your UserPATH. Restart your IDE afterwards if it was already open.Offline via main installer:
.\scripts\install.ps1 -LocalZip path\to\mssqlcl-vX.Y.Z-win-x64.zip
# Build & run unit tests
dotnet test
# Build and install mssqlcl.exe to %LOCALAPPDATA%\Programs\mssqlcl and add to User PATH
.\scripts\install.ps1 -FromSource
# Or build a standalone self-contained binary from source
.\scripts\install.ps1 -FromSource -SelfContained🔌 MCP Client Configuration
Add mssqlcl to your MCP client configuration (such as Antigravity IDE mcp_config.json, Claude Desktop claude_desktop_config.json, or Cursor):
{
"mcpServers": {
"mssqlcl": {
"command": "mssqlcl",
"args": ["--mcp"]
}
}
}If you installedmssqlcl in portable mode without adding it to PATH, replace "mssqlcl" in "command" with the full path (e.g. "C:\\tools\\mssqlcl\\mssqlcl.exe").
Optional MCP Flags
Flag | Default | Description |
| enabled | Blocks DML/DDL/EXEC statements via lexical T-SQL inspection |
| off | Allows write/DDL statements in |
|
| Caps returned rows per result set |
|
| Default SQL command timeout in seconds |
|
|
|
| off | Disables writing to |
🎬 Video Walkthroughs
https://github.com/user-attachments/assets/b5a99cef-7ed1-4fe2-acab-0bd34b7e16ae
https://github.com/user-attachments/assets/1ff4a37a-32d5-432e-9a07-061de0f1503d
Walkthroughs for VS Code (ms-mssql.mssql) coming soon.
🛠️ MCP Tools Reference
mssqlcl exposes 11 database tools to your AI assistant, supporting multiple simultaneous connections via connectionId:
Category | Tool | Description |
Discovery |
| Lists discovered SQL Server profiles from Antigravity IDE, VS Code, and local vault |
Connection |
| Opens a connection to a profile and returns a |
Connection |
| Closes an active |
Connection |
| Returns active connection metadata (server, database, auth type, state) |
Connection |
| Switches the active database context ( |
Schema |
| Lists databases on the connected SQL Server instance |
Schema |
| Lists schemas in the current database |
Schema |
| Lists tables (with schema and metadata) |
Schema |
| Lists views in the current database |
Schema |
| Lists scalar/table-valued functions |
Query |
| Executes T-SQL (protected by |
💻 CLI Usage
Use the CLI directly to verify your environment, inspect discovered IDE profiles, or manage local DPAPI credentials:
# Verify environment, IDE discovery paths, and local vault health
mssqlcl doctor
# List discovered profiles and credential resolution status
mssqlcl conn list
# Test live connectivity for a profile (prefix with antigravity: or vscode: if duplicated)
mssqlcl conn test "MyServer\MyDatabase"
mssqlcl conn test "vscode:MyServer\MyDatabase"
# Create a local profile or store a DPAPI-protected password override
mssqlcl conn save --profile "LocalDev" --server "localhost\SQLEXPRESS" --database "AppDb" --user "sa" --savepwd
mssqlcl conn save --profile "ExistingIdeProfile" --savepwd
# Delete a local profile
mssqlcl conn delete "LocalDev"🔒 Security
Only pass--readwrite against databases where write or DDL operations are explicitly intended.
Zero plaintext secret leaks:
mssqlclnever writes decrypted passwords to disk,stdout,stderr, oraudit.log.Safe IDE vault reading:
state.vscdbis copied to a temporary file in read-only mode before querying and deleted immediately afterwards, so it works safely even while VS Code or Antigravity IDE is running.Zero target database footprint: Audit logs are stored strictly locally at
%USERPROFILE%\.mssqlcl\audit.log.
👤 Author & Organization
Author: Brayan Raul Sullca Ccarampa
Organization: codevswia — Human Ideas. AI-Powered Development.
Repository: github.com/codevswia/mssqlcl
📄 License
Distributed under the MIT License — see LICENSE for details.
Available Tools
11 toolsmssql_change_databaseARead-only
Switches the active database catalog on an open connectionId.
Inputs: database (required), connectionId (required).
mssql_connectARead-only
Opens a SQL Server session using a saved profileId, profileName (optionally qualified as 'antigravity:Name' or 'vscode:Name'), or serverName + database. Returns a connectionId and database environment context.
Inputs: database, profileId, serverName.
mssql_disconnectBRead-only
Closes an active SQL Server connection identified by connectionId.
Inputs: connectionId (required).
mssql_get_connection_detailsARead-onlyIdempotent
Returns metadata and active state for a connectionId (or all open connections if omitted).
Inputs: connectionId.
mssql_list_databasesARead-onlyIdempotent
Lists accessible databases on the SQL Server instance for the given connectionId in CSV format.
Inputs: connectionId (required).
mssql_list_functionsARead-onlyIdempotent
Lists user-defined functions in the current database for the given connectionId in CSV format.
Inputs: connectionId (required), schema.
mssql_list_schemasARead-onlyIdempotent
Lists user schemas in the current database for the given connectionId in CSV format.
Inputs: connectionId (required).
mssql_list_serversARead-onlyIdempotent
Lists all saved SQL Server connection profiles discovered from Antigravity IDE, VS Code, and local ~/.mssqlcl storage. Call this first to obtain a profileId or profileName before calling mssql_connect.
Inputs: filter.
mssql_list_tablesARead-onlyIdempotent
Lists user tables and approximate row counts in the current database for the given connectionId in CSV format.
Inputs: connectionId (required), schema.
mssql_list_viewsARead-onlyIdempotent
Lists user views in the current database for the given connectionId in CSV format.
Inputs: connectionId (required), schema.
mssql_run_queryA
Executes a T-SQL query against an active connectionId and returns compact CSV (default) or JSON. In --readonly mode (default), write/DDL/EXEC statements are blocked.
Inputs: query (required), connectionId (required), format, queryTypes, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct resource and action: profile discovery, connection lifecycle, database switching, catalog listing per object type, and query execution. The only near-overlap is mssql_change_database versus passing a database to mssql_connect, but both descriptions make the intended use clear. An agent should reliably pick the right tool.
All tools share the mssql_ prefix and follow a predictable verb_noun pattern (list_servers, connect, get_connection_details, change_database, list_tables, run_query). connect/disconnect omit an object noun but are conventional lifecycle verbs and fit cleanly into the scheme.
Eleven tools is well within the ideal 3-15 range and every tool maps to a concrete step in a SQL Server workflow. The five catalog listers are parallel and each earns its place; nothing feels redundant.
Discovery, connection lifecycle, database switching, schema/table/view/function enumeration, and query execution give full coverage of the core workflow. Minor gaps exist for column-level introspection (no list_columns/describe_table) and stored procedures, though these can be worked around via mssql_run_query against catalog views.
Maintenance
Related MCP Connectors
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
SQL validation, formatting, parsing, metadata extraction, linting, and security analysis.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to query and explore databases including SQLite, PostgreSQL, MySQL, and SQL Server through a secure, read-only workflow. It provides tools for listing connections, inspecting table schemas, and executing SELECT statements directly within VS Code.1-
- FlicenseCqualityDmaintenanceEnables AI assistants to analyze and query SQL Server databases, including schema discovery, health checks, and data retrieval.10-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely query and explore SQL Server and PostgreSQL databases with read-only access, supporting schema discovery, relationship exploration, and query execution.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to explore SQL Server schemas, relationships, and execute safe SQL queries with read-only mode by default and optional write control.1MIT