# wenerme/wener-mssql-mcp [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/wenerme/wode/tree/develop/packages/wener-mssql-mcp  
**GitHub Stars:** 66  
**npm Downloads (last month):** 240  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/wenerme-wener-mssql-mcp

## Description
MSSQL database integration with schema inspection and query capabilities

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "wener-mssql-mcp": {
    "command": "npx",
    "args": ["@wener/mssql-mcp"],
    "env": {
      "MSSQL_SERVER": "",
      "MSSQL_DATABASE": "",
      "MSSQL_USER": "",
      "MSSQL_PASSWORD": "",
      "MSSQL_WINDOWS_AUTH": "",
      "MSSQL_PORT": "",
      "MSSQL_ENCRYPT": "",
      "MSSQL_ACCESS_MODE": ""
    }
  }
}
```

**Requires environment variables:** `MSSQL_SERVER`, `MSSQL_DATABASE`, `MSSQL_USER`, `MSSQL_PASSWORD`, `MSSQL_WINDOWS_AUTH`, `MSSQL_PORT`, `MSSQL_ENCRYPT`, `MSSQL_ACCESS_MODE` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What wenerme/wener-mssql-mcp does

wenerme/wener-mssql-mcp exposes Microsoft SQL Server databases through the Model Context Protocol. It is intended for MCP clients such as Claude Desktop, where an AI assistant can inspect database structure, formulate SQL, run queries, and explain returned data.

The server supports SQL Server authentication, Windows authentication, Azure SQL Database, and LocalDB. It is described as compatible with SQL Server 2008 and newer, and can connect to a configured database on the default port or a custom port.

## How it works

The package runs as a Node.js command-line application. The recommended invocation uses `npx`, although it can also be installed globally as `@wener/mssql-mcp`. In stdio mode, an MCP client starts the process and communicates with it directly. An HTTP mode is available for development, with configurable host and port settings.

Connection settings come from environment variables or an environment file supplied with `--env-file`. Once connected, the client can discover available tables, inspect table structures and metadata, read table contents, and call database tools. Table browsing returns the first 100 rows for each table.

## Setup and configuration

Node.js 24.11.0 or newer is required. A SQL Server connection needs a server and database name. SQL Server authentication uses a username and password; Windows authentication can be enabled with `MSSQL_WINDOWS_AUTH=true`. Azure SQL connections use the server hostname supplied by Azure, and encryption is automatically enabled for Azure SQL or can be explicitly enabled with `MSSQL_ENCRYPT=true`.

Example stdio startup:

```bash
MSSQL_SERVER=localhost \\
MSSQL_DATABASE=mydb \\
MSSQL_USER=sa \\
MSSQL_PASSWORD=password \\
npx @wener/mssql-mcp --stdio
```

Useful command-line options include `--stdio`, `--env-file <path>`, `--port <port>`, `--host <host>`, and `--verbose`. The default SQL Server port is 1433; the development HTTP server defaults to port 3003 and host `localhost`.

## Tools and capabilities

- `exec_sql_csv` executes SQL and returns CSV-formatted results.
- `exec_sql_json` executes SQL and returns JSON-formatted results.
- `get_version` returns SQL Server version information.
- Table discovery lists available database tables.
- Table resources provide table contents and schema metadata.
- Read-only mode limits statements to `SELECT`, `WITH`, `SHOW`, `DESCRIBE`, `EXPLAIN`, and `DESC`.
- Query handling includes parameterized queries, table-name validation, and escaping. Connection pooling and query logging are also included.

Use `MSSQL_ACCESS_MODE=readonly` for production or exploratory connections where database changes should be blocked. The default access mode is `readwrite`.

## Limitations and notes

Read-only mode is an access safeguard for supported statement types; permissions still depend on the SQL Server account. Connection failures can result from invalid credentials, an incorrect server or port, missing database permissions, or local encryption settings. Verbose logging can help diagnose startup and connection problems. Local development connections may require `MSSQL_ENCRYPT=false`, while Azure SQL commonly requires encryption.

_Full upstream README: https://allmcps.com/mcp/wenerme-wener-mssql-mcp/readme_

