SqlAugur MCP란?
SqlAugur은(는) MCP server입니다. AST 기반 쿼리 검증 및 속도 제한 기능을 통해 AI 어시스턴트에게 SQL Server 데이터베이스에 대한 안전한 읽기 전용 액세스를 제공합니다. 29개 도구를 제공합니다. 예: list_servers, list_databases, read_data.
프로젝트 README에서 생성된 요약
SqlAugur MCP server 정보
SqlAugur는 AI 어시스턴트가 SQL Server 데이터베이스와 상호작용할 수 있는 안전한 읽기 전용 인터페이스를 제공합니다. 이 서버는 권한 없는 쓰기 작업이나 시스템 불안정성 위험 없이 LLM에 스키마 정보와 데이터에 대한 액세스 권한을 부여해야 하는 개발자와 데이터베이스 관리자를 위해 설계되었습니다. Microsoft의 공식 T-SQL 파서를 사용하여 구문 수준에서 쿼리를 검증하므로, 단순한 정규식 기반 보안을 우회하는 주석 주입이나 문자열 리터럴 트릭과 같은 일반적인 우회 기법을 방지합니다.
사용자는 이 서버를 글로벌 .NET 도구, Docker 또는 소스 빌드를 통해 배포할 수 있습니다. 각 이름이 지정된 서버 인스턴스에 대한 연결 문자열이 필요하며, 이는 appsettings.json 파일이나 환경 변수를 통해 구성할 수 있습니다. 운영 환경을 보호하기 위해 서버는 토큰 버킷 속도 제한과 동시성 제어를 구현하여 AI의 무한 루프를 방지합니다. 또한 점진적 탐색(progressive discovery) 기능을 갖추고 있어, 초기에는 AI 컨텍스트 창을 작게 유지하기 위해 소수의 핵심 도구 세트만 노출하고 필요한 경우에만 추가 도구 세트를 로드합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
SqlAugur MCP 도구 29
README에서 감지됨list_serverslist_databasesread_dataget_query_planget_schema_overviewdescribe_tablelist_programmable_objectsget_object_definitionget_extended_propertiesget_object_dependenciesget_plantuml_diagramget_mermaid_diagram
| list_servers | — | |
| list_databases | — | |
| read_data | — | |
| get_query_plan | — | |
| get_schema_overview | — | |
| describe_table | — | |
| list_programmable_objects | — | |
| get_object_definition | — | |
| get_extended_properties | — | |
| get_object_dependencies | — | |
| get_plantuml_diagram | — | |
| get_mermaid_diagram | — |
도구 29개 모두 보기도구 수 줄이기
verbosesp_blitzsp_blitz_firstsp_blitz_cachesp_blitz_indexsp_blitz_whosp_blitz_locksp_blitz_plan_comparesp_pressure_detectorsp_quickie_storesp_quickie_cachesp_health_parsersp_log_huntersp_human_events_block_viewersp_index_cleanupsp_query_repro_buildersp_whoisactive
| verbose | — | |
| sp_blitz | — | |
| sp_blitz_first | — | |
| sp_blitz_cache | — | |
| sp_blitz_index | — | |
| sp_blitz_who | — | |
| sp_blitz_lock | — | |
| sp_blitz_plan_compare | — | |
| sp_pressure_detector | — | |
| sp_quickie_store | — | |
| sp_quickie_cache | — | |
| sp_health_parser | — | |
| sp_log_hunter | — | |
| sp_human_events_block_viewer | — | |
| sp_index_cleanup | — | |
| sp_query_repro_builder | — | |
| sp_whoisactive | — |
자동 검사
2026년 11월 12일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능통과
- 오픈 소스 라이선스 (OSI)통과
- 최근 1년 내 커밋 또는 릴리스통과
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 원격 엔드포인트가 HTTPS 사용검사되지 않음
- 파괴적인 도구에 라벨 표시됨통과
- 모델에 대한 숨겨진 지침 없음통과
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
README
GitHub에서 보기SqlAugur
An MCP server that gives AI assistants safe, read-only access to SQL Server databases. Every query is parsed into a full AST using Microsoft's official T-SQL parser — not regex — so comment injection, string literal tricks, and encoding bypasses are blocked at the syntax level.
┌──────────────┐ ┌───────────────────────────────────────────┐ ┌──────────────┐
│ │ stdio │ SqlAugur │ │ │
│ AI Client │◄────────►│ │───────►│ SQL Server │
│ │ │ ┌────────────┐ ┌──────────────────────┐ │ │ │
└──────────────┘ │ │ Query │ │ Schema / Diagram / │ │ └──────────────┘
│ │ Validator │ │ DBA Services │ │
│ └────────────┘ └──────────────────────┘ │
│ ┌────────────────────────────────────┐ │
│ │ Rate Limiter │ │
│ └────────────────────────────────────┘ │
└───────────────────────────────────────────┘
Quick Start
Use this order for all install methods:
- Install SqlAugur
- Save
appsettings.jsonin the correct location - Add SqlAugur to your MCP client config
- Verify by asking your assistant to call
list_servers
Start with Installation for exact commands and file paths.
Why This Approach
-
AST-level query validation — Most MCP database servers use keyword blocking or no validation at all. This project parses every query into a full syntax tree using Microsoft's official
TSql180Parser. Comment injection, string literal tricks, and encoding bypasses are blocked at the syntax level, not with fragile regex patterns. -
Rate limiting — Token bucket throughput limiting and concurrency control prevent runaway AI query loops from overwhelming production SQL Servers. No other MCP database server offers this.
-
DBA diagnostic tooling — Integrated support for First Responder Kit, DarlingData, and sp_WhoIsActive with parameter blocking that prevents write operations. This is an entirely new MCP capability category.
-
Response size optimisation — DBA tools exclude verbose columns (XML query plans, deadlock graphs, metric breakdowns) and truncate long strings by default, reducing response sizes by 90–99%. Use
verboseandincludeQueryPlansparameters to get full untruncated output when needed. -
Progressive discovery — Up to 31 tools organized into toolsets that load on demand. Only 6 core tools are exposed initially, keeping the AI's context window small and reducing token usage. Additional toolsets are discovered and enabled as needed.
Features
Security
- Read-only by design — only SELECT and CTE queries are permitted
- AST-based query validation using ScriptDom (not regex)
- Parameter blocking on all diagnostic stored procedures to prevent writes
- Concurrency and throughput rate limiting
Database Tooling
- Multi-server support — named connections to multiple SQL Server instances
- Schema overview — concise Markdown schema maps with PKs, FKs, constraints, and defaults
- Table documentation — Markdown descriptions of columns, indexes, foreign keys, and constraints
- ER diagram generation — PlantUML and Mermaid diagrams with smart cardinality detection
- Schema exploration — list programmable objects, view definitions, extended properties, dependency graphs
- Query plan analysis — estimated or actual XML execution plans
- DBA diagnostics — optional integration with First Responder Kit, DarlingData, and sp_WhoIsActive with automatic response size optimisation
- Progressive discovery — dynamic toolset mode reduces initial context window usage by exposing tools on demand
Installation
All methods produce the same MCP server. Follow this order: install, save config, wire client, verify.
NuGet Global Tool (recommended)
1. Install (prerequisite: .NET 10.0 runtime)
dotnet tool install -g SqlAugur
2. Save config file
# Linux/macOS
mkdir -p ~/.config/sqlaugur
# Edit ~/.config/sqlaugur/appsettings.json with your server connections
# Windows (PowerShell)
mkdir "$env:APPDATA\sqlaugur" -Force
# Edit %APPDATA%\sqlaugur\appsettings.json with your server connections
Example appsettings.json to save at that location:
{
"SqlAugur": {
"Servers": {
"production": {
"ConnectionString": "Server=myserver;Database=master;Integrated Security=True;TrustServerCertificate=False;Encrypt=True;"
}
}
}
}
3. Add to MCP client
{
"mcpServers": {
"sqlaugur": {
"command": "sqlaugur"
}
}
}
To update: dotnet tool update -g SqlAugur
Docker / Podman
1. Run SqlAugur container
# Volume-mount a config file
docker run -i --rm \
-v /path/to/appsettings.json:/app/appsettings.json:ro,Z \
ghcr.io/mbentham/sqlaugur:latest
# Or use environment variables (no config file needed)
docker run -i --rm \
-e SqlAugur__Servers__production__ConnectionString="Server=host.docker.internal;Database=master;..." \
ghcr.io/mbentham/sqlaugur:latest
Note: To reach a SQL Server on the host machine, use
host.docker.internal(Docker Desktop) or--network=host(Linux). Replacedockerwithpodman— all commands are identical. The:Zflag on volume mounts is required for SELinux-enabled systems (Fedora, RHEL); Docker Desktop users on macOS/Windows can omit it.
If you mount a config file, save it as /path/to/appsettings.json and mount it to /app/appsettings.json.
2. Add to MCP client
{
"mcpServers": {
"sqlaugur": {
"command": "docker",
"args": ["run", "-i", "--rm",
"-v", "/path/to/appsettings.json:/app/appsettings.json:ro,Z",
"ghcr.io/mbentham/sqlaugur:latest"]
}
}
}
services:
sqlaugur:
image: ghcr.io/mbentham/sqlaugur:latest
stdin_open: true
volumes:
- ./appsettings.json:/app/appsettings.json:ro,Z
MCP client configuration:
{
"mcpServers": {
"sqlaugur": {
"command": "docker",
"args": ["compose", "run", "-i", "--rm", "sqlaugur"]
}
}
}
Build from Source
1. Build (prerequisite: .NET 10.0 SDK)
git clone git@github.com:mbentham/SqlAugur.git
cd SqlAugur
dotnet publish SqlAugur -c Release -o SqlAugur/publish
2. Save config file
# Linux/macOS
cp SqlAugur/appsettings.example.json SqlAugur/publish/appsettings.json
# Edit SqlAugur/publish/appsettings.json with your server connections
# Windows (PowerShell)
Copy-Item SqlAugur\appsettings.example.json SqlAugur\publish\appsettings.json
# Edit SqlAugur\publish\appsettings.json with your server connections
3. Add to MCP client
{
"mcpServers": {
"sqlaugur": {
"command": "dotnet",
"args": ["/absolute/path/to/SqlAugur/publish/SqlAugur.dll"]
}
}
}
Verify the MCP connection (LLM-first)
After restarting your MCP client, ask the assistant:
Call list_serversCall list_databases for server "production"
Expected result:
list_serversreturns your configured server name (for exampleproduction)list_databasesreturns a JSON array of databases, not a connection or authentication error
If verification fails:
- Confirm MCP config runs the expected command (
sqlaugur,docker run ..., ordotnet /path/to/SqlAugur.dll) - Confirm
appsettings.jsonis saved where your install method expects it:- Local tool:
~/.config/sqlaugur/appsettings.json(Linux/macOS) or%APPDATA%\sqlaugur\appsettings.json(Windows) - Container: mounted to
/app/appsettings.json - Source build: next to the published DLL (
SqlAugur/publish/appsettings.json)
- Local tool:
- Confirm the tool call uses a configured server key (for example
production) - Confirm SQL connectivity and authentication in the connection string
Configuration
The server loads configuration from multiple sources. Higher-priority sources override lower ones:
- Command-line arguments
- Environment variables — using
__as section delimiter (e.g.,SqlAugur__Servers__production__ConnectionString=...) - Current working directory —
appsettings.jsonin the directory you run the command from - User config directory —
~/.config/sqlaugur/appsettings.jsonon Linux,%APPDATA%\sqlaugur\appsettings.jsonon Windows - Azure Key Vault — when
AzureKeyVaultUriis set (see below) - App directory —
appsettings.jsonnext to the DLL
Example configuration (Windows Authentication — recommended):
{
"SqlAugur": {
"Servers": {
"production": {
"ConnectionString": "Server=myserver;Database=master;Integrated Security=True;TrustServerCertificate=False;Encrypt=True;"
}
},
"MaxRows": 1000,
"CommandTimeoutSeconds": 30,
"MaxConcurrentQueries": 5,
"MaxQueriesPerMinute": 60,
"EnableFirstResponderKit": false,
"EnableDarlingData": false,
"EnableWhoIsActive": false,
"EnableDynamicToolsets": false
}
}
| Option | Default | Description |
|---|---|---|
Servers |
— | Named SQL Server connections (name → connection string). Connections identify themselves to SQL Server as SqlAugur (program_name, Extended Events client_app_name) unless the connection string sets its own Application Name. |
MaxRows |
1000 | Maximum rows returned per query, inline or in a result file |
ResultFileThresholdRows |
500 | read_data results over this many rows (or about 40,000 characters) are written to a CSV file instead of returned inline, avoiding oversized stdio messages. 0 disables. |
ResultsDirectory |
sqlaugur/results under the user's local application data folder (%LOCALAPPDATA%\sqlaugur\results on Windows) |
Where result files are written. Must be an absolute path. |
ResultFileRetentionDays |
7 | Result files older than this are deleted at startup |
CommandTimeoutSeconds |
30 | SQL command timeout for all queries and procedures |
MaxConcurrentQueries |
5 | Maximum number of SQL queries that can execute concurrently |
MaxQueriesPerMinute |
60 | Maximum queries allowed per minute (token bucket rate limit) |
EnableFirstResponderKit |
false | Enable First Responder Kit diagnostic tools (sp_Blitz, sp_BlitzFirst, sp_BlitzCache, sp_BlitzIndex, sp_BlitzWho, sp_BlitzLock, sp_BlitzPlanCompare) |
EnableDarlingData |
false | Enable DarlingData diagnostic tools (sp_PressureDetector, sp_QuickieStore, sp_QuickieCache, sp_HealthParser, sp_LogHunter, sp_HumanEventsBlockViewer, sp_IndexCleanup, sp_QueryReproBuilder) |
EnableWhoIsActive |
false | Enable sp_WhoIsActive session monitoring |
EnableDynamicToolsets |
false | Enable progressive tool discovery — DBA tools load on demand via 3 meta-tools instead of at startup. Reduces initial context window usage. The Enable* flags still control which toolsets are allowed. |
AzureKeyVaultUri |
— | Azure Key Vault URI (e.g., https://myvault.vault.azure.net/). When set, secrets from the vault are added as a configuration source using DefaultAzureCredential. Key Vault secret names use -- as a section separator (e.g., a secret named SqlAugur--Servers--prod--ConnectionString maps to SqlAugur:Servers:prod:ConnectionString). |
Security Note:
appsettings.jsonis gitignored to prevent accidental credential commits. See SECURITY.md for recommended authentication methods including Windows Authentication, Azure Managed Identity, and secure credential storage options.
Tools
The server provides 31 tools organized into toolsets. Six core tools are always available. Additional toolsets are loaded at startup (static mode) or on demand (dynamic mode).
Core Tools
| Tool | Description |
|---|---|
list_servers |
Lists available SQL Server instances configured in appsettings.json. |
list_databases |
Lists all databases on a named server with names, IDs, states, and creation dates. |
read_data |
Executes a read-only SQL SELECT query. Only SELECT and WITH (CTE) queries are allowed. Small results are returned as JSON; large ones go to a CSV file, returning its path, row count, columns and a 10-row preview. Pass toFile: true to always get a file. |
get_query_plan |
Returns the estimated or actual XML execution plan for a SELECT query. |
get_schema_overview |
Concise Markdown schema overview: tables, columns, PKs, FKs, unique/check constraints, defaults. Supports compact mode, schema and table filtering. |
describe_table |
Comprehensive table metadata in Markdown: columns, data types, nullability, defaults, identity, computed expressions, indexes, FKs, constraints. |
| Tool | Description |
|---|---|
list_programmable_objects |
Lists views, stored procedures, functions, and triggers. Filterable by type and schema. |
get_object_definition |
Returns the source definition (CREATE statement) of a programmable object. |
get_extended_properties |
Reads extended properties (descriptions, metadata) on tables, columns, and other objects. |
get_object_dependencies |
Shows what an object references and what references it — upstream and downstream dependency graphs. |
| Tool | Description |
|---|---|
get_plantuml_diagram |
Generates a PlantUML ER diagram with tables, columns, PKs, and FK relationships. Saves to a .puml file. Supports compact mode, schema/table filtering, and a configurable table limit (max 200). |
get_mermaid_diagram |
Generates a Mermaid ER diagram with tables, columns, PKs, and FK relationships. Saves to a .mmd file. Supports compact mode, schema/table filtering, and a configurable table limit (max 200). |
DBA Diagnostic Tools
Each toolkit is enabled independently via config flags and requires the corresponding stored procedures installed on the target SQL Server.
All DBA tools apply response size optimisation by default — XML query plan columns are excluded and long string values are truncated to keep responses within AI context window limits. Every tool supports these optional parameters:
| Parameter | Description |
|---|---|
verbose |
Return all columns with no truncation. |
includeQueryPlans |
Include XML execution plan columns in the output. |
maxRows |
Maximum rows to return per result set. Available on tools with variable-length output: BlitzIndex, BlitzLock, HealthParser, LogHunter (default 200), IndexCleanup, QueryReproBuilder. |
Some tools have additional parameters: includeXmlReports (BlitzLock, HealthParser, HumanEventsBlockViewer), compact (sp_WhoIsActive), verboseMetrics (QuickieStore).
Install from: github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit
| Tool | Description |
|---|---|
sp_blitz |
Overall SQL Server health check — prioritized findings for performance, configuration, and security. |
sp_blitz_first |
Real-time performance diagnostics — samples DMVs over an interval for waits, file latency, and perfmon counters. |
sp_blitz_cache |
Plan cache analysis — top queries by CPU, reads, duration, executions, or memory grants. |
sp_blitz_index |
Index analysis — missing, unused, and duplicate indexes with usage patterns. |
sp_blitz_who |
Active query monitor — what's running, blocking info, tempdb usage, query plans. |
sp_blitz_lock |
Deadlock analysis from the system_health extended event session. |
sp_blitz_plan_compare |
Cross-server query plan comparison — captures a plan snapshot on one server and compares it to the cached plan on a second server without using linked servers. Requires the demon_hunters branch until merged to main. |
Install from: github.com/erikdarling/DarlingData
| Tool | Description |
|---|---|
sp_pressure_detector |
Diagnoses CPU and memory pressure — resource bottlenecks, high-CPU queries, memory grants, disk latency. |
sp_quickie_store |
Query Store analysis — top resource-consuming queries, plan regressions, wait statistics. |
sp_quickie_cache |
Plan cache analysis — high-impact queries ranked by impact score over the dm_exec_*_stats DMVs (the plan-cache companion to sp_quickie_store). |
sp_health_parser |
Parses the system_health extended event session for historical waits, disk latency, CPU, memory, and locking. |
sp_log_hunter |
Searches SQL Server error logs for errors, warnings, and custom messages. |
sp_human_events_block_viewer |
Analyzes blocking events from sp_HumanEvents sessions — blocking chains, lock details, waits. |
sp_index_cleanup |
Finds unused and duplicate indexes that are candidates for removal. |
sp_query_repro_builder |
Generates reproduction scripts for Query Store queries with parameter values. |
Install from: whoisactive.com
| Tool | Description |
|---|---|
sp_whoisactive |
Monitors active sessions and queries — wait info, blocking details, tempdb usage, resource consumption. |
Progressive Discovery
When EnableDynamicToolsets is true, only core tools load at startup. Three meta-tools let the AI discover and enable additional toolsets on demand, reducing initial context window usage:
| Tool | Description |
|---|---|
list_toolsets |
Lists available toolsets with status (available, enabled, not configured) and tool counts. |
get_toolset_tools |
Returns detailed tool and parameter info for a specific toolset before enabling it. |
enable_toolset |
Enables a toolset, making its tools available. Only works if the admin has enabled the toolset via the corresponding Enable* config flag. |
Example flow:
- AI calls
list_toolsets— seesfirst_responder_kitis "available" (configured but not yet enabled) - AI calls
get_toolset_tools("first_responder_kit")— reviews the 7 tools and their parameters - AI calls
enable_toolset("first_responder_kit")— the 7 tools are now registered and usable - AI calls
sp_blitz— runs the health check as normal
In static mode (EnableDynamicToolsets: false), all enabled toolsets load at startup and the discovery tools are not registered. Schema Exploration and Diagrams toolsets are always loaded regardless of mode.
Known limitation: Progressive discovery relies on the MCP
notifications/tools/list_changednotification to inform clients that new tools have been registered. Claude Code does not currently handle this notification (anthropics/claude-code#4118), so dynamically enabled toolsets will not appear. Use static mode (EnableDynamicToolsets: false) when using Claude Code.
Security
Query Validation
Every query is parsed into an Abstract Syntax Tree (AST) using Microsoft's official TSql180Parser and must pass these rules:
- Single statement only — multiple statements are rejected
- SELECT only — INSERT, UPDATE, DELETE, DROP, EXEC, CREATE, ALTER, and all other statement types are blocked
- No SELECT INTO — prevents table creation via SELECT
- No external data access — OPENROWSET (all variants including BULK, Cosmos DB, and internal), OPENQUERY, OPENDATASOURCE, OPENXML blocked
- No linked servers — four-part name references are rejected
- No MAXRECURSION hint — prevents overriding the default recursion limit
- Cross-database queries are allowed — three-part names work by design; the security boundary is the server, not the database. To restrict to a single database, limit the login's permissions.
Because validation operates on the parsed AST, it correctly handles edge cases that defeat string-based approaches: keywords inside comments, string literals, nested block comments, and encoding tricks.
Parameter Blocking
Diagnostic stored procedures execute via whitelisted procedure names with blocked parameters that prevent writes:
- First Responder Kit — all
@Output*parameters blocked (prevents writing results to server tables) - DarlingData — logging and output parameters blocked (prevents table creation and data retention)
- sp_WhoIsActive —
@destination_table,@return_schema,@schema,@helpblocked
Rate Limiting
All tool executions are subject to concurrency limiting (MaxConcurrentQueries, default 5) and throughput limiting (MaxQueriesPerMinute, default 60). Excess requests are rejected with a retry message.
Connection Security
Use Windows Authentication or Azure Managed Identity where possible to avoid storing credentials in config files. When SQL Authentication is required, use environment variable overrides to inject credentials at runtime. See SECURITY.md for detailed guidance including credential stores and connection string encryption.
Known Risks
- This project depends on the official Microsoft MCP C# SDK (
ModelContextProtocolNuGet package, version 1.3.0). As the MCP framework handles all protocol I/O, any vulnerability in it directly affects this application's security boundary. Monitor the package for updates and upgrade when new versions are released. - The data returned from a SQL Server query could include malicious prompt injection targeting AIs. This is a risk of all AI use and cannot be mitigated by this project. Ensure you're following best practices for AI security and only connecting to trusted data sources.
Contributing
Contributions are welcome. See CONTRIBUTING.md for architecture details, development setup, testing instructions, and guidelines for adding new tools.
License
SqlAugur MCP 질문
SqlAugur MCP는 어떤 도구를 제공하나요?
29개 도구를 제공합니다. 예: list_servers, list_databases, read_data, get_query_plan, get_schema_overview.
SqlAugur는 어떻게 쿼리의 안전성을 보장하나요?
Microsoft의 공식 T-SQL 파서를 사용하여 모든 쿼리를 전체 추상 구문 트리(AST)로 변환하며, 구문 수준에서 주석 주입 및 인코딩 우회 공격을 차단합니다.
이 MCP server가 쓰기 작업을 수행할 수 있나요?
아니요, 읽기 전용으로 설계되어 SELECT 및 CTE 쿼리만 허용하며, 진단 프로시저에 대한 파라미터 차단 기능을 사용하여 쓰기 작업을 방지합니다.
DBA 진단 도구를 지원하나요?
네, First Responder Kit, DarlingData, sp_WhoIsActive에 대한 통합 지원을 포함하며 응답 크기를 자동으로 최적화합니다.
데이터베이스 부하를 어떻게 방지하나요?
토큰 버킷 처리량 제한과 동시성 제어를 사용하여 속도 제한을 구현합니다.