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
sqlglotto 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 statementmax_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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f76763865ab5d025af07d39db17b6a0ead33ef45aebc6e4104bcc5a55624fe4
|
|
| MD5 |
4142c9bf88e054303e758dc96497bc91
|
|
| BLAKE2b-256 |
dff30e5feb53e077d82836f9d6571955aa055e4ca01506dbdc0285b2b4dc0e35
|
Provenance
The following attestation bundles were made for mcp_mssql_query-0.1.0.tar.gz:
Publisher:
publish.yml on uaniay/plugins
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_mssql_query-0.1.0.tar.gz -
Subject digest:
8f76763865ab5d025af07d39db17b6a0ead33ef45aebc6e4104bcc5a55624fe4 - Sigstore transparency entry: 2300324923
- Sigstore integration time:
-
Permalink:
uaniay/plugins@db99e7439eb68e61dd273e0c2f1676391d82562e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/uaniay
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db99e7439eb68e61dd273e0c2f1676391d82562e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mcp_mssql_query-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_mssql_query-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
514495c55eacd237b180eae38fd1e85dec9f1d7794b316425cb568f37de6b491
|
|
| MD5 |
6273e63a1d957ef727158cdca82ba4bd
|
|
| BLAKE2b-256 |
e5fb584cb91aca1d2b1d500e0f68cc72eab0a45abc25b8089fc28f8c1f93017b
|
Provenance
The following attestation bundles were made for mcp_mssql_query-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on uaniay/plugins
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_mssql_query-0.1.0-py3-none-any.whl -
Subject digest:
514495c55eacd237b180eae38fd1e85dec9f1d7794b316425cb568f37de6b491 - Sigstore transparency entry: 2300324955
- Sigstore integration time:
-
Permalink:
uaniay/plugins@db99e7439eb68e61dd273e0c2f1676391d82562e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/uaniay
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db99e7439eb68e61dd273e0c2f1676391d82562e -
Trigger Event:
workflow_dispatch
-
Statement type: