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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_mssql_query-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_mssql_query-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file mcp_mssql_query-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_mssql_query-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mcp_mssql_query-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8f76763865ab5d025af07d39db17b6a0ead33ef45aebc6e4104bcc5a55624fe4
MD5 4142c9bf88e054303e758dc96497bc91
BLAKE2b-256 dff30e5feb53e077d82836f9d6571955aa055e4ca01506dbdc0285b2b4dc0e35

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_mssql_query-0.1.0.tar.gz:

Publisher: publish.yml on uaniay/plugins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_mssql_query-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_mssql_query-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 514495c55eacd237b180eae38fd1e85dec9f1d7794b316425cb568f37de6b491
MD5 6273e63a1d957ef727158cdca82ba4bd
BLAKE2b-256 e5fb584cb91aca1d2b1d500e0f68cc72eab0a45abc25b8089fc28f8c1f93017b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_mssql_query-0.1.0-py3-none-any.whl:

Publisher: publish.yml on uaniay/plugins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page