MSSQLSAFE
A Model Context Protocol (MCP) server facilitating secure interactions with MSSQL databases.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
MSSQL MCP Server is a Model Context Protocol (MCP) server that enables secure and structured interaction with Microsoft SQL Server (MSSQL) databases. It allows AI assistants to:
- List available tables
- Read table contents
- Execute SQL queries with controlled access
Built on MCP SDK v2 (2026-07-28 spec) with support for both stdio and Streamable HTTP transports.
Features
- Secure MSSQL Database Access through environment variables
- SQL Injection Protection with identifier validation
- Read-Only & Write Tools with appropriate MCP annotations
- Windows Authentication support via Trusted Connection
- Dual Transport — stdio (default) and HTTP
- Docker Support with pre-configured ODBC drivers
- Comprehensive Logging for monitoring queries and operations
Installation
pip install mssql-mcp-server
Configuration
Set the following environment variables to configure database access:
# Required MSSQL_DATABASE=your_database # Authentication (choose one): # Option 1: SQL Server Authentication MSSQL_USER=your_username MSSQL_PASSWORD=your_password # Option 2: Windows / Kerberos Authentication Trusted_Connection=yes # Optional MSSQL_HOST=localhost # or use MSSQL_SERVER MSSQL_DRIVER=SQL Server # default driver TrustServerCertificate=no # default: no (set to yes for self-signed certs) MCP_TRANSPORT=stdio # or "streamable-http" for Streamable HTTP
Available Tools
Usage
With Claude Desktop
Add this configuration to `cl
53bc99848068OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add mssql_mcp_server --env MSSQL_PASSWORD=${MSSQL_PASSWORD} -- uvx mssql_mcp_server{
"mcpServers": {
"mssql_mcp_server": {
"command": "uvx",
"args": [
"mssql_mcp_server"
],
"env": {
"MSSQL_PASSWORD": "${MSSQL_PASSWORD}"
}
}
}
}Exposed tools (3)
1 read · 2 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
execute_sql | write | Execute any SQL statement on the MSSQL server. |
list_tables | read | List all available tables in the connected MSSQL database. |
query_sql | write | Execute a read-only SQL SELECT query on the MSSQL server. |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (1 observation(s))
- Network
- declared (3 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (3)
pytest, pytest-cov, black, isort, mypy
mcp, pyodbc
- **Secure MSSQL Database Access** through environment variables
Gates applied: no_behavioural_pass.
53bc99848068full audit observations/trust-audit/mcp-server/jexinsam__mssql-3.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 53bc99848068 | SAFE | B | 89 | first audit |
Questions
What is the MSSQL MCP server?
A Model Context Protocol (MCP) server facilitating secure interactions with MSSQL databases.
What tools does MSSQL expose?
3 in total: 1 read-only, 2 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is MSSQL safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does MSSQL need?
It reads MSSQL_PASSWORD from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does MSSQL run?
It speaks streamable-http, so it runs as a service you connect to over the network. It is published on PyPI as mssql_mcp_server.
How current is this page?
The grade is for one exact copy of the source (53bc99848068), read on 2026-10-08. The repository is watched and re-audited when it changes.