3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

生成AI活用 VSCODEでSQLServerのMCPサーバーを使う

Last updated at Posted at 2025-11-22

はじめに

業務でSQLServerを使っているので、MCPサーバーの導入の仕方を調べました。

構成図

環境

ソフトウェア名 バージョン 説明
Windows 10 OS
Claude for Windows 0.12.129 AIチャットアプリ。デスクトップアプリ
Node.js 22.19.0 FileSystem MCP Serverの実行環境
VSCODE 1.105.1 クライアント
Github Copilot Chat 0.32.3 Copilot Chatのエクステンション

設定方法

インストール

Cドライブ直下にmcpフォルダを作成し、githubからmcpサーバーのリポジトリをクローンします。

cd C:\mcp
git clone https://github.com/hendrickcastro/MCPQL.git
cd MCPQL
npm install
npm run build

mcp.jsonを作成

・コマンドパレットを開く( ctrl + shift + p)
・「mcpワークスペースフォルダーmcp構成を開く」を選択
・ファイルの作成を選択

image.png

mcp.jsonファイルを以下のように編集。

mcp.json
{
  "servers": {
    "mcpql": {
      "command": "node",
      "args": [
        "C:\\mcp\\MCPQL\\dist\\server.js"
      ],
      "env": {
        "DB_AUTHENTICATION_TYPE": "sql",
        "DB_SERVER": "localhost",
        "DB_NAME": "master",
        "DB_USER": "sa",
        "DB_PASSWORD": "user@12345",
        "DB_PORT": "1432",
        "DB_ENCRYPT": "false",
        "DB_TRUST_SERVER_CERTIFICATE": "true"
      }
    }
  }
}

MCPQLを有効にする

・チャット欄のツールの構成(ツールアイコン)を選択する
・「mcpサーバー:mcpql」のチェックボックスを選択する

image.png

使い方 例 テーブル一覧を取得

image.png

参考

最初に見た記事

githubのリンク

Claude MCPのページ

3
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?