Microsoft SQL Server MCP Server

An MCP server for Microsoft SQL Server and Azure SQL: the agent lists tables and runs SQL queries that read and write data

  • 401 ★ on the repository
  • Last commit
  • MIT
MCP server

Broad access

Why this level

  • The server runs INSERT, UPDATE and DELETE as the database user, and there is no read-only mode
  • The database password sits in the client configuration, and query results, including personal data, enter the agent context
All reasons and checks

richardhan/mssql_mcp_server

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add mcp/microsoft-sql-server-mcp-server

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • The server runs INSERT, UPDATE and DELETE as the database user, and there is no read-only mode
  • The database password sits in the client configuration, and query results, including personal data, enter the agent context

This is third-party code. Review the repository files before installing.

What it does

The server gives an agent access to a Microsoft SQL Server database. The agent gets a table list, reads data and runs SELECT, INSERT, UPDATE and DELETE statements. Queries run as the database user you specified during setup. There are three ways to connect: SQL Server login and password, Windows authentication, or Azure AD. The server works with a local SQL Server, LocalDB and the cloud Azure SQL Database. Encryption turns on automatically for Azure and can be forced for other databases with MSSQL_ENCRYPT. The package is called `microsoft_sql_server_mcp` and installs from PyPI. The usual launch goes through `uvx`, and the whole configuration consists of environment variables with the server address, database name and credentials.

Who it is for. For developers and analysts whose data lives in SQL Server or Azure SQL and who want to ask the database questions from Claude Desktop or another MCP client.

Good fit when

  • The agent must look at the database structure and find the right table before writing a query
  • You need to test a data hypothesis on a test database quickly: a selection, an aggregate, a check of two tables
  • Development runs on a local SQL Server or LocalDB and the agent needs live data to debug with
  • You need to sign in with a domain account: Windows authentication is supported
  • The database lives in Azure SQL and the connection must use encryption

Not a fit when

  • The agent must not change anything in the database: limits come only from SQL Server permissions
  • The database is live and holds personal data: query results enter the agent context
  • You need another DBMS: the catalog has separate servers for PostgreSQL, MySQL and SQLite
  • You need migrations and query plan or index analysis: the server lists tables and runs SQL

Example request

List the tables in the sales database and pick the ten customers with the largest order total last month

MCP

Transport
stdio
Authentication
key is optional

Environment variables

MSSQL_SERVER required
SQL Server address, for example localhost or name.database.windows.net
MSSQL_DATABASE required
Database name
MSSQL_USER
SQL user, required for login and password sign-in
MSSQL_PASSWORD secret
SQL user password, required for login and password sign-in
MSSQL_WINDOWS_AUTH
The value true turns on sign-in with Windows credentials

Limitations

Python 3.11 or newer is required. On macOS and Linux building the `pymssql` dependency needs the FreeTDS system library: freetds on macOS and freetds-dev on Linux.

The project describes no built-in guard against dangerous queries. The author advises creating a dedicated SQL user with minimal permissions, avoiding the sa and admin accounts, using Windows authentication where possible and enabling encryption.

How to disable. Remove the mssql entry from mcpServers in claude_desktop_config.json and restart the client. Then disable or delete the SQL user you created for the server, which closes database access even if the configuration remains somewhere.

FAQ

How do I connect SQL Server to Claude Desktop through MCP?

Add an mssql server to claude_desktop_config.json with command uvx and args microsoft_sql_server_mcp. Pass MSSQL_SERVER, MSSQL_DATABASE, MSSQL_USER and MSSQL_PASSWORD in env. After Claude Desktop restarts, the agent sees the tools for tables and queries.

How do I sign in with a Windows account without a password?

Set MSSQL_SERVER, MSSQL_DATABASE and MSSQL_WINDOWS_AUTH=true. No login or password is needed in this mode, and the server uses the Windows credentials. The author advises using this method when it is available.

Does the server work with Azure SQL Database?

Yes. Give an address like your-server.database.windows.net, the database name, a user and a password. No other variables are needed.

Can I forbid the agent from changing data?

The server has no read-only mode. The way out is a SQL user that has read rights on the needed tables only, set in MSSQL_USER. INSERT, UPDATE and DELETE then fail on the SQL Server side.

How do I set a non-default SQL Server port?

With the MSSQL_PORT variable. The server uses port 1433 by default.

Discussion

No questions or reviews yet.

Postgres MCP (Microsoft)

Postgres MCP Server (Microsoft)

Postgres MCP from Microsoft: connection profiles with passwords in the OS keyring, Entra ID sign-in for Azure, queries, schema, CSV and server metrics

MCP serverBroad access68Repository stars

A Python MCP server for MySQL: listing tables, reading data, running SQL and inspecting schema through a controlled interface

MCP serverBroad access1.4KRepository stars

MCP server that gives an agent access to MySQL: schema inspection and queries, read-only by default, writes behind flags

MCP serverExtended access2.2KRepository stars

MCP SQLite Server (npx)

MCP SQLite Server

Node.js MCP server for SQLite databases that runs via npx, no Python or uvx needed

MCP serverExtended access17Repository stars

MCP server and CLI to drive real Microsoft Excel: Power Query, DAX, VBA, PivotTables and charts

MCP serverBroad access834Repository stars
Official

A desktop SQL workspace with a built-in MCP server: the agent reads the schema and runs queries in the same client you already use

MCP serverBroad access5.3KRepository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialAuthenticationRepository starsMain difference
Microsoft SQL Server MCP Server (this entry)nokey is optional401
DBHubnonot required3,752one compact server for PostgreSQL, MySQL, MariaDB, SQL Server and SQLite with a read-only mode
MySQL MCP Servernonot required1,403a similar Python server for MySQL

README in short

The description is short: a quick start for Claude Desktop, variable blocks for SQL, Windows and Azure sign-in, and a fallback pip install that runs the mssql_mcp_server module. The security section boils down to four tips on permissions and encryption. For development the repository is cloned and installed with `pip install -e .`.

README badge

Report a problem

Foxx AIMicrosoft SQL Server MCP Server
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.