Skip to content
plugmcp
DirectorySkillsCategoriesBlog
EN/δΈ­ζ–‡
Sign inSign up
Home/Servers/SQL Server MCP (Windows)

SQL Server MCP (Windows)

I
by io.github.TharanaBope

SQL Server MCP with RAG capabilities for Windows (native ODBC support)

Power your agent

Add this server

The publisher's own command. Not a PlugMCP endpoint.

Local command
npx -y @tharanabopearachchi/[email protected]
Provider
Claude Code
claude mcp add io.github.tharanabope-sql-server-mcp -- npx -y @tharanabopearachchi/[email protected]

Run in a terminal.

Claude Desktop
{
  "mcpServers": {
    "io.github.tharanabope-sql-server-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@tharanabopearachchi/[email protected]"
      ]
    }
  }
}

claude_desktop_config.json

Step-by-step: add this in Claude

Remote URL or a command on your machine? How the two installs differ

Run on PlugMCP

Host a copy with our keys and logs.

A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.

Launch

Related MCP

View more
  • FirecrawlπŸ”₯ Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
  • N
    NotionToken-auth Notion MCP: pages, databases, blocks, comments, files. Runs headless in CI and agents.
  • Context7Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

Related skills

View all
  • reaReverse engineer anything with agents, from app behavior down to native binaries.
  • rea-changelog-updatePrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization.
  • rea-tool-designDesign or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.

Questions

How do I install SQL Server MCP (Windows)?
Copy the stdio config for Cursor, Claude Desktop, Claude Code, or VS Code on this page. It uses the publisher's install, not a PlugMCP proxy.
Does SQL Server MCP (Windows) need an API key?
No required environment variable is listed on this record.
What transport does SQL Server MCP (Windows) use?
SQL Server MCP (Windows) runs locally over stdio.
When was SQL Server MCP (Windows) last checked?
Last checked 2026-10-16. SQL Server MCP with RAG capabilities for Windows (native ODBC support)

SQL Server MCP with RAG capabilities for Windows (native ODBC support)

SQL Server MCP - Cross-Platform Database Integration for AI

A Model Context Protocol (MCP) server implementation for SQL Server that enables AI assistants to explore and query SQL Server databases through natural language. Built as a RAG (Retrieval-Augmented Generation) system optimized for database knowledge exploration.

🌟 Features

  • πŸ” Schema Exploration - List databases, tables, views, stored procedures
  • πŸ”— Relationship Mapping - Discover foreign key relationships and table dependencies
  • πŸ”Ž Search & Discovery - Global schema search across tables, columns, procedures
  • ⚑ Safe Query Execution - Read-only SELECT queries with automatic timeouts and row limits
  • πŸ—„οΈ Schema Caching - Fast retrieval with configurable TTL (default: 60 minutes)
  • πŸ” Security First - Read-only by default, SQL injection prevention, query validation
  • πŸ–₯️ Cross-Platform - Native Windows Authentication & macOS Docker support

πŸŽ₯ Demo

See SQL Server MCP in action with AI assistant integration:

SQL Server MCP Demo

Note: Watch how natural language queries instantly explore database schemas, find relationships, and retrieve data - all without leaving your AI assistant!

πŸš€ Quick Start

This repository contains two platform-specific implementations:

Windows Version β†’ sql-server-mcp/

  • βœ… Windows Authentication (ODBC Driver 17)
  • βœ… SQL Server Authentication
  • βœ… Native msnodesqlv8 driver for optimal performance
  • πŸ“– Windows Setup Guide

macOS Version β†’ sql-server-mcp-mac/

  • βœ… SQL Server Authentication (Docker required)
  • βœ… Pure JavaScript mssql driver (no native dependencies)
  • πŸ“– macOS Setup Guide

πŸ“¦ Installation

πŸŽ‰ Now Available on MCP Registry!

This server is officially published in the Model Context Protocol Registry:

  • Windows: io.github.TharanaBope/sql-server-mcp
  • macOS: io.github.TharanaBope/sql-server-mcp-macos

πŸš€ Quick Start (Recommended)

No installation needed! Just add to your AI assistant's configuration:

Claude Desktop (Windows)

