The whole intent of this server is to provide read‑only access to a SQL Server database or Azure SQL Database.
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"sqlserver": {
"env": {
"SQLSERVER_CONN_STR": "Server=localhost;Database=AdventureWorks;User Id=readonly;Password=yourpassword;"
},
"args": [
"run",
"--project",
"C:\\path\\to\\sqlserver-readonly-mcp\\SqlReadonlyMcpServer.csproj",
"--",
"--schemaonly",
"1"
],
"command": "dotnet"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A Model Context Protocol (MCP) server providing safe, read-only access to SQL Server and Azure SQL databases. This server enables AI assistants like Claude to explore database schemas, analyze performance, and execute queries without risk of data modification.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in data / cloud
Zero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
⚡ A Simple / Speedy / Secure Link Shortener with Analytics, 100% run on Cloudflare.
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
MCP Security Weekly
Get CVE alerts and security updates for SqlReadonlyMcpServer and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A Model Context Protocol (MCP) server providing safe, read-only access to SQL Server and Azure SQL databases. This server enables AI assistants like Claude to explore database schemas, analyze performance, and execute queries without risk of data modification.
This MCP server bridges the gap between AI assistants and SQL Server databases, providing comprehensive database exploration and analysis capabilities while maintaining strict read-only guarantees. Perfect for:
.NET 10 SDK (or later)
dotnet --versionSQL Server or Azure SQL Database
MCP Client (one or more):
The database user needs the following permissions for full functionality:
-- Minimum permissions (schema-only mode)
GRANT VIEW DEFINITION TO [your_user];
GRANT VIEW DATABASE STATE TO [your_user];
GRANT SELECT ON SCHEMA::dbo TO [your_user];
-- Optional for performance tools
GRANT VIEW SERVER STATE TO [your_user];
-- For specific system views
GRANT SELECT ON sys.tables TO [your_user];
GRANT SELECT ON sys.views TO [your_user];
GRANT SELECT ON sys.procedures TO [your_user];
git clone <repository-url>
cd sqlserver-readonly-mcp
# Standard build
dotnet build
# Release build for production
dotnet build -c Release
# Publish a self-contained executable
dotnet publish -c Release -r win-x64 --self-contained
The build output will be in:
bin/Debug/net10.0/ for debug buildsbin/Release/net10.0/ for release buildsbin/Release/net10.0/win-x64/publish/ for published executables# Using environment variable (recommended)
export SQLSERVER_CONN_STR="Server=myserver;Database=mydb;User Id=readonly;Password=yourpassword;"
dotnet run
# Using command-line argument
dotnet run -- --connectionstring "Server=myserver;Database=mydb;User Id=readonly;Password=yourpassword;"
# Enable full mode (query execution)
dotnet run -- --schemaonly 0
# If you want to test (without running as MCP server)
dotnet ner -- --test --connectionstring "Server=myserver;Database=mydb;User Id=readonly;Password=yourpassword;"
# View help
dotnet run -- --help
| Option | Description | Default |
|---|---|---|
--help | Display help message and exit | - |
--test | Tests to see if the application can connect to the database with the provided connection string | - |
--connectionstring <str> | SQL Server connection string | From `SQLSERVER_CONN_S |