I
ian-cowley/MCPSqlServer
Query Microsoft SQL Server
在 GitHub 查看 ↗链接已于 2026-11-12 核查 · HTTP 200 · 打开的是厂商自己的官网
我们没有从该仓库取到可核对的安装命令,也没有公开的远端端点。这两样都没有时,我们不出配置——编一条出来比不给更糟。 各客户端的接法 →
- 来源明细
- 收录自 abordage/awesome-mcp 榜单(我们从中收集的条目之一) · 条目类型:MCP 服务
- 收录与活跃
- 收录于 2026-11-05 · 最近见到 2026-11-14 · 共见到 10 次 · 被 10 个来源列出
- 评分构成
- 综合分 1,003 · 10 个来源 · mcp
常见问题(答案都来自我们的记录)
它适合谁 / 用来做什么?
我们把它归在这些标签下: MCP 服务。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
我们收录于 2026-11-05;最近见到 2026-11-14。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。
# SQL Server MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A standalone MCP (Model Context Protocol) server written in C# that provides SQL Server integration capabilities for any MCP-compliant IDE or client.
## Features
SQL Server connectivity
Database schema exploration
Table and view inspection
Column metadata retrieval
Stored procedure enumeration
SQL query execution
Stored procedure execution
Debug mode for troubleshooting
Configurable logging path
Dynamic Project Connection Resolver: Automatically resolves and overrides database connection strings dynamically based on the active file in the editor
## Prerequisites
.NET 10.0 SDK or higher
SQL Server instance (local or remote)
SQL Server client tools
## Setup
1. Build the project:
cmd
dotnet build
2. Configure the application:
Copy appsettings.example.json to appsettings.json
Update the connection string and other settings in appsettings.json with your SQL Server details
json
"ConnectionStrings": {
"DefaultConnection": "Server=your-server;Database=master;User ID=your-username;Password=your-password;TrustServerCertificate=True"
},
"LogPath": "C:\\Path\\To\\Your\\LogDirectory\\",
"DebugMode": "false"
3. Configure the MCP server in your IDE / client:
Add the server configuration to your IDE's MCP config file (e.g., Windsurf, Claude Desktop config, or Cline/Cursor settings).
Point the command to the path of your built executable:
json
"mcpServers": {
"sqlMcpService": {
"command": "path/to/your/MCPSqlServer.exe",
"args": [],
"description": "SQL Server MCP Service"
4. Set up GitHub integration:
Create a new GitHub repository for your project
Initialize a new Git repository in your project directory using git init
Add your GitHub repository as a remote using git remote add origin
Push your changes to the remote repository using git push -u origin master
## Configuration Options
The appsettings.json file contains the following configuration options:
ConnectionStrings:DefaultConnection: The SQL Server connection string
LogPath: Directory where log files will be stored
DebugMode: Set to "true" to enable detailed debug logging
AllowWorkspaceOverride: Set to "false" to disable dynamic project connection overrides (defaults to "true")
## Dynamic Project Connection Resolver
In multi-project workspaces where different folders or subprojects connect to different databases, you can avoid updating the main configuration constantly:
1. All database tools accept an optional currentFilePath parameter (typically automatically populated by the IDE client with the active file's path).
2. The server walks up the directory tree from the file's parent folder looking for the nearest appsettings.json.
3. If found, it dynamically extracts and uses that file's ConnectionStrings:DefaultConnection for the query execution.
4. If no config file is found, or if AllowWorkspaceOverride is set to "false", it falls back to the primary connection string loaded at startup.
## Publishing
You can publish the application as a self-contained executable:
cmd
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true
This will create a single executable file that includes all dependencies.
## Protocol
The MCP server communicates through standard input/output using the standard JSON-RPC 2.0 Model Context Protocol.
## Features
SQL Server connectivity
Database schema exploration
Table and view inspection
Column metadata retrieval
Stored procedure enumeration
SQL query execution
Stored procedure execution
Debug mode for troubleshooting
Configurable logging path
Dynamic Project Connection Resolver: Automatically resolves and overrides database connection strings dynamically based on the active file in the editor
## Prerequisites
.NET 10.0 SDK or higher
SQL Server instance (local or remote)
SQL Server client tools
## Setup
1. Build the project:
cmd
dotnet build
2. Configure the application:
Copy appsettings.example.json to appsettings.json
Update the connection string and other settings in appsettings.json with your SQL Server details
json
"ConnectionStrings": {
"DefaultConnection": "Server=your-server;Database=master;User ID=your-username;Password=your-password;TrustServerCertificate=True"
},
"LogPath": "C:\\Path\\To\\Your\\LogDirectory\\",
"DebugMode": "false"
3. Configure the MCP server in your IDE / client:
Add the server configuration to your IDE's MCP config file (e.g., Windsurf, Claude Desktop config, or Cline/Cursor settings).
Point the command to the path of your built executable:
json
"mcpServers": {
"sqlMcpService": {
"command": "path/to/your/MCPSqlServer.exe",
"args": [],
"description": "SQL Server MCP Service"
4. Set up GitHub integration:
Create a new GitHub repository for your project
Initialize a new Git repository in your project directory using git init
Add your GitHub repository as a remote using git remote add origin
Push your changes to the remote repository using git push -u origin master
## Configuration Options
The appsettings.json file contains the following configuration options:
ConnectionStrings:DefaultConnection: The SQL Server connection string
LogPath: Directory where log files will be stored
DebugMode: Set to "true" to enable detailed debug logging
AllowWorkspaceOverride: Set to "false" to disable dynamic project connection overrides (defaults to "true")
## Dynamic Project Connection Resolver
In multi-project workspaces where different folders or subprojects connect to different databases, you can avoid updating the main configuration constantly:
1. All database tools accept an optional currentFilePath parameter (typically automatically populated by the IDE client with the active file's path).
2. The server walks up the directory tree from the file's parent folder looking for the nearest appsettings.json.
3. If found, it dynamically extracts and uses that file's ConnectionStrings:DefaultConnection for the query execution.
4. If no config file is found, or if AllowWorkspaceOverride is set to "false", it falls back to the primary connection string loaded at startup.
## Publishing
You can publish the application as a self-contained executable:
cmd
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true
This will create a single executable file that includes all dependencies.
## Protocol
The MCP server communicates through standard input/output using the standard JSON-RPC 2.0 Model Context Protocol.
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[](https://anclum.com/zh/s/ian-cowley-mcpsqlserver/)
- 来源
- awesome · https://github.com/ian-cowley/MCPSqlServer
- 按领域浏览
- MCP 服务
- 收录来源
- 10 个独立来源
- 收录于
- 今天
同类推荐
所属领域与标签
每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。