MSSQL

Provides an MCP server to execute SQL queries against Microsoft SQL Server databases.
  • typescript

0

GitHub Stars

typescript

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "mcp-mirror-c0h1b4_mssql-mcp-server": {
      "command": "mssql-mcp-server",
      "args": [],
      "env": {
        "MSSQL_HOST": "localhost",
        "MSSQL_PORT": "1433",
        "MSSQL_USER": "sa",
        "MSSQL_ENCRYPT": "false",
        "MSSQL_DATABASE": "master",
        "MSSQL_PASSWORD": "yourpassword",
        "MSSQL_CONNECTION_STRING": "Server=localhost;Database=master;User Id=sa;Password=yourpassword;",
        "MSSQL_TRUST_SERVER_CERTIFICATE": "true"
      }
    }
  }
}

This MCP server lets you connect to Microsoft SQL Server databases to run SQL queries and manage connections from your MCP client setup. It enables you to execute ad-hoc queries, retrieve results, and centralize database access through a standardized tool interface.

How to use

You use this MSSQL MCP Server by adding it to your MCP configuration as a server that can run the query tool. Start the server process using the command you specify in your setup, then call the query tool through your MCP client to execute SQL statements against your SQL Server instance. You can either provide a full connection string or supply the individual connection parameters (host, port, database, user, password) for each request. The server will return the query results so you can process them in your workflow.

How to install

Prerequisites you need before installing: you should have Node.js and npm installed on your machine.

Install the MSSQL MCP Server package from npm.

Run the server using the configured command in your MCP setup.

Here are the concrete commands to follow:
- Install Node.js and npm on your system
- Install the MSSQL MCP Server package
- Start the MCP server with the configured command in your environment.

Additional notes

Configuration you use for the server includes environment variables that define how to connect to SQL Server. You can either supply a full connection string or use individual parameters such as host, port, database, user, and password. Make sure to keep sensitive information secure and follow your organization’s security practices for handling credentials.

Configuration details and examples

{
  "mcpServers": {
    "mssql": {
      "command": "mssql-mcp-server",
      "env": {
        "MSSQL_CONNECTION_STRING": "Server=localhost;Database=master;User Id=sa;Password=yourpassword;",
        // Or individual connection parameters:
        "MSSQL_HOST": "localhost",
        "MSSQL_PORT": "1433",
        "MSSQL_DATABASE": "master",
        "MSSQL_USER": "sa",
        "MSSQL_PASSWORD": "yourpassword",
        "MSSQL_ENCRYPT": "false",
        "MSSQL_TRUST_SERVER_CERTIFICATE": "true"
      }
    }
  }
}

Security considerations

Protect your connection credentials and limit access to the MCP server. Use encrypted connections if supported by your SQL Server instance and set trusted server certificates as appropriate for your environment.

Examples and usage tips

When constructing a request to run a query, you can either supply a full connection string or provide the host, port, database, username, and password along with the SQL to execute. Ensure the SQL you run is properly sanitized to minimize the risk of injection in your application workflow.

Troubleshooting

If the server fails to start, verify that Node.js and npm are installed, and confirm that the executable command is reachable from your environment. Check that the necessary environment variables are set correctly and that the SQL Server instance is reachable from the host running the MCP server.

Available tools

query

Execute a SQL query on a MSSQL database. You can provide a full connection string or a set of connection parameters (host, port, database, username, password) along with the SQL to run. The tool returns the query results.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational