MCP Sqlserver MCP Server

# MCP SQL Server [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

Local serverstdioTypeScript

What is the MCP Sqlserver MCP Server?

MCP SQL Server License

What you get

  • 🔒 Read-only operations — Only SELECT queries allowed, with comprehensive security validation
  • 🗄️ Schema discovery — Explore databases, tables, views, relationships, and metadata
  • 📊 Data exploration — Execute safe queries with built-in limits and timeouts
  • 🔐 Enterprise-ready — Encrypted connections with certificate trust for production environments
  • 🛡️ Security-first — Query validation, SQL injection protection, and access controls

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

How to install the MCP Sqlserver MCP Server

{
  "mcpServers": {
    "sqlserver": {
      "command": "mcp-sqlserver",
      "env": {
        "SQLSERVER_HOST": "your-server.database.windows.net",
        "SQLSERVER_USER": "your-username",
        "SQLSERVER_PASSWORD": "your-password",
        "SQLSERVER_DATABASE": "your-database",
        "SQLSERVER_ENCRYPT": "true",
        "SQLSERVER_TRUST_CERT": "false"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
SQLSERVER_HOSTEndpoint or connection string the server talks to.Optional
SQLSERVER_USERConfiguration value read at startup.Optional
SQLSERVER_PASSWORDConfiguration value read at startup.Optional
SQLSERVER_DATABASEConfiguration value read at startup.Optional
SQLSERVER_ENCRYPTConfiguration value read at startup.Optional
SQLSERVER_TRUST_CERTConfiguration value read at startup.Optional

Example prompts to try

  • “Use MCP Sqlserver to Required.”
  • “Use MCP Sqlserver to Optional.”

Frequently asked questions

Node.js 20+, TypeScript 5.0+, and Microsoft SQL Server 2016+ are required.