AM

aaronontheweb/mssql-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

159 stars 23 forks 品質 75 トレンド 17Apache-2.0

aaronontheweb/mssql-mcp は、https://github.com/aaronontheweb/mssql-mcp. からインポートされたMCPサーバー候補です。

概要

aaronontheweb/mssql-mcp は、https://github.com/aaronontheweb/mssql-mcp. からインポートされたMCPサーバー候補です。

概要(AI 翻訳)

A .Microsoft SQL Server向けのNET搭載モデルコンテキストプロトコル(MCP)サーバー。

要旨

なぜこのようなものが存在するのでしょうか?市場に出回っている他のMCPソリューションは、一般的に動作しない不安定なものばかりで、Windowsでは特にそうです。

このMCPサーバーは、内部調整に Akka.NET と公式の MCP C# SDK プロトコル準拠を用いるクリーンでよく設計された.NET アプリケーションを通じて、Microsoft SQL Server データベースへの堅牢で信頼性の高いアクセスを提供します。

特徴

  • スキーマ発見:AIエージェントは複雑なSQLを書かずにデータベース構造を探索できます
  • クエリ実行:SELECT、INSERT、UPDATE、DELETE、DDL操作の完全なSQLサポート
  • 接続検証:起動時のデータベース接続自動検証
  • エラー処理:明確で実行可能なエラーメッセージを含む包括的なエラー処理
  • テーブル書式:AI利用のために読みやすいテーブルで書いたクエリ結果
  • Docker サポート:組み込みの .NET Docker ツールによる簡単な展開

利用可能なツール

道具 説明
execute_sql データベースに対して任意のSQLクエリを実行する

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

mssql-mcp

A .NET-powered Model Context Protocol (MCP) server for Microsoft SQL Server.

Abstract

Why does this exist? Because the other MCP solutions in market for this are generally janky pieces of shit that don’t work - certainly not on Windows.

This MCP server provides AI agents with robust, reliable access to Microsoft SQL Server databases through a clean, well-architected .NET application using Akka.NET for internal coordination and the official MCP C# SDK for protocol compliance.

Features

  • Schema Discovery: AI agents can explore database structure without writing complex SQL
  • Query Execution: Full SQL support for SELECT, INSERT, UPDATE, DELETE, and DDL operations
  • Connection Validation: Automatic database connectivity validation on startup
  • Error Handling: Comprehensive error handling with clear, actionable error messages
  • Table Formatting: Query results formatted in readable tables for AI consumption
  • Docker Support: Easy deployment with built-in .NET Docker tooling

Available Tools

Tool Description
execute_sql Execute any SQL query against the database
list_tables List all tables with schema, name, type, and row count
list_schemas List all available schemas/databases in the SQL Server instance

Configuration

Required Environment Variables

The MCP server requires a single environment variable:

  • MSSQL_CONNECTION_STRING: Complete SQL Server connection string

Example Connection Strings

Windows Authentication:

MSSQL_CONNECTION_STRING="Server=localhost;Database=MyDatabase;Trusted_Connection=true;"

SQL Server Authentication:

MSSQL_CONNECTION_STRING="Server=localhost;Database=MyDatabase;User Id=myuser;Password=mypassword;"

Azure SQL Database:

MSSQL_CONNECTION_STRING="Server=myserver.database.windows.net;Database=mydatabase;User Id=myuser;Password=mypassword;Encrypt=true;"

Running the MCP Server

The easiest way to run the MCP server is using Docker with .NET’s built-in container support.

Build and Run with Docker

Clone the repository

# Clone the repository
git clone https://github.com/Aaronontheweb/mssql-mcp.git
cd mssql-mcp

Build the Docker image

dotnet publish --os linux --arch x64 /t:PublishContainer

You can run the container directly if you wish, but it’s probably best to let the MCP server spin up the client:

# Run the container
docker run -it --rm \
  -e MSSQL_CONNECTION_STRING="Server=host.docker.internal;Database=MyDB;Trusted_Connection=true;" \
  mssql-mcp:latest

MCP Client Configuration

Cursor IDE

Add to your Cursor settings (Cursor Settings > Features > Model Context Protocol):

{
  "mcpServers": {
    "mssql": {
      "command": "docker",
      "args": [
          "run",
          "-i",
          "--rm",
          "-e",
          "MSSQL_CONNECTION_STRING",
GitHub で README 全文を見る

インストール

docker run -i --rm -e MSSQL_CONNECTION_STRING mssql-mcp:latest
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "mssql": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "MSSQL_CONNECTION_STRING", "mssql-mcp:latest" ], "env": { "MSSQL_CONNECTION_STRING": "Server=host.docker.internal,1533; Database=MyDb; User Id=myUser; Password=My(!)Password;TrustServerCertificate=true;" } } } }