logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

mcp-sqlserver-connector

This utility bridges Language Model applications with Microsoft SQL Server data stores using the Model Context Protocol (MCP). It provides secure, efficient mechanisms for LLMs to retrieve and modify structured information residing within these systems. A database management system (DBMS) facilitates this interaction, managing the organized collection of data, similar to how index cards once managed organizational records before digital systems became prevalent.

Author

mcp-sqlserver-connector logo

cwilby

MIT License

Quick Info

GitHub GitHub Stars 2
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

mssqldatabasesdatabasedatabases securesecure databasedatabase access

Introduction

This software implements the Model Context Protocol (MCP) specifically for integrating with Microsoft SQL Server environments. A database system, which comprises the data store, the DBMS software, and related applications, requires structured access. This tool ensures that artificial intelligence agents can safely interact with relational data modeled as rows and columns in tables, frequently utilizing SQL for querying.

Usage

Configuration involves specifying this tool within the corresponding AI assistant's context setup files. The specific configuration paths and file names differ based on the integrated platform.

Cursor

Refer to the official Cursor documentation for comprehensive details regarding context protocol integration.

  1. Locate or generate the mcp.json file; common locations include ~/.cursor/mcp.json or within the specific project root as .cursor/mcp.json.
  2. Incorporate the subsequent configuration details into this file and save the changes for persistence:
{
  "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

Consult the official Windsurf documentation for precise instructions on setting up MCP.

  1. Navigate to the Windsurf MCP Configuration Panel interface.
  2. Select the option to Add custom server.
  3. Input the configuration structure shown below and finalize by saving:
{
  "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

While the Claude Code CLI supports adding new MCP servers, direct configuration file editing is generally more straightforward.

  1. Access and open the Claude Code configuration file, typically located at ~/.claude.json.
  2. Navigate to the projects section, then locate mcpServers, and append the following data structure, ensuring you save the file afterwards:
{
  "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>"
        }
      }
    }
  }
}

Issues and Troubleshooting

Verify that you are utilizing the most recent version of this tool before proceeding with any troubleshooting steps. Should difficulties arise during the use of this SQL Server MCP server, please report them by submitting a new issue on the associated GitHub repository.

Development

Steps below detail how to set up the project environment for local modifications and testing.

Installation

Execute the following command within the project directory using Node Package Manager:

npm install

Build

Compile the source code into the runnable distribution format:

npm run build

Running the Development Server Locally

To validate the development build of the MCP server instead of the published package, follow this procedure.

  1. Compile the current project sources using the build script:
npm run build
  1. Adjust your configuration file (mcp.json) to point toward your local executable path instead of the package registry:
{
  "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. Position this customized mcp.json file in the designated location for your specific assistant application:
  2. For Cursor: Place it either in your home directory (~/.cursor/mcp.json) or project folder (.cursor/mcp.json).
  3. For Windsurf: Configure this path via the MCP Configuration Panel interface.

  4. Relaunch your AI platform, either Cursor or Windsurf, to load the newly referenced local server configuration.

This testing methodology permits immediate validation of server modifications without requiring deployment to the public package registry.

  • Relational database models employing tables, rows, and columns.
  • The role of Structured Query Language (SQL) in data manipulation.
  • Concepts related to data representation and efficient storage techniques.
  • The necessity of security and privacy for sensitive data elements.
  • Non-relational (NoSQL) databases and their differing query paradigms.

Extra Details

Design considerations for database systems often involve complex topics like concurrent access handling and ensuring fault tolerance across distributed computing environments. While relational systems using SQL were dominant, newer paradigms like NoSQL emerged in the 2000s due to flexibility needs. Early methods for data organization relied heavily on physical tools like index cards for bibliographical citations and contact records.

Conclusion

This connector facilitates the essential function of linking large-scale data repositories, such as those managed by SQL Server, with advanced analytical models. Proper configuration ensures that the intelligence layer can reliably interact with structured data, enhancing its ability to process and reason over information managed by a robust database system.

See Also

`