MSSQL

MSSQL

MCP Server for MSSQL database in Python

51
Stars
25
Forks
3
Releases

Overview

MSSQL MCP Server is a Model Context Protocol (MCP) server that enables secure and structured interaction with Microsoft SQL Server databases. It allows AI assistants to list available tables, read table contents, and execute SQL queries with controlled access, promoting safe database exploration, strict permission enforcement, and comprehensive auditing. The server enforces access controls, handles query errors gracefully, and logs all database interactions for monitoring. Configuration is driven by environment variables (MSSQL_DRIVER, MSSQL_HOST, MSSQL_USER, MSSQL_PASSWORD, MSSQL_DATABASE) with optional TrustServerCertificate and Trusted_Connection, enabling secure operation across development and production environments. It can run as a standalone server or integrate with Claude Desktop via a configured claude_desktop_config.json, providing easy deployment and integration pathways. The project emphasizes least privilege, requiring a dedicated MSSQL user and applying minimal permissions to reduce risk.

Details

Owner
JexinSam
Language
Python
License
MIT License
Updated
2025-12-07

Features

Secure MSSQL Database Access

Access to MSSQL is controlled via environment variables, minimizing credential exposure and hardcoding.

Controlled Query Execution

Executes SQL queries with error handling and restricted permissions to prevent unsafe operations.

Table Listing & Data Retrieval

Supports listing available tables and retrieving data from tables through MCP.

Comprehensive Logging

Logs queries and operations for monitoring, auditing, and security oversight.

Audience

AI assistantsEnable AI assistants to securely explore MSSQL databases by listing tables, reading data, and executing queries.
DevelopersFor developers integrating with Claude Desktop to test, deploy, and customize the MSSQL MCP server.

Tags

MCPMSSQLMicrosoft SQL ServerDatabase accessTable listingData retrievalSQL query executionLoggingSecurityEnvironment variables