MSSQL Database MCP Server (Local SQL Server Edition)
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MSSQL Database MCP Server (Local SQL Server Edition)
π This version is modified to work with LOCAL SQL SERVER 2019 β not Azure SQL.
No browser login. No Azure AD. No βPC userNameβ fallback. Just pure SQL Server Authentication.
What is this? π€
This is a server that lets your LLMs (like Claude) talk directly to your local Microsoft SQL Server database! Think of it as a friendly translator that sits between your AI assistant and your database, making sure they can chat securely and efficiently β without needing Azure or browser logins.
Quick Example
You: "Show me all customers from Tehran"
Claude: *queries your local SQL Server database and gives you the answer in plain English*Related MCP server: Microsoft SQL Server MCP Server
How Does It Work? π οΈ
This server leverages the Model Context Protocol (MCP), a versatile framework that acts as a universal translator between AI models and databases. It supports multiple AI assistants including Claude Desktop and VS Code Agent.
β οΈ Important: This fork has been modified to use SQL Server Authentication (username/password) for local SQL Server 2019+ β NOT Azure AD.
π Credentials are hardcoded in src/index.ts β no need to configure environment variables.
β Why hardcoded? β See WHY_HARD_CODED.md
What Can It Do? π
Run SQL queries by just asking questions in plain English
Create, read, update, and delete data
Manage database schema (tables, indexes)
Secure connection handling (with
TRUST_SERVER_CERTIFICATE=truefor local dev)Real-time data interaction
Quick Start π
Prerequisites
Node.js 14 or higher
Claude Desktop or VS Code with Agent extension
Local SQL Server 2019+ instance running
A database (e.g.,
Test) and SQL login (e.g.,ai/1234)
Set up project
Install Dependencies
Run the following command in the root folder to install all necessary dependencies:npm installBuild the Project
Compile the project by running:npm run build
Configuration Setup
βοΈ Credentials Are Hardcoded β No Config Needed!
Unlike the original version, you donβt need to set environment variables.
All connection details are hardcoded in:
src/index.tsExample (already set in code):
server: "DESKTOP-3445U4I\\SQL2019",
database: "Test",
user: "ai",
password: "1234",
options: {
encrypt: false,
trustServerCertificate: true
}π Just update these values in src/index.ts if needed β rebuild β done.
Option 1: VS Code Agent Setup
Install VS Code Agent Extension
Open VS Code
Go to Extensions (Ctrl+Shift+X)
Search for "Agent" and install the official Agent extension
Create MCP Configuration File
Create a
.vscode/mcp.jsonfile in your workspaceAdd the following configuration:
{ "servers": { "mssql-nodejs": { "type": "stdio", "command": "node", "args": ["L:\\AiAccess\\Project\\dev\\SQL-AI-samples\\MssqlMcp\\Node\\dist\\index.js"] } } }Restart VS Code
Close and reopen VS Code for the changes to take effect
Verify MCP Server
Open Command Palette (Ctrl+Shift+P)
Run "MCP: List Servers" to verify your server is configured
You should see "mssql-nodejs" in the list of available servers
Option 2: Claude Desktop Setup
Open Claude Desktop Settings
Navigate to File β Settings β Developer β Edit Config
Open the
claude_desktop_configfile
Add MCP Server Configuration Replace the content with:
{ "mcpServers": { "MSSQL MCP": { "type": "stdio", "command": "node", "args": ["L:\\AiAccess\\Project\\dev\\SQL-AI-samples\\MssqlMcp\\Node\\dist\\index.js"] } } }Restart Claude Desktop
Close and reopen Claude Desktop for the changes to take effect
Usage Examples
Once configured, you can interact with your database using natural language:
"List all tables in the Test database"
"Show me the top 5 customers ordered by name"
"Describe the structure of the Orders table"
"Update product price to 99.99 where product_id = 100"
Security Notes
The server requires a WHERE clause for read operations to prevent accidental full table scans
Update operations require explicit WHERE clauses for security
Set
READONLY: "true"insrc/index.tsif you only need read access
β Why Hardcoded? Why No Azure?
This version removes Azure AD authentication entirely and uses local SQL Server Auth for simplicity and reliability.
If you want to understand why we hardcoded the config and what βENIACβ means, read:
π WHY_HARD_CODED.md
You should now have successfully configured the MCP server for local SQL Server with your preferred AI assistant. This setup allows you to seamlessly interact with your database through natural language queries β no cloud, no browser, no fuss.
π Credits
This project is a modified fork of the original mssql_mcp_server by Richard Han.
Iβve adapted it to work with local SQL Server 2019 using SQL Server Authentication β removing Azure AD dependencies, fixing MCP protocol compliance, and hardcoding credentials for reliability.
Original repo:
π https://github.com/RichardHan/mssql_mcp_server
Thank you, Richard, for creating the foundation this project is built on.
π Enjoy your local AI-powered SQL queries!
---Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Hosted PostgreSQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables natural language to SQL queries on MSSQL databases via Claude, with safe SELECT-only execution and schema discovery.3ISC
- AlicenseNot gradedqualityDmaintenanceProvides secure SQL Server database access, allowing users to list tables and execute SQL queries through natural language in Claude Desktop.MIT
- FlicenseNot gradedqualityDmaintenanceEnables querying SQL Server databases using natural language through Claude.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants such as Claude and VS Code Agent to talk directly to Microsoft SQL Server databases in plain English, running queries, performing create/read/update/delete operations, and managing schema like tables and indexes. It handles secure connections with Azure AD or SQL authentication and supports read-only mode plus safeguards against accidental full-table operations.MIT