SqlToAi
概览
作者提供的说明(英文原文)
Microsoft SQL Server schema discovery and SQL tools over local stdio on Windows x64.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i1 项中通过 1 项依据公开信息检查;尚未扫描代码
- 使用情况i非常新★ –
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 数据库与数据集
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:1 项中通过 1 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 注册中心没有列出需要填写的密钥。
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
链接指向作者自己的文件;我们不托管也不重新打包它。打开文件后,Claude Desktop 会进行安装。
在终端中运行这条命令
浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月9日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 RalfHuesing 验证,该账户拥有此仓库
- … 尚未检查
仍在维护
我们还没有从 GitHub 读取这个仓库
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“数据库与数据集”中的其他服务器比较i
- 星标数多于此分类中其他 1153 个服务器的 0%
- 发布到注册中心的时间比此分类中其他 1153 个服务器的 65% 更新
- 基础检查结果等于或优于此分类中其他 1153 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
SqlToAi 安全吗?
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于–,最新版本(1.0.34)于23天前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 MCPB。
有什么可以替代它?
同一分类中有:Supabase, MongoDB MCP Server, Elasticsearch MCP Server
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
SqlToAi
SqlToAi is a local Model Context Protocol (MCP) server for Microsoft SQL Server. It gives MCP clients tools to inspect schemas, execute SQL, and compare query results and performance. The server runs over stdio and is built with .NET 10.
Capabilities
- Retrieve SQL Server and database environment metadata (version, edition, compatibility level, collation, state, read-only status).
- Inspect tables, views, routines, triggers, keys, indexes, and object references.
- Inspect estimated query execution plans with compact operator trees and warnings without executing queries.
- Export database schema as linked Markdown files for offline reading.
- Execute parameterized queries and local
.sqlscripts, includingGObatches. - Stream query results directly into local CSV or JSONL files with compact metadata responses.
- Measure CPU time, elapsed time, reads, and execution plan warnings; compare a baseline query with a candidate and inspect missing-index suggestions.
- Configure database access levels, from schema-only access to read/write access.
- Mask string query results or replace them with reversible in-memory tokens; add table and column descriptions from SQL Server or a metadata database.
See the tool reference for arguments and behavior.
Export schema without starting the MCP server:
.\SqlToAi.exe export-schema --database primary/DemoDB --output C:\Doku\Database
The output directory must be absent or empty. The export contains schema details and SQL definitions, without business records, metadata descriptions or anonymization indicators. A failure returns a nonzero exit code and leaves any files already written. See schema export for file layout and retry behavior.
Getting started
For a downloaded Windows x64 package, follow manual package setup (included as README.md beside the executable). Choose the ZIP to extract and launch the executable yourself, or the MCPB to install the same executable as a client launch entry. Both are self-contained and need no separate .NET runtime. Before either route can start the server, create %LOCALAPPDATA%\SqlToAi\appsettings.json manually from the supplied template; bundle installation does not create it. Updates preserve the separate user settings and logs, but upgrading from the old single-server settings is a breaking change: manually move old sections and provider settings under a named server, qualify database grants, and rename environment keys before the first new startup. There is no automatic migration; follow the upgrade instructions.
You need the .NET 10 SDK, a reachable SQL Server, and a database login with the permissions required by the tools you use.
Build
dotnet build SqlToAi.slnx -c Release
The Windows executable and configuration are written to src/SqlToAi/bin/Release/net10.0/.
Configure database access
Before starting SqlToAi, create %LOCALAPPDATA%\SqlToAi\appsettings.json manually from the shipped template. The main template has no database grants or working credentials; set the server, credentials, and access lists deliberately. The separate DemoDB example contains fictional local demo credentials and ReadWrite access. Select it manually for a local test database only; the host does not load it automatically.
For Windows authentication and string masking, configure the Databases and Servers sections with the following, substituting your database and server:
"Databases": {
"CacheTtlSeconds": 300, "ReadWrite": [], "ReadWriteAnonymized": [], "ReadOnly": [], "ReadOnlyAnonymized": ["primary/ReportingDB"], "SchemaOnly": [] }, "Servers": { "primary": { "Server": "localhost\\MSSQLSERVER2022", "IntegratedSecurity": true, "ConnectTimeoutSeconds": 30 } }
These sections belong inside the existing SqlToAi object. Keep Anonymizer.Enabled set to true. Databases absent from the access lists are denied. Use a SQL Server login with restricted permissions as well as the application access lists.
See configuration for manual setup, SQL authentication, per-field environment overrides, metadata, and logging.
Connect an MCP client
Add a stdio server entry to your client's MCP configuration, using the absolute path to your executable. The exact configuration location depends on the client.
{
"mcpServers": { "sql-to-ai": { "command": "C:\\Path\\To\\SqlToAi\\src\\SqlToAi\\bin\\Release\\net10.0\\SqlToAi.exe", "args": [] } } }
Check tools from the command line
Set-Location src/SqlToAi/bin/Release/net10.0
.\SqlToAi.exe query --help .\SqlToAi.exe query sql_list_databases --server primary .\SqlToAi.exe query sql_execute_query --database primary/ReportingDB --query "SELECT TOP 5 name FROM sys.tables" .\SqlToAi.exe query sql_explain_query --database primary/ReportingDB --query "SELECT TOP 5 name FROM sys.tables"
Tool results contain Markdown or JSON. Successful CLI calls write data to stdout; notices and errors go to stderr. Failed calls exit with code 1. See development and CLI usage for export and deployment.
Protection and limits
Read-only execution uses SQL statement validation and rollback transactions. ReadWrite permits changes with raw string results; ReadWriteAnonymized permits changes while applying the configured string masking or tokenization to query and script results. These application checks complement SQL Server permissions; they do not replace them.
String masking applies to query, script, and data export results for ReadOnlyAnonymized and ReadWriteAnonymized databases. Numeric values, dates, schema definitions, query-comparison difference samples, and execution plan content can remain visible. Tokens are reversible within the running server. This is not a guarantee that all sensitive data is removed.
Query comparison checks schema, row counts, and distinct set differences. It does not establish row ordering or duplicate multiplicity. Benchmark results describe the measured executions and do not guarantee a production improvement.
Application and error diagnostics remain enabled. Review the security boundaries and logging settings before use.
Documentation and development
- Documentation index
- Configuration and operation
- Security and data handling
- Tool reference
- Architecture
- Build, tests, CLI, and deployment
- Support and contribution guidance
- Security reporting
Run the xUnit v3 test suite with dotnet test SqlToAi.slnx.
License
MIT.