Skip to main content

mcp-mssql-query

MCP server for read-only SQL Server queries. Only SELECT statements are allowed — all other operations are rejected at the SQL validation layer.

Features

  • SELECT-only enforcement (INSERT/UPDATE/DELETE/DDL all blocked)
  • AST-level SQL analysis via sqlglot to catch injection and embedded write operations
  • Blocks dangerous functions: xp_cmdshell, sp_executesql, OPENROWSET, etc.
  • Stacked statement prevention (; separated statements)
  • Returns results as JSON with column names, rows, and truncation indicator

Configuration

Set these environment variables:

Variable Description Default
MSSQL_HOST SQL Server hostname localhost
MSSQL_PORT Port 1433
MSSQL_DATABASE Database name
MSSQL_USERNAME Login username
MSSQL_PASSWORD Login password

Claude Desktop configuration

{
  "mcpServers": {
    "mssql": {
      "command": "uvx",
      "args": ["mcp-mssql-query@latest"],
      "env": {
        "MSSQL_HOST": "your-server",
        "MSSQL_DATABASE": "your-db",
        "MSSQL_USERNAME": "your-user",
        "MSSQL_PASSWORD": "your-password"
      }
    }
  }
}

Tool

query_mssql

Run a read-only SELECT query against the configured SQL Server database.

Parameters:

  • sql (required) — T-SQL SELECT statement
  • max_rows (optional) — Maximum rows to return, default 100, max 1000

Metadata

Release files for mcp-mssql-query 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-mssql-query 0.1.0
File Size Uploaded Provenance
mcp_mssql_query-0.1.0.tar.gz 3.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-mssql-query 0.1.0
File Interpreter ABI Platform
mcp_mssql_query-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.2 kB

Release files / mcp_mssql_query-0.1.0.tar.gz

Download URL mcp_mssql_query-0.1.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8f76763865ab5d025af07d39db17b6a0ead33ef45aebc6e4104bcc5a55624fe4
BLAKE2b-256 checksum
How to use checksums
dff30e5feb53e077d82836f9d6571955aa055e4ca01506dbdc0285b2b4dc0e35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.

Transparency log

Release files / mcp_mssql_query-0.1.0-py3-none-any.whl

Download URL mcp_mssql_query-0.1.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
514495c55eacd237b180eae38fd1e85dec9f1d7794b316425cb568f37de6b491
BLAKE2b-256 checksum
How to use checksums
e5fb584cb91aca1d2b1d500e0f68cc72eab0a45abc25b8089fc28f8c1f93017b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.

Transparency log

Security for mcp-mssql-query 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mcp_mssql_query-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page