Skip to main content
Glama
SQL Server MCP

SQL Server MCP

by cwilby

mcp-node-mssql

使用法

カーソル

詳細については、公式の Cursor ドキュメントを参照してください。

  1. mcp.jsonファイルを開きます (または作成します) (このファイルは~/.cursor/mcp.jsonまたは<project-root>/.cursor/mcp.jsonにありますが、詳細については Cursor のドキュメントを参照してください)。

  2. 次の詳細を追加してファイルを保存します。

{
  "mcpServers": {
    "mssql": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-node-mssql"
      ],
      "env": {
        "DB_HOST": "localhost",
        "DB_PORT": "1433",
        "DB_USERNAME": "<username>",
        "DB_PASSWORD": "<password>",
        "DB_DATABASE": "<database>"
      }
    }
  }
}

ウィンドサーフィン

詳細については、 Windsurf の公式ドキュメントを参照してください。

  1. Windsurf MCP Configuration Panelを開く

  2. Add custom serverクリックします。

  3. 次の詳細を追加してファイルを保存します。

{
  "mcpServers": {
    "mssql": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-node-mssql"
      ],
      "env": {
        "DB_HOST": "localhost",
        "DB_PORT": "1433",
        "DB_USERNAME": "<username>",
        "DB_PASSWORD": "<password>",
        "DB_DATABASE": "<database>"
      }
    }
  }
}

クロード・コード

詳細については、 Claude Code の公式ドキュメントを参照してください。

Claude Code CLIから新しいMCPサーバーを追加することもできますが、jsonファイルを直接変更する方が簡単です。

  1. Claude Code 構成ファイルを開きます ( ~/.claude.jsonにあります)。

  2. projects > mcpServersセクションを見つけて、次の詳細を追加し、ファイルを保存します。

{
  "projects": {
    "mcpServers": {
      "mssql": {
        "command": "npx",
        "args": [
          "-y",
          "mcp-node-mssql"
        ],
        "env": {
          "DB_HOST": "localhost",
          "DB_PORT": "1433",
          "DB_USERNAME": "<username>",
          "DB_PASSWORD": "<password>",
          "DB_DATABASE": "<database>"
        }
      }
    }
  }
}

Related MCP server: Microsoft SQL Server MCP Server

問題とトラブルシューティング

他のことを行う前に、最新バージョンを実行していることを確認してください。

この MCP サーバーの使用中に問題が発生した場合は、 GitHubで問題を報告してください。

発達

インストール

npm install

建てる

npm run build

開発サーバーをローカルで実行する

公開されたパッケージを使用するのではなく、MCP サーバーのローカル開発バージョンをテストするには、次の手順に従います。

  1. プロジェクトをビルドします。

npm run build
  1. ローカル ビルドを参照するようにmcp.jsonファイルを作成または変更します。

{
  "mcpServers": {
    "mssql": {
      "command": "node",
      "args": [
        "/path/to/your/local/mcp-node-mssql/dist/index.js"
      ],
      "env": {
        "DB_HOST": "localhost",
        "DB_PORT": "1433",
        "DB_USERNAME": "<username>",
        "DB_PASSWORD": "<password>",
        "DB_DATABASE": "<database>"
      }
    }
  }
}
  1. このmcp.jsonファイルを次のいずれかの場所に配置します。

    • カーソルの場合: ホームディレクトリ ( ~/.cursor/mcp.json ) またはプロジェクトディレクトリ ( .cursor/mcp.json )

    • Windsurfの場合:MCP構成パネルを使用してカスタムサーバーを追加します

  2. 新しい構成をロードするには、AI アシスタント (Cursor または Windsurf) を再起動します。

これにより、新しいバージョンを公開しなくても、MCP サーバーへの変更を即座にテストできます。

Available Tools

8 tools
commit-transactionC

Commit a transaction

Inputs: transactionId (required).

get-stored-procedureC

Get a specific stored procedure by name

Inputs: procedureName (required).

get-stored-proceduresB

Get a list of all stored procedures in the database

get-tableC

Get a specific table by name

Inputs: tableName (required).

get-tablesB

Get a list of all tables in the database

queryC

Query the database with a SQL statement

Inputs: query (required).

rollback-transactionC

Rollback a transaction

Inputs: transactionId (required).

start-transactionC

Start a new transaction

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 8 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose with no ambiguity. Tools are clearly separated by resource type (tables vs stored procedures) and action type (get specific vs get list vs transaction operations vs query). The query tool stands alone as a general-purpose operation.

    Naming Consistency5/5

    All tools follow a consistent verb-noun pattern with hyphens. Transaction tools use verb-transaction pattern (start-transaction, commit-transaction, rollback-transaction), get operations use get-noun pattern (get-table, get-tables), and query stands alone as a clear single verb. The naming is perfectly predictable throughout.

    Tool Count5/5

    8 tools is well-scoped for a database server. Each tool earns its place with clear responsibilities: 4 for data/metadata retrieval, 3 for transaction management, and 1 for general querying. This provides comprehensive coverage without bloat.

    Completeness4/5

    The toolset covers core database operations well with querying, transaction management, and metadata retrieval. Minor gaps exist in write operations beyond transactions (no explicit insert/update/delete tools) and schema modification (no create/alter/drop tools), but the query tool provides a workaround for most of these operations.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A Model Context Protocol server that enables secure and structured interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries with controlled access.
      62
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      A Model Context Protocol server that enables secure interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.
      1
      405
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      A Model Context Protocol server that allows Large Language Models like Claude to execute SQL queries, explore database schemas, and maintain persistent connections to SQL Server databases.
      -
    • F
      license
      A
      quality
      C
      maintenance
      A Model Context Protocol server that enables LLMs like Claude to interact with Microsoft SQL Server databases through natural language, supporting queries, data manipulation, and table management.
      8
      -