mssql-readonly-mcp
Read-only SQL Server access for assistants, with a SELECT allowlist and audit log
mssql-readonly-mcp is an open-source MCP server for databases. It runs locally on your machine and is started by your AI client.
- Pricing
- Open source
- Platforms
- Windows, Linux, macOS
- Runs
- Locally
- Version
- 0.1.1
- Listing updated
Similar MCP servers
Install
In Claude Desktop → Settings → Extensions
https://github.com/oguzhanpisgin/mssql-readonly-mcp/releases/download/v0.1.1/mssql-readonly-mcp-0.1.1-win-x64.mcpbDownload the bundle and open it with Claude Desktop, or drag it onto Settings → Extensions and click Install. This server is only published as a Claude Desktop bundle.
Using several servers? Build one config file with the MCP config generator.
Configuration
MSSQL_CONNECTION_STRINGSQL Server connection string. Use a login that passes check-login (see the README, "Create and check the read-only login"). The server adds ApplicationIntent=ReadOnly and Application Name=mssql-readonly-mcp.RequiredMSSQL_MCP_AUDIT_LOGPath of the audit file, created with its folder if missing. One server process writes a file at a time; on Windows a second process on the same path writes a sibling file (docs/audit-log.md).RequiredMSSQL_CONNECTION_STRINGSQL Server connection string. Use a login that passes check-login (see the README, "Create and check the read-only login"). The server adds ApplicationIntent=ReadOnly and Application Name=mssql-readonly-mcp.RequiredMSSQL_MCP_AUDIT_LOGPath of the audit file, created with its folder if missing. One server process writes a file at a time; on Windows a second process on the same path writes a sibling file (docs/audit-log.md).RequiredMSSQL_CONNECTION_STRINGSQL Server connection string. Use a login that passes check-login (see the README, "Create and check the read-only login"). The server adds ApplicationIntent=ReadOnly and Application Name=mssql-readonly-mcp.RequiredMSSQL_MCP_AUDIT_LOGPath of the audit file, created with its folder if missing. One server process writes a file at a time; on Windows a second process on the same path writes a sibling file (docs/audit-log.md).Required
About mssql-readonly-mcp
This server is built for firms that want an assistant to read one on-premises SQL Server database without any chance of writing to it. Its SQL tool accepts only text that passes an allowlist over the ScriptDom syntax tree for a single plain SELECT, so writes and DDL are refused before they reach the database.
Two further checks sit around that gate. The server will not start if the login fails a permission check (it exits with code 3), refusing logins such as sa, db_owner or db_datawriter. Every call is written to a hash-chained audit file before any data is returned, and a verify-audit command detects a tampered copy. Results are capped by rows, characters and time, and queries wait only a bounded time for locks and lose deadlocks against default-priority sessions.
The README is explicit about limits: rows the assistant reads go to the AI vendor running the model, along with table and column names and error text, and personal-data transfer rules remain the firm's decision. It is an early release, tested on SQL Server 2019, 2022 and 2025, and ships as bundles for Windows, Linux and macOS on Apple silicon.
What it does
- SELECT-only gate
- A syntax-tree allowlist refuses writes and DDL before they reach SQL Server.
- Login check at startup
- Refuses to start with a login holding write, owner or impersonation rights.
- Hash-chained audit log
- Writes a tamper-evident line for every question before returning data.
- Result caps
- Limits rows, characters and time per call.
- Lock and deadlock handling
- Bounded lock wait and low deadlock priority so it yields to other sessions.
- Read-only intent
- Connection adds ApplicationIntent=ReadOnly and a named application.
Good for
- Let an assistant answer questions about an ERP or reporting database
- Keep an auditable record of every query an AI asks
- Check that a database login is safe before exposing it
- Explore a large legacy schema without risking writes
Pricing
Open source
Free; early release (v0.1.1).
mssql-readonly-mcp FAQ
Which SQL Server versions are tested?
SQL Server 2019, 2022 and 2025 on Linux container images, on every change.
Does read-only keep my data private?
No. The README says rows the assistant reads go to the AI vendor running the model, with table and column names and error text.
What configuration is required?
A connection string in MSSQL_CONNECTION_STRING and an audit file path in MSSQL_MCP_AUDIT_LOG.
What happens if the audit line cannot be written?
The call returns an error and no data, though the query has already run.
Is mssql-readonly-mcp free?
Yes. mssql-readonly-mcp is open source, so you can use and self-host it for free.
What are the best alternatives to mssql-readonly-mcp?
The closest alternatives to mssql-readonly-mcp are REA, AiSOC, x64dbg-mcp-server, redamon and Treasure Map.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.



