Microsoft SQL Server MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Microsoft SQL Server MCPshow me the schema for the users table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@adriancy/mcp-mssql
MCP server (stdio) for Microsoft SQL Server. Exposes tools so Cursor (or any MCP client) can list tables, describe columns, and run read-biased T-SQL.
Use it in Cursor
Open Cursor Settings → MCP (or edit your MCP JSON).
Add a server block. Set
envto your database (see.env.example).
From npm (after the package is published):
{
"mcpServers": {
"mssql": {
"command": "npx",
"args": ["-y", "@adriancy/mcp-mssql"],
"env": {
"MSSQL_SERVER": "localhost",
"MSSQL_USER": "your_user",
"MSSQL_PASSWORD": "your_password",
"MSSQL_DATABASE": "your_database",
"MSSQL_TRUST_SERVER_CERTIFICATE": "true"
}
}
}
}From a local clone (run pnpm install && pnpm build first):
{
"mcpServers": {
"mssql": {
"command": "node",
"args": ["/absolute/path/to/mssql-mcp/dist/index.js"],
"env": {
"MSSQL_SERVER": "localhost",
"MSSQL_USER": "your_user",
"MSSQL_PASSWORD": "your_password",
"MSSQL_DATABASE": "your_database",
"MSSQL_TRUST_SERVER_CERTIFICATE": "true"
}
}
}
}Use node for local files. Avoid pnpm as the MCP command — extra output on stdout can break the protocol.
Confirm the install name matches npm: npm view @adriancy/mcp-mssql version.
Environment
All variables are read from the MCP process environment (e.g. Cursor env). Booleans treat 1, true, yes, on (case-insensitive) as true and 0, false, no, off as false. Invalid boolean and integer values fail startup validation.
Variable | Required | Default | Meaning |
| yes | — | Hostname or IP of SQL Server |
| yes† | — | Login user (SQL auth, NTLM, Azure AD password); not used for |
| yes*† | — | Login password (*may be empty for some setups) |
| yes | — | Initial database |
| no |
| TCP port; omit when using |
| no |
| TLS |
| no |
| Trust self-signed / skip cert validation (dev only) |
| no | — | Hostname for TLS validation when it differs from |
| no | — | Path to CA PEM; passed via |
| no | — | Optional client cert PEM (mutual TLS) |
| no | — | Optional client private key PEM |
| no | — | Passphrase for encrypted client key |
| no | (driver default) | Pool |
| no | — | Domain login ( |
| no | — | Named instance ( |
| no |
| Availability-group style failover hint |
| no |
| Read-only routing for AG secondaries |
| no | — | Tedious |
| no | — | Tedious |
| no |
| Pool max connections |
| no |
| Pool min connections |
| no |
|
|
| no | — |
|
| no |
|
|
| no | — |
|
| no | — |
|
| no‡ | — | Azure AD app (client) ID where required |
| no‡ | — | Tenant ID (optional for password auth, defaults |
| no‡ | — | Service principal secret |
| no‡ | — | Pre-obtained token for access-token auth |
| no |
| If false/unset, blocks common write/DDL/exec patterns in |
| no | (driver default) | Request timeout in ms for the driver. |
† Required for SQL authentication and for auth types that use interactive user login.
‡ Required depending on MSSQL_AUTH_TYPE; see .env.example. NTLM on Node 17+ may need --openssl-legacy-provider (see tedious FAQ).
See also .env.example.
Tools
Tool | Purpose |
| Run T-SQL; returns rows and |
| Tables in |
| Column metadata |
When MSSQL_ALLOW_WRITES is unset/false, obvious write/DDL patterns are blocked (heuristic only; use DB permissions for real safety).
Develop
pnpm install
pnpm check
pnpm test
pnpm build && pnpm start
pnpm devUse pnpm format to apply Biome formatting fixes and pnpm lint to run lint rules without formatting.
Use a read-only or least-privilege SQL login for day-to-day use.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AdrianCY/mssql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server