MSSQL Database MCP Server
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
A Model Context Protocol (MCP) server that enables AI assistants to interact directly and securely with Microsoft SQL Server databases using Basic SQL Authentication.
π Features
Basic SQL Authentication - Connect using username/password (no Azure AD required)
Secure Query Execution - Built-in SQL injection protection and query validation
Multiple Database Operations - Read, write, create tables, manage indexes
Read-Only Mode - Safe mode for production environments
Cross-Platform - Works on Windows, macOS, and Linux
AI Assistant Integration - Compatible with Claude Desktop, VS Code Agent, and other MCP clients
Related MCP server: MSSQL Database MCP Server
π οΈ Installation
Prerequisites
Node.js 14 or higher
Access to a Microsoft SQL Server database
An MCP-compatible AI assistant (Claude Desktop, VS Code Agent, etc.)
Setup
Clone the repository
git clone https://github.com/yourusername/mssql-mcp-server.git cd mssql-mcp-serverInstall dependencies
npm installBuild the project
npm run build
βοΈ Configuration
Claude Desktop Setup
Open Claude Desktop settings:
File β Settings β Developer β Edit ConfigAdd the following configuration:
{
"mcpServers": {
"mssql": {
"command": "node",
"args": ["/path/to/your/mssql-mcp-server/dist/index.js"],
"env": {
"SERVER_NAME": "your-server.database.windows.net",
"DATABASE_NAME": "your-database-name",
"SQL_USERNAME": "your-username",
"SQL_PASSWORD": "your-password",
"READONLY": "true",
"CONNECTION_TIMEOUT": "30",
"TRUST_SERVER_CERTIFICATE": "false"
}
}
}
}VS Code Agent Setup
Create
.vscode/mcp.jsonin your workspace:
{
"mcp": {
"servers": {
"mssql": {
"type": "stdio",
"command": "node",
"args": ["/path/to/your/mssql-mcp-server/dist/index.js"],
"env": {
"SERVER_NAME": "your-server.database.windows.net",
"DATABASE_NAME": "your-database-name",
"SQL_USERNAME": "your-username",
"SQL_PASSWORD": "your-password",
"READONLY": "true"
}
}
}
}
}Environment Variables
Variable | Required | Description | Default |
| β | SQL Server hostname | - |
| β | Database name | - |
| β | SQL authentication username | - |
| β | SQL authentication password | - |
| β | Restrict to read-only operations |
|
| β | Connection timeout in seconds |
|
| β | Trust self-signed certificates |
|
π§ Available Tools
Read-Only Mode (READONLY: "true")
read_data- Execute SELECT querieslist_table- List all tables in the databasedescribe_table- Get detailed table schema information
Full Access Mode (READONLY: "false")
All read-only tools plus:
insert_data- Insert new records into tablesupdate_data- Update existing recordscreate_table- Create new tablescreate_index- Create database indexesdrop_table- Delete tables
π‘ Usage Examples
Once configured, you can interact with your database using natural language:
"Show me all customers from New York"
"Create a table for storing product information"
"List all tables in the database"
"Describe the structure of the users table"
"Insert a new customer record"π Security Features
SQL Injection Protection - All queries are validated and sanitized
Read-Only Mode - Safely explore databases without modification risk
Query Validation - Dangerous operations and patterns are blocked
Connection Security - SSL encryption enabled by default
WHERE Clause Requirements - SELECT and UPDATE operations require WHERE clauses
ποΈ Development
Build
npm run buildWatch Mode
npm run watchStart Server
npm startπ Troubleshooting
Common Issues
Connection Errors
Verify server name, database name, and credentials
Check network connectivity to the SQL Server
Ensure SQL Server allows the authentication method
Module Not Found (Windows + WSL)
Use the full Windows path:
C:\\path\\to\\dist\\index.jsOr copy the server to a Windows directory
Permission Denied
Verify the SQL user has appropriate database permissions
Check if the database requires specific authentication methods
Debug Mode
Add this to your environment variables for detailed logging:
"DEBUG": "true"π€ Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
Built using the Model Context Protocol
Uses the mssql Node.js package
Compatible with Claude Desktop and VS Code Agent
π Support
Create an issue for bug reports or feature requests
Check the MCP documentation for general MCP questions
Review the troubleshooting section for common problems
Made with β€οΈ for the AI community
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.
Work with your database from AI tools: ask, export, approved changes, and scheduled jobs.
Query, explore, and manage your databases through natural conversation.
Draxlr's remote MCP server connects AI assistants to your SQL databases and dashboards. Explore schemas, run read-only queries, manage saved queries and dashboards, and export results, all with row-level security so each user sees only their own data.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Microsoft SQL Server databases through query execution, schema discovery, CRUD operations, stored procedures, and data export with built-in safety controls.1864 PyPIApache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely interact with Microsoft SQL Server databases to query data, inspect schemas, and retrieve metadata with read-only operations by default and optional write capabilities.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Microsoft SQL Server databases through a standardized interface. Supports executing SQL queries, browsing database schemas, and viewing table data with flexible authentication options for both local and Azure SQL databases.5MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to interact with Microsoft SQL Server databases via introspection and query tools. Supports single or multiple databases with read-only mode by default and an optional write capability.643 npm5MIT