1. Conduid
  2. Developer Tools
  3. MSSQL
MCP server · Developer Tools

MSSQL

A Model Context Protocol (MCP) server facilitating secure interactions with MSSQL databases.

59Fair

Scored yesterday · breakdown

About MSSQL

MSSQL is an MCP server published by JexinSam in the Developer Tools category: a Model Context Protocol (MCP) server facilitating secure interactions with MSSQL databases.

The repository has 60 stars and 28 forks, with the last commit 5 days ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

Claude Code
claude mcp add mssql-mcp-server -- npx -y @piyapat/mssql-mcp-server
npx
npx -y @piyapat/mssql-mcp-server

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Tools (3)

execute_sqlExecute any SQL statement (SELECT, INSERT, UPDATE, DELETE, DDL)

Parameters not published.

list_tablesList all tables in the database

Parameters not published.

query_sqlExecute read-only SELECT queries

Parameters not published.

Ask AI

✦

Ask AI about MSSQL

Powered by Claude · Grounded in docs

I know everything about MSSQL. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 5 hours ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • ✓Tests presentA test suite exists in the repository.
  • !Dependencies pinnedNo lockfile. Installs can pull different code over time.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v1.0.0v1.0.0 · 16 Aug 2026First stable release. This version modernizes the server to the **MCP SDK v2.0.0** (2026-07-28 spec) and hardens SQL handling, connection setup, and CI. ⚠️ Breaking changes Requires `mcp[cli]>=2.0.0`.** The server now uses the high-level…
v0.1.2v0.1.2 · 16 Apr 2025Full Changelog**: https://github.com/JexinSam/mssql_mcp_server/compare/v0.1.1...v0.1.2
v0.1.1v0.1.1 · 31 Jan 2025Bug Fixes & Stability Improvements** This release focuses on fixing bugs and improving stability, with no new features or breaking changes. 🛠 Fixes & Improvements:** Fixed a database connection issue that caused intermittent failures…
v0.1.0v0.1.0 · 30 Jan 2025Initial release of MSSQL MCP Server Features: List available MSSQL tables as resources Read table contents Execute SQL queries with proper error handling Secure database access through environment variables Comprehensive logging Full…

README

Tests

MSSQL MCP Server

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

Tool Description Annotations
list_tables List all tables in the database Read-only, Idempotent
query_sql Execute read-only SELECT queries Read-only, Idempotent
execute_sql Execute any SQL statement (SELECT, INSERT, UPDATE, DELETE, DDL) Destructive

Usage

With Claude Desktop

Add this configuration to claude_desktop_config.json:

{
  "mcpServers": {
    "mssql": {
      "command": "uv",
      "args": [
        "--directory",
        "path/to/mssql_mcp_server",
        "run",
        "mssql_mcp_server"
      ],
      "env": {
        "MSSQL_HOST": "localhost",
        "MSSQL_USER": "your_username",
        "MSSQL_PASSWORD": "your_password",
        "MSSQL_DATABASE": "your_database"
      }
    }
  }
}

With Cursor IDE

Add this to your .cursor/mcp.json:

{
  "mcpServers": {
    "mssql": {
      "command": "uv",
      "args": [
        "--directory",
        "path/to/mssql_mcp_server",
        "run",
        "mssql_mcp_server"
      ],
      "env": {
        "MSSQL_HOST": "localhost",
        "MSSQL_USER": "your_username",
        "MSSQL_PASSWORD": "your_password",
        "MSSQL_DATABASE": "your_database"
      }
    }
  }
}

With pip install (global)

{
  "mcpServers": {
    "mssql": {
      "command": "mssql_mcp_server",
      "env": {
        "MSSQL_HOST": "localhost",
        "MSSQL_USER": "your_username",
        "MSSQL_PASSWORD": "your_password",
        "MSSQL_DATABASE": "your_database"
      }
    }
  }
}

With Docker

docker build -t mssql-mcp-server .
docker run -e MSSQL_HOST=host.docker.internal \
           -e MSSQL_USER=your_username \
           -e MSSQL_PASSWORD=your_password \
           -e MSSQL_DATABASE=your_database \
           mssql-mcp-server

Running as a Standalone Server

# Install dependencies
pip install -r requirements.txt

# Run the server (stdio)
python -m mssql_mcp_server

# Run with HTTP transport
MCP_TRANSPORT=streamable-http python -m mssql_mcp_server

Development & Testing

# Clone the repository
git clone https://github.com/JexinSam/mssql_mcp_server.git
cd mssql_mcp_server

# Set up a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -r requirements-dev.txt
pip install -e .

# Run tests
pytest -v

# Test with MCP Inspector
uv run mcp dev src/mssql_mcp_server/server.py

Troubleshooting

"Program Not Found" Error

This usually means the mssql_mcp_server command is not in your PATH. Solutions:

  1. Use uv (recommended): Configure your MCP client to use uv --directory path/to/mssql_mcp_server run mssql_mcp_server
  2. Use full path: Find the install location with pip show mssql-mcp-server and use the scripts directory
  3. Use python -m: Run as python -m mssql_mcp_server

MSSQL Driver Issues

The default driver is SQL Server (built into Windows). For Linux/macOS or newer features:

  1. Install Microsoft ODBC Driver 18
  2. Set MSSQL_DRIVER="ODBC Driver 18 for SQL Server"

Connection Timeouts

If using MSSQL_SERVER from other projects, this server supports both MSSQL_HOST and MSSQL_SERVER env vars (with MSSQL_HOST taking priority).

Security Considerations

  • Use a dedicated MSSQL user with minimal privileges.
  • Never use root credentials or full administrative accounts.
  • Restrict database access to only necessary operations (e.g. use GRANT SELECT only if the model should not modify data). The readOnlyHint and destructiveHint annotations are for client UX; security is enforced entirely by your database credentials.
  • Enable logging and auditing for security monitoring.
  • Regularly review permissions to ensure least privilege access.

Security Best Practices

For a secure setup:

  1. Create a dedicated MSSQL user with restricted permissions.
  2. Avoid hardcoding credentials—use environment variables instead.
  3. Restrict access to necessary tables and operations only.
  4. Enable SQL Server logging and monitoring for auditing.
  5. Review database access regularly to prevent unauthorized access.

For detailed instructions, refer to the MSSQL Security Configuration Guide.

⚠️ IMPORTANT: Always follow the Principle of Least Privilege when configuring database access.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

We welcome contributions! To contribute:

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request.

Need Help?

For any questions or issues, feel free to open a GitHub Issue or reach out to the maintainers.

README fetched from the repository 5 hours ago. The original is authoritative.

Questions

About MSSQL

How do I install MSSQL?

Run claude mcp add mssql-mcp-server -- npx -y @piyapat/mssql-mcp-server, then add the server to your MCP client's configuration.

Is MSSQL safe to use with an AI agent?

Its trust score is 59 out of 100 (fair). It passes 4 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is MSSQL still maintained?

Yes — the latest release is v1.0.0 (16 Aug 2026), and the last commit was 5 days ago. The repository has 60 stars and 8 open issues.