Sqlserver MCP B48cb3dd

MCP数据服务

提供方 HeathLoganCampbell

数据服务 未标注 无需鉴权 社区 / 第三方

一个轻量级的MCP服务器,通过HTTP提供安全的只读工具,用于探索Microsoft SQL Server数据库。

一句话选型结论

按资料字段整理

Sqlserver MCP B48cb3dd 属于数据服务类 MCP 服务器,传输方式未标注,无需鉴权,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类数据服务 传输方式未标注 鉴权无需鉴权 部署方式未标注
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 3 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

数据服务
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量3暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

适用场景

数据库查询C#本地部署SQLServerHTTP服务只读工具MCP协议

安装与配置

未标注 无需鉴权
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 3 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
数据库查询

用自然语言查库、取数,不用手写 SQL。

数据同步与清洗

把多来源数据拉到一处做整理。

报表取数

按口径快速拉出统计结果。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 3 个工具,职责相对集中,接入后不容易误操作。
  • 资料标注无需鉴权,装好就能连。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在数据服务场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Sqlserver MCP B48cb3dd当前 3 未标注 未标注 无 2026-05-17
Memory 9d25f64e 9 未标注 未标注 无 2026-05-17
Getzep MCP 9 stdio · 本地进程 本地部署 有 2026-05-17
anything-llm 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Prisma MCP Server 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Astr Bot 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

数据服务
字段来自项目仓库与公开索引,中文说明由本站标注
提供方HeathLoganCampbell上游标注的维护方 HeathLoganCampbell
分类数据服务本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式无需鉴权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

5.5 KB
来自项目仓库与上游目录的原文,未做删改

SqlServer-MCP

A lightweight Model Context Protocol (MCP) server that exposes safe, read-focused tools for exploring a Microsoft SQL Server database over HTTP. It’s intended to be consumed by MCP-compatible clients and agents.


Features

  • Exposes SQL Server tooling via MCP:
  • SqlListTables: List user tables (schema.table).
  • SqlPreviewTable: Preview up to top rows from a table.
  • SqlRunQuery: Execute read-only SELECT (and WITH CTE) queries.
  • HTTP transport hosted by ASP.NET Core, default: http://localhost:3001.
  • Connection string configured via appsettings.json or environment variables.

Learnings

Best way to represent schemas to GPT?

Use a markdown file, likely one for each table```
<SCHEMA>
tables:
Employees:
columns:
id: int (PK)
name: string
department_id: int (FK → Departments.id)
status: enum["ACTIVE","INACTIVE"]
</SCHEMA>


#### Schema Prompting
https://medium.com/@nikunj.agarwal012/schema-prompting-a-revolutionary-approach-to-querying-databases-b950954ccc62
* Schema prompting involves giving a language model (LLM) a formal description of a database schema (tables, columns, types, relationships) along with the user’s natural-language request
* Lowers barrier to entry - non-SQL-savvy users or analysts can query the database by asking in natural language
* Speeds up query generation - developers and analysts save time compared to writing SQL by hand.

1. Schema definition - listing tables, columns, types, relationships (Done by the developer)
2. User question - what data the user wants, in natural language. (Done by a user)
3. Instruction to generate SQL - telling the model to output a SQL query based on the schema + question. (Done by a LLM)
4. Executed SQL - Run the SQL against the database and respond to the user with the response. (Done by this project)
---

### Project layout
- `SqlServer-MCP/Program.cs`: Configures the web host, reads the connection string, registers MCP server and tools, maps MCP endpoint, and runs at `http://localhost:3001`.
- `SqlServer-MCP/SqlServerTools.cs`: Implements the MCP tools for SQL Server (listed above).
- `SqlServer-MCP/appsettings.json`: Holds `ConnectionStrings:SqlServer`.
- `SqlServer-MCP/SqlServer-MCP.csproj`: .NET project config and package references.

---

### Prerequisites
- .NET SDK `9.0` or later
- Access to a Microsoft SQL Server instance
- An MCP-compatible client if you want to consume the tools via MCP (e.g., MCP-enabled IDEs/agents)

---

### Configuration
Set the connection string using one of the following methods.

1) `appsettings.json` (default)```json
{
  &quot;ConnectionStrings&quot;: {
    &quot;SqlServer&quot;: &quot;Server=localhost;Database=YourDb;Trusted_Connection=True;TrustServerCertificate=True;&quot;
  }
}

2) Environment variable (overrides file)
- Key: ConnectionStrings__SqlServer
- Example:
- Windows (PowerShell):powershell $env:ConnectionStrings__SqlServer = &quot;Server=localhost;Database=YourDb;User Id=sa;Password=YourPassword;TrustServerCertificate=True;&quot;
- Linux/macOS (bash):bash export ConnectionStrings__SqlServer=&quot;Server=localhost;Database=YourDb;User Id=sa;Password=YourPassword;TrustServerCertificate=True;&quot;

Notes:
- For local dev with self-signed certs, TrustServerCertificate=True can be convenient.
- For Windows Integrated Auth, use Trusted_Connection=True.


Build and run

From the repository root:```bash

Build

dotnet build

Run (Debug)

dotnet run --project SqlServer-MCP

Or run on a specific URL

dotnet run --project SqlServer-MCP --urls "http://localhost:3001"
```

On start, the server listens on http://localhost:3001 and exposes the MCP endpoint via HTTP transport.


Using the MCP tools

This server is designed to be consumed by MCP clients. After connecting your MCP client to http://localhost:3001, you can invoke the following tools:

  • SqlListTables()
  • Description: Lists user tables in the current SQL Server database.
  • Returns: List like schema.table.

  • SqlPreviewTable(string tableName, int top = 20)

  • Description: Returns up to top rows from the given schema.table.
  • Returns: TableResult with Columns and collection of row dictionaries.

  • SqlRunQuery(string sql)

  • Description: Executes a read-only SELECT query (or WITH CTE). Non-SELECT is blocked.
  • Returns: TableResult as above.

Security note: SqlRunQuery intentionally rejects non-SELECT statements.


Troubleshooting

  • Startup assertion: Assertion failed. connString != null
  • Cause: No connection string found.
  • Fixes:

    • Ensure appsettings.json exists and is copied to output, the project already includes:xml &lt;ItemGroup&gt; &lt;Content Include=&quot;appsettings.json&quot;&gt; &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt; &lt;/Content&gt; &lt;/ItemGroup&gt;
    • Confirm the key path is exactly ConnectionStrings → SqlServer.
    • Provide via environment variable ConnectionStrings__SqlServer if preferred.
  • SQL connectivity errors:

  • Verify server hostname/port, credentials, and network access.
  • If using containers or remote SQL Server, make sure ports are exposed and reachable.

Packages

  • ModelContextProtocol and ModelContextProtocol.AspNetCore (0.4.1-preview.1)
  • Microsoft.Data.SqlClient (7.0.0-preview2.25289.6)
  • Microsoft.SqlServer.Server (1.0.0)
  • Pagination and filtering for previews
  • Optional parameterized query support for safe templates
  • Additional metadata tools (indexes, foreign keys, etc.)

常见问题

5 问
答案由本站依据条目字段整理,不引用上游原文
Sqlserver MCP B48cb3dd 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

Sqlserver MCP B48cb3dd 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

Sqlserver MCP B48cb3dd 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Sqlserver MCP B48cb3dd 需要 API Key 吗?

资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

Sqlserver MCP B48cb3dd 能提供哪些能力?

资料显示约 3 个工具;能力标签包括 数据分析、C#、HTTP服务。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。