Config Location: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "sql-server": {
      "command": "npx",
      "args": ["-y", "@tharanabopearachchi/sql-server-mcp@latest"],
      "env": {
        "SQL_SERVER": "localhost",
        "SQL_DATABASE": "master",
        "SQL_USE_WINDOWS_AUTH": "true"
      }
    }
  }
}
Claude Desktop (macOS)

Config Location: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "sql-server": {
      "command": "npx",
      "args": ["-y", "@tharanabopearachchi/sql-server-mcp-macos@latest"],
      "env": {
        "SQL_SERVER": "localhost",
        "SQL_DATABASE": "master",
        "SQL_USE_WINDOWS_AUTH": "false",
        "SQL_USERNAME": "sa",
        "SQL_PASSWORD": "your_password"
      }
    }
  }
}

Config Location: Varies by platform

  • Windows: %USERPROFILE%\.lmstudio\config.json
  • macOS: ~/.lmstudio/config.json
{
  "mcpServers": {
    "sql-server": {
      "command": "npx",
      "args": ["-y", "@tharanabopearachchi/sql-server-mcp@latest"],
      "env": {
        "SQL_SERVER": "localhost",
        "SQL_DATABASE": "master",
        "SQL_USE_WINDOWS_AUTH": "true",
        "SQL_USERNAME": "",
        "SQL_PASSWORD": ""
      }
    }
  }
}

Config Location: ~/.continue/config.json

{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "@tharanabopearachchi/sql-server-mcp@latest"]
        },
        "env": {
          "SQL_SERVER": "localhost",
          "SQL_DATABASE": "master",
          "SQL_USE_WINDOWS_AUTH": "true"
        }
      }
    ]
  }
}

Config Location: Cursor Settings β†’ Features β†’ Model Context Protocol

{
  "mcpServers": {
    "sql-server": {
      "command": "npx",
      "args": ["-y", "@tharanabopearachchi/sql-server-mcp@latest"],
      "env": {
        "SQL_SERVER": "localhost",
        "SQL_DATABASE": "master",
        "SQL_USE_WINDOWS_AUTH": "true"
      }
    }
  }
}

Config Location: VS Code Settings β†’ Cline β†’ MCP Settings

{
  "mcpServers": {
    "sql-server": {
      "command": "npx",
      "args": ["-y", "@tharanabopearachchi/sql-server-mcp@latest"],
      "env": {
        "SQL_SERVER": "localhost",
        "SQL_DATABASE": "master",
        "SQL_USE_WINDOWS_AUTH": "true"
      }
    }
  }
}

Restart your AI assistant and you're ready to go!

πŸ› οΈ Development Setup

For development or local modifications:

Windows
cd sql-server-mcp
npm install
npm run build

πŸ‘‰ Complete Windows Setup Instructions

macOS
cd sql-server-mcp-mac
npm install
npm run build

πŸ‘‰ Complete macOS Setup Instructions

πŸ› οΈ Available MCP Tools

The server provides 12 powerful tools for database exploration:

Schema Exploration

  • list_databases - Discover all available databases
  • list_tables - View tables with row counts
  • describe_table - Get detailed schema (columns, types, constraints, indexes)
  • list_views - List all views
  • list_stored_procedures - List stored procedures with metadata
  • get_procedure_definition - Get full SQL definition
  • get_database_overview - High-level statistics

Relationship Mapping

  • get_table_relationships - Get foreign key relationships (incoming & outgoing)
  • get_related_tables - Find directly connected tables

Search & Discovery

  • search_schema - Search across tables, columns, views, procedures
  • find_column_usage - Find all tables containing a specific column

Query Execution

  • execute_query - Execute read-only SELECT queries safely

πŸ’¬ Example Usage

Once configured, you can ask your AI assistant:

"What databases are available on this server?"

"Show me all tables in the Sales database"

"What's the schema of the Orders table?"

"Find all tables that reference the Customers table"

"Search for any columns related to 'email'"

"Execute: SELECT TOP 10 * FROM Products ORDER BY Price DESC"

βš™οΈ Configuration

Both versions use environment variables for configuration:

SQL_SERVER=localhost
SQL_DATABASE=master
SQL_PORT=1433
SQL_USE_WINDOWS_AUTH=true          # Windows only
SQL_USERNAME=                       # For SQL Auth
SQL_PASSWORD=                       # For SQL Auth
QUERY_TIMEOUT=30
MAX_RESULT_ROWS=1000
ENABLE_SCHEMA_CACHE=true
CACHE_TTL_MINUTES=60

See platform-specific READMEs for detailed configuration instructions.

πŸ” Security Features

  • βœ… Read-only by default - Write operations disabled unless explicitly enabled
  • βœ… Query validation - Only SELECT statements allowed by default
  • βœ… Automatic timeouts - Prevents long-running queries
  • βœ… Row limits - Prevents memory exhaustion
  • βœ… SQL injection prevention - Query sanitization and validation
  • βœ… Database whitelisting - Optional restriction to specific databases

πŸ—οΈ Architecture

MCP/
β”œβ”€β”€ sql-server-mcp/              # Windows implementation
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ index.ts             # MCP server entry point
β”‚   β”‚   β”œβ”€β”€ database/            # Connection, caching, queries
β”‚   β”‚   β”œβ”€β”€ tools/               # 12 MCP tools
β”‚   β”‚   └── types/               # TypeScript interfaces
β”‚   β”œβ”€β”€ dist/                    # Compiled output
β”‚   β”œβ”€β”€ package.json
β”‚   └── README.md                # Windows documentation
β”‚
β”œβ”€β”€ sql-server-mcp-mac/          # macOS implementation
β”‚   β”œβ”€β”€ src/                     # Same structure as Windows
β”‚   └── README.md                # macOS documentation
β”‚
β”œβ”€β”€ LICENSE                      # MIT License
└── README.md                    # This file

🎯 Use Cases

Database Exploration

  • "What tables exist in this database?"
  • "Show me the structure of the Users table"
  • "List all stored procedures"

Schema Research

  • "Find all tables with an 'email' column"
  • "Search for anything related to 'invoice'"
  • "What views are available?"

Relationship Analysis

  • "How are Orders and Customers related?"
  • "Show me all tables that reference Products"
  • "What are the foreign key relationships for this table?"

Data Queries

  • "Get the top 10 most expensive products"
  • "Show me recent orders"
  • "What's the total count of records in each table?"

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built on Model Context Protocol SDK
  • Uses mssql and msnodesqlv8 drivers
  • Inspired by the need for better AI-database integration

πŸ“š Resources

  • Windows Setup Guide: sql-server-mcp/README.md
  • macOS Setup Guide: sql-server-mcp-mac/README.md
  • Troubleshooting: Check platform-specific TROUBLESHOOTING.md files
  • MCP Documentation: https://github.com/modelcontextprotocol
  • Report Issues: https://github.com/TharanaBope/SQL-MCP-Mac-Windows/issues

🌐 Platform-Specific Documentation

PlatformDirectoryKey Features
Windowssql-server-mcp/Windows Auth, ODBC Driver, Native performance
macOSsql-server-mcp-mac/Docker SQL Server, Pure JS, No native deps

Made with ❀️ for the MCP community

⭐ Star this repo if you find it useful! πŸ› Report bugs via Issues πŸ’¬ Questions? Check the Discussions

How do I install SQL Server MCP (Windows)?
Copy the stdio config for Cursor, Claude Desktop, Claude Code, or VS Code on this page. It uses the publisher's install, not a PlugMCP proxy.
Does SQL Server MCP (Windows) need an API key?
No required environment variable is listed on this record.
What transport does SQL Server MCP (Windows) use?
SQL Server MCP (Windows) runs locally over stdio.
When was SQL Server MCP (Windows) last checked?
Last checked 2026-10-16. SQL Server MCP with RAG capabilities for Windows (native ODBC support)

No tool list yet. Remote servers get one after the first health check.

plugmcp

Plug any tool into any agent. MCP servers for people who do not write servers. Gateway for volume, n8n for apps.

  • github.com/TODO
  • x.com/TODO
  • linkedin.com/company/TODO

PlugMCP, 2026

Product
  • Browse
  • Install
  • Host your own
  • Pricing
  • Voice mode
  • Browser
Directory
  • All MCP servers
  • MCP Apps
  • Tools
  • Agent skills
  • Categories
  • New
  • Voice
  • Submit a server
Developers
  • Docs
  • Blog
  • Club
  • Work with us
  • What is MCP
  • What is WebMCP
  • Status
Company
  • About
  • Contact
  • Terms
  • Privacy
  • DPA