
ian-cowley/mcpsqlserver
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
SQL Server MCP Server - A standalone MCP server providing SQL Server integration capabilities
概要
A standalone MCP (Model Context Protocol) server written in C# that provides SQL Server integration capabilities for any MCP-compliant IDE or client. - 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 - : Automatically resolves and overrides database connection strings dynamically based on the active file in the editor - .NET 10.0 SDK or higher - SQL Server instance (local or remote) - SQL Server client tools 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 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).
README
以下は原文 README の抜粋です。原文を見る。
SQL Server MCP Server
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
- Build the project:
dotnet build
-
Configure the application:
- Copy
appsettings.example.jsontoappsettings.json - Update the connection string and other settings in
appsettings.jsonwith your SQL Server details
{ "ConnectionStrings": { "DefaultConnection": "Server=your-server;Database=master;User ID=your-username;Password=your-password;TrustServerCertificate=True" }, "LogPath": "C:\\Path\\To\\Your\\LogDirectory\\", "DebugMode": "false" } - Copy
-
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:
{ "mcpServers": { "sqlMcpService": { "command": "path/to/your/MCPSqlServer.exe", "args": [], "description": "SQL Server MCP Service" } } } -
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 stringLogPath: Directory where log files will be storedDebugMode: Set to “true” to enable detailed debug loggingAllowWorkspaceOverride: 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:
- All database tools accept an optional
currentFilePathparameter (typically automatically populated by the IDE client with the active file’s path). - The server walks up the directory tree from the file’s parent folder looking for the nearest
appsettings.json.
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"sqlMcpService": {
"command": "path/to/your/MCPSqlServer.exe",
"args": [],
"description": "SQL Server MCP Service"
}
}
}