sql-server-mcp
Click on "Deploy 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., "@sql-server-mcpshow me the top 10 rows from sales.dbo.orders"
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.
sql-server-mcp
A local MCP server for read-only SQL Server / MS Fabric queries. Runs as a single-user process over stdio, authenticated as you (delegated Entra ID identity, not a service principal) — one server process per tenant.
Prerequisites
Python 3.14+ and uv
Microsoft ODBC Driver 18 for SQL Server installed on your machine
Either the Azure CLI logged in to the target tenant (
az login --tenant <tenant-id>), or just a browser available — the server falls back to an interactive browser login if there's no CLI sessionAn Entra ID account in the target tenant with read access to the target database (e.g.
db_datareader)
Related MCP server: powerbi-mcp-proxy
Configuration
Each tenant gets its own set of environment variables:
Variable | Required | Description |
| yes | SQL Server / Fabric SQL endpoint hostname, e.g. |
| yes | Default database to connect to |
| yes | The Entra ID tenant ID — pins auth to this directory even if your machine has other |
| no | Max rows returned per tool call (default: 25) |
| no | ODBC driver name (default: |
Running it
The server is a uvx-runnable console script (sql-server-mcp), no
manual install step needed - uvx builds an isolated environment for it
on first run and reuses it afterwards:
uvx sql-server-mcpTo run from a local checkout instead (e.g. during development), point
--from at the path:
uvx --from /path/to/sql-server-mcp sql-server-mcpOn startup it checks the ODBC driver is installed, then acquires a token
(via az login if available, otherwise an interactive browser prompt) and
runs over stdio.
Example MCP client config
One block per tenant:
{
"mcpServers": {
"tenant-a-sql": {
"command": "uvx",
"args": ["sql-server-mcp"],
"env": {
"MCP_SQL_SERVER_NAME": "tenant-a.datawarehouse.fabric.microsoft.com",
"MCP_SQL_DATABASE_NAME": "wh_silver",
"MCP_AZURE_TENANT_ID": "<tenant-a-tenant-id>"
}
},
"tenant-b-sql": {
"command": "uvx",
"args": ["sql-server-mcp"],
"env": {
"MCP_SQL_SERVER_NAME": "tenant-b.datawarehouse.fabric.microsoft.com",
"MCP_SQL_DATABASE_NAME": "wh_gold",
"MCP_AZURE_TENANT_ID": "<tenant-b-tenant-id>"
}
}
}
}Tools
query(sql)— run a single read-onlySELECT. Table references must be fully qualified asdatabase.schema.table; there's no mutable "active database". Returns at mostMCP_MAX_ROWSrows, as a Markdown table.list_databases()— list user databases with status/metadata.search_schema(target, name, databases?, schema?, use_wildcard?)— search table or column metadata viaINFORMATION_SCHEMAacross one or more databases (all of them ifdatabasesis omitted).export_query(sql, path, format?)— run a single read-onlySELECTand write the full, uncapped result to a local Parquet or CSV file instead of returning it. For large results or when the output feeds into other local tools (pandas, DuckDB, etc.).
Development
uv run pytest # unit tests, no network/DB/Azure required
uv run python scripts/manual_smoke_test.py # real end-to-end check against a live databaseThis server cannot be deployed
Maintenance
Related MCP Connectors
Official Microsoft MCP Server to query Microsoft Entra data using natural language
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
- SupabaseOAuthcom.supabase
MCP server for interacting with the Supabase platform
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceRead-only MCP server for SQL databases (SQL Server, Postgres, SQLite) with multi-server support and three-layer safety using AST validation and linting.MIT
- AlicenseNot gradedqualityDmaintenanceA self-hosted MCP server that proxies MCP clients to Power BI, using your own Entra tenant and Azure subscription. It enables DAX queries, workspace listing, and dataset management while preserving user-specific row-level security.2MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for reading and analyzing Fabric semantic models. Supports getting model definitions and executing DAX queries against Power BI datasets.17-
- AlicenseNot gradedqualityBmaintenanceMCP server for safely exposing SQL Server database capabilities to LLM clients, with read-only mode, security features, and observability.28MIT