Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables AI assistants to interact with MSSQL databases through natural language, supporting CRUD operations and schema management.

README.md

MSSQL Database MCP Server

<div align="center"> <img src="./src/img/logo.png" alt="MSSQL Database MCP server logo" width="400"/> </div>

What is this? 🤔

This is a server that lets your LLMs (like Claude) talk directly to your MSSQL Database data! Think of it as a friendly translator that sits between your AI assistant and your database, making sure they can chat securely and efficiently.

Quick Example

You: "Show me all customers from New York"
Claude: *queries your MSSQL Database database and gives you the answer in plain English*

How Does It Work? 🛠️

This server leverages the Model Context Protocol (MCP), a versatile framework that acts as a universal translator between AI models and databases. It supports multiple AI assistants including Claude Desktop and VS Code Agent.

What Can It Do? 📊

  • Run MSSQL Database queries by just asking questions in plain English
  • Create, read, update, and delete data
  • Manage database schema (tables, indexes)
  • Secure connection handling
  • Real-time data interaction

Quick Start 🚀

Prerequisites

  • Node.js 14 or higher
  • Claude Desktop or VS Code with Agent extension

Set up project

  1. Install Dependencies

Run the following command in the root folder to install all necessary dependencies: ``bash npm install ``

  1. Build the Project

Compile the project by running: ``bash npm run build ``

Configuration Setup

Option 1: VS Code Agent Setup

  1. Install VS Code Agent Extension
  • Open VS Code
  • Go to Extensions (Ctrl+Shift+X)
  • Search for "Agent" and install the official Agent extension
  1. Create MCP Configuration File
  • Create a .vscode/mcp.json file in your workspace
  • Add the following configuration:
   {
     "servers": {
       "mssql-nodejs": {
          "type": "stdio",
          "command": "node",
          "args": ["q:\\Repos\\SQL-AI-samples\\MssqlMcp\\Node\\dist\\index.js"],
          "env": {
            "SERVER_NAME": "your-server-name.database.windows.net",
            "DATABASE_NAME": "your-database-name",
            "READONLY": "false"
          }
        }
      }
   }
  1. Alternative: User Settings Configuration
  • Open VS Code Settings (Ctrl+,)
  • Search for "mcp"
  • Click "Edit in settings.json"
  • Add the following configuration:
   {
    "mcp": {
        "servers": {
            "mssql": {
                "command": "node",
                "args": ["C:/path/to/your/Node/dist/index.js"],
                "env": {
                "SERVER_NAME": "your-server-name.database.windows.net",
                "DATABASE_NAME": "your-database-name",
                "READONLY": "false"
                }
            }
        }
    }
  }
  1. Restart VS Code
  • Close and reopen VS Code for the changes to take effect
  1. Verify MCP Server
  • Open Command Palette (Ctrl+Shift+P)
  • Run "MCP: List Servers" to verify your server is configured
  • You should see "mssql" in the list of available servers

Option 2: Claude Desktop Setup

  1. Open Claude Desktop Settings
  • Navigate to File → Settings → Developer → Edit Config
  • Open the claude_desktop_config file
  1. Add MCP Server Configuration

Replace the content with the configuration below, updating the path and credentials:

   {
     "mcpServers": {
       "mssql": {
         "command": "node",
         "args": ["C:/path/to/your/Node/dist/index.js"],
         "env": {
           "SERVER_NAME": "your-server-name.database.windows.net",
           "DATABASE_NAME": "your-database-name",
           "READONLY": "false"
         }
       }
     }
   }
  1. Restart Claude Desktop
  • Close and reopen Claude Desktop for the changes to take effect

Configuration Parameters

  • SERVER_NAME: Your MSSQL Database server name (e.g., my-server.database.windows.net)
  • DATABASE_NAME: Your database name
  • READONLY: Set to "true" to restrict to read-only operations, "false" for full access
  • Path: Update the path in args to point to your actual project location.
  • CONNECTION_TIMEOUT: (Optional) Connection timeout in seconds. Defaults to 30 if not set.
  • TRUST_SERVER_CERTIFICATE: (Optional) Set to "true" to trust self-signed server certificates (useful for development or when connecting to servers with self-signed certs). Defaults to "false".

Sample Configurations

You can find sample configuration files in the src/samples/ folder:

  • claude_desktop_config.json - For Claude Desktop
  • vscode_agent_config.json - For VS Code Agent

Usage Examples

Once configured, you can interact with your database using natural language:

  • "Show me all users from New York"
  • "Create a new table called products with columns for id, name, and price"
  • "Update all pending orders to completed status"
  • "List all tables in the database"

Security Notes

  • The server requires a WHERE clause for read operations to prevent accidental full table scans
  • Update operations require explicit WHERE clauses for security
  • Set READONLY: "true" in production environments if you only need read access

You should now have successfully configured the MCP server for MSSQL Database with your preferred AI assistant. This setup allows you to seamlessly interact with MSSQL Database through natural language queries!

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Databases servers.