Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/A-Point-Systems-ltd/ms-sql-mcp/llms.txt

Use this file to discover all available pages before exploring further.

Cursor supports MCP servers via mcp.json config files placed at project level (.cursor/mcp.json) or user level (~/.cursor/mcp.json). Both scopes use the same JSON structure — project-level configs take precedence for that workspace, while user-level configs apply across all projects. This page shows how to configure MSSQL MCP Server in either location.

Project-level config

1

Build or publish the server

Follow the steps in Build and Publish to produce a MssqlMcp.exe binary. Use the Debug build for local development or a self-contained published executable for a shared or production setup.
2

Create the config file

Create .cursor/mcp.json in your project root (for a project-scoped server), or open ~/.cursor/mcp.json (for a user-scoped server that applies to all Cursor workspaces). Create the file if it does not already exist.
3

Paste the server configuration

Add the following JSON, replacing the command path and connection string with values matching your environment:
{
  "mcpServers": {
    "MSSQL-MCP": {
      "type": "stdio",
      "command": "C:\\path\\to\\MssqlMcp.exe",
      "env": {
        "CONNECTION_STRING": "Server=.;Database=MyDb;Trusted_Connection=True;TrustServerCertificate=True",
        "USE_INSIGHTS_LAYER": "true",
        "INSIGHTS_AUTOPOPULATE": "true",
        "LOG_FILE_PATH": "C:\\Logs\\mssql-mcp.log"
      }
    }
  }
}
All four env keys are shown above for completeness. USE_INSIGHTS_LAYER and INSIGHTS_AUTOPOPULATE are enabled by default — you may omit them if you are happy with the defaults. LOG_FILE_PATH is optional but recommended while getting started.
4

Restart Cursor or reload the MCP server

After saving the file, restart Cursor or open the Cursor MCP panel and click Reload next to the MSSQL-MCP entry. The server status indicator should turn green once the process starts and the SQL connection test passes.
5

Test the connection

Open a Cursor chat and send:
List tables in the database
The agent should call the ListObjects tool with objectType=Table and return your table names.

Debug build vs. published executable

The path you set for command depends on how you built the server. Debug build — produced by dotnet build with no additional flags. The output lands at:
MssqlMcp\bin\Debug\net9.0\MssqlMcp.exe
Use the absolute path to this file if you want fast iteration (rebuild and reload without changing the config). Release / published executable — produced by publish-release.ps1. This creates a self-contained, single-file executable at the path configured in the publish profile:
C:\Development\MCPs\MS-SQL-Release\MssqlMcp.exe
The published executable bundles the .NET 9 runtime, so it runs on machines without a .NET SDK installed. Point command at this path for a more stable, portable deployment.
{
  "mcpServers": {
    "MSSQL-MCP": {
      "type": "stdio",
      "command": "C:\\Development\\MCPs\\MS-SQL\\MssqlMcp\\bin\\Debug\\net9.0\\MssqlMcp.exe",
      "env": {
        "CONNECTION_STRING": "Server=.;Database=MyDb;Trusted_Connection=True;TrustServerCertificate=True"
      }
    }
  }
}

Azure SQL with Entra ID

To connect to an Azure SQL Database using Microsoft Entra ID interactive authentication, replace the CONNECTION_STRING value with:
"CONNECTION_STRING": "Server=tcp:<server>.database.windows.net,1433;Initial Catalog=<database>;Encrypt=Mandatory;TrustServerCertificate=False;Connection Timeout=30;Authentication=Active Directory Interactive"
Replace <server> with your Azure SQL logical server name and <database> with the target database name. The first connection attempt will open an Entra ID browser login prompt.
Restart the MCP server after any environment variable change — the process reads environment variables once at startup, so changes to CONNECTION_STRING or any other env key do not take effect until the server process restarts. Use the Reload button in the Cursor MCP panel or restart Cursor entirely.
Never commit mcp.json files that contain real connection strings or credentials. Add .cursor/mcp.json to your .gitignore to prevent accidental exposure:
# .gitignore
.cursor/mcp.json

Build docs developers (and LLMs) love