Calendar Icon White
June 26, 2026
Clock Icon
14
 min read

Azure SQL MCP Server: Secure Setup for Claude & AI Agents (2026)

The Azure SQL (MSSQL) MCP server lets Claude, Cursor, ChatGPT, and AI agents query SQL Server in plain English. Microsoft pulled its own sample as unsafe — here's the safe path, the real risks, and how to govern agent access with column-level redaction at the MCP layer.

Azure SQL MCP Server: Secure Setup for Claude & AI Agents (2026)
ChatGPT
Perplexity
Grok
Google AI
Claude
Summarize and analyze this article with:

TL;DR

  • An Azure SQL (MSSQL) MCP server lets AI agents (Claude, Cursor, ChatGPT, Perplexity, custom agents) query — and on some servers write to — your Azure SQL Database or SQL Server through the Model Context Protocol.
  • The story here is a warning. In June 2026 Microsoft removed its own experimental MSSQL MCP sample, with the pull request titled "Removed unsafe MCP sample" — because it "continues to pop up for customers leading them down the wrong road." The supported path is now the SQL MCP Server built on Data API Builder, which is RBAC-governed, excludes DDL, and doesn't expose raw NL-to-SQL.
  • The risk is concrete: the deleted Node sample defaulted to write, the .NET version had no read-only mode at all, and a privileged Entra principal hands an agent DropTable and UpdateData across the database. A privileged agent can also bypass Always Encrypted, Dynamic Data Masking, and Row-Level Security — masked columns come back in cleartext to the model.
  • Strac Azure SQL MCP DLP is the governance layer for AI-agent access to SQL Server. Strac sees every query, controls which tables and columns an agent can reach and whether it can write or run DDL, protects sensitive columns with redaction, masking, tokenization, and vaulting, and proves every call as audit evidence mapped to SOC 2 / HIPAA / PCI / GDPR. Redaction is part of it, not the whole of it.
  • Setup is agentless and under 10 minutes — no application changes, no schema migration, no re-grant.

What Is the Azure SQL MCP Server?

An Azure SQL MCP server is a Model Context Protocol implementation that exposes an Azure SQL Database or SQL Server instance to AI agents as a set of standardized tools — listing tables, describing schemas, reading rows, and (depending on the server) inserting, updating, and creating tables.

There isn't one canonical server, and the difference is a security decision:

  • The recommended path: SQL MCP Server on Data API Builder (DAB). Microsoft-maintained and open source, it governs access through per-entity, per-role RBAC, abstracts entities rather than exposing your raw schema, deliberately excludes DDL, and doesn't offer raw natural-language-to-SQL. Secrets come from Key Vault. See the Microsoft docs.
  • The removed experimental sample (MssqlMcp). This is the one most early adopters found and the one Microsoft deleted as unsafe. Forks of it still circulate — that's the risk.
  • The Azure MCP Server azure-sql tools are a different thing entirely: control-plane management (create, delete, scale databases, firewall rules, Entra admins), not table data.
  • Community servers (mssql_mcp_server and others) have their own tool surfaces and defaults — vet each one.

From the user's seat, the agent suddenly understands the database — it answers questions about live data in T-SQL without anyone exporting a report. From the security seat, you've just handed an AI client query access to SQL Server, and possibly write and schema access too.

That's the value. It's also exactly where a control layer belongs.

What AI Agents Can Actually Do With Azure SQL MCP

Point an agent at an Azure SQL MCP server and it works the database directly, turning plain-English requests into T-SQL against the tables the connected principal can touch. Depending on the server, it can:

  • Query tables in plain English — "Which policyholders filed a claim over $10k last quarter?" becomes a live T-SQL query against real rows.
  • Inspect and describe schemas — list tables, read column types and relationships, and explain the data model.
  • Read, and often writeReadData is universal; the removed sample also exposed InsertData, UpdateData, CreateTable, and DropTable.
  • Run stored procedures — DAB can register stored procedures as MCP tools, and T-SQL stored procs can do far more than a single statement.
  • Aggregate and report — counts, rollups, and analytics computed against production data on demand.

Every one of those runs through SQL Server's engine and the privileges of the principal you connected — which is what makes it useful, and exactly why the regulated data those queries return needs an inspection layer in the tool-call path.

The Real Security Risks of the Azure SQL MCP Server

Microsoft pulling its own sample is the loudest possible signal. Five categories every healthcare, fintech, and enterprise security team should price in:

1. Default-write, and the .NET sample had no read-only at all. The removed Node sample defaulted to write unless READONLY was set to exactly "true"; the .NET version registered every write tool with no read-only mode. Connect a db_owner Entra principal — common in dev — and the agent inherits UpdateData and DropTable across the entire database. This is the "wrong road" Microsoft cited.

2. A privileged agent bypasses your SQL-layer masking. Always Encrypted, Dynamic Data Masking, and Row-Level Security all assume a constrained application principal. An agent connected with broad rights can return masked columns in cleartext — the protections you configured at the SQL layer don't reach the model context.

3. T-SQL has escape hatches. Stored procedures, dynamic SQL, and (where enabled) xp_cmdshell let a query do far more than read a table. DAB can expose stored procs as tools; a community server may expose raw T-SQL. A misread prompt can reach well beyond a SELECT.

4. Linked servers extend the blast radius. A read grant on one database doesn't bound a linked-server hop. The agent's reach can quietly cross into other databases and instances you didn't mean to expose.

5. There is no column filter in the path. Whatever the connected principal can read, a wide SELECT returns — plaintext PII, financial data, credentials in config tables — straight into the model's context window, far more than any human would copy by hand.

The DLP a company already runs doesn't sit in the T-SQL path between an agent and SQL Server. The query result goes straight from the database into the AI agent's context window. That reach is precisely why each agent's access to Azure SQL must be governed: controlled (which tables and columns it can touch, and whether it can write or run DDL and stored procs), the sensitive data it returns protected, and every query audited. That is where Strac Azure SQL MCP DLP lives.

✨ Strac Azure SQL MCP DLP — Production-Ready Agent Governance

Strac's Azure SQL MCP DLP is the governance layer that sits between AI agents and the Azure SQL MCP server. Strac governs every query: it sees exactly what each agent runs, controls what it can reach and do, protects the sensitive columns it touches, and logs every call as audit evidence. In-policy, non-sensitive queries flow through untouched.

Strac Azure SQL MCP DLP architecture — AI agents query Azure SQL via the MCP server, Strac intercepts every query and result, scopes table and column access, blocks writes and DDL, and redacts PII, PHI, PCI, and secrets at the column level before rows reach the AI model
The Strac Azure SQL MCP DLP gateway sits between any AI agent (Claude, Cursor, ChatGPT, custom) and the Azure SQL MCP server. It scopes which tables and columns the agent can reach, blocks writes, DDL, and risky stored procedures, and redacts regulated columns before any row reaches the model — even where SQL-layer masking would be bypassed.

What this looks like in practice, mapped to See / Control / Protect / Prove:

  • See — Strac surfaces every query an agent runs: which AI client, which user, which tables and columns it touched, how many rows came back, and which data classes were present. The opaque "the agent talked to SQL Server" becomes a per-query record.
  • Control — Strac scopes access at the table and column level. You allow an agent to read claims and policies but never payment_methods or secrets. Writes (UPDATE / DELETE / INSERT), DDL (CreateTable / DropTable), and risky stored procedures are blocked or routed for approval — so a misread prompt can't mutate production or alter your schema.
  • Protect — Strac applies column-level redaction, masking, tokenization, and vaulting on the returned rows, independent of SQL-layer masking — so even a privileged principal that would bypass Dynamic Data Masking still can't leak cleartext. An ssn returns masked, a card_number tokenized, a secret vaulted.
  • Prove — every query is logged with the data classes detected, the controls applied, and the disposition. The log is the SOC 2 / HIPAA / PCI / GDPR audit evidence for AI-agent database activity — produced automatically.

The same Strac MCP DLP layer covers your other databases and warehouses — Postgres MCP, Snowflake MCP, Databricks MCP, and BigQuery MCP — one control plane across every place AI agents reach your regulated data. See the MCP DLP pillar and the broader MCP data security discipline for the full model.

✨ Strac Native Azure SQL DLP — The Companion to MCP DLP

Strac data discovery dashboard continuously scanning a connected SQL database and classifying PII, PHI, PCI, and secrets in real time
Strac natively discovers and classifies the regulated columns inside your Azure SQL database before any agent queries them — the companion to Azure SQL MCP DLP that maps where sensitive data lives.

MCP DLP governs the AI-agent query surface. Strac's native Azure SQL DLP governs the data at rest — the same database, but discovered and classified so you know where the regulated columns are before any agent ever queries them. This is DSPM for Azure SQL, and most teams run both: native discovery to map and label the sensitive data, MCP DLP to govern how agents reach it.

What Strac's native Azure SQL DLP includes:

  • Continuous discovery and classification of PII, PHI, PCI, and financial data across every database, schema, table, and column
  • Column-level labeling — Strac identifies which columns hold SSNs, card numbers, health data, and credentials, so policy can target them precisely
  • Sampling at depth — Strac inspects column contents, not just names, so an nvarchar(max) notes column holding clinical data or a config table hiding secrets is caught
  • A live data map of where regulated data sits, feeding directly into the MCP DLP column-level controls
  • Audit-ready findings mapped to SOC 2 CC6, HIPAA Security Rule, PCI Req. 3/7/10, and GDPR

For the broader practice this sits inside, see DSPM for AI. For every SaaS, cloud, database, and endpoint surface Strac covers, see strac.io/integrations.

✨ See Strac MCP DLP in Action

The screenshot below shows Strac's MCP DLP redacting sensitive data from a real Claude session — customer emails, identifiers, and credit card numbers tokenized inline before the model received them. The same inspection pattern runs on every Azure SQL MCP query routed through Strac, applied column-by-column to the returned rows.

Strac DLP redacting sensitive data in a Claude conversation — PII, PHI, and PCI elements replaced with tokenized placeholders before reaching the model
Strac DLP at work inside a Claude conversation: sensitive elements tokenized inline before the model sees them. The same pattern runs at the MCP layer for every Azure SQL query result.

How to Set Up Strac Azure SQL MCP DLP

Setup is agentless and takes under 10 minutes.

  1. Connect Strac to your Azure SQL database. Strac uses a dedicated, least-privilege SQL principal — never db_owner or an admin Entra role — so the agent's reach is bounded from the start.
  2. Point your AI client at the Strac MCP endpoint. Strac issues an MCP server endpoint that drops into your AI client's configuration and proxies to the Azure SQL MCP server behind it. For Claude Desktop: json "mcpServers": { "azure-sql": { "url": "https://mcp.strac.io/azure-sql", "auth": { "type": "bearer", "token": "<your-strac-token>" } } } For Cursor, OpenAI Agents, and custom agents — same endpoint, same auth.
  3. Pick your policy. Out-of-the-box templates for SOC 2, HIPAA, PCI, and GDPR. Custom policies — table-level allow/deny, column-level redaction, write- and DDL-blocking, stored-procedure controls — take minutes to configure.
  4. Done. Every query between your agent and Azure SQL now flows through the Strac gateway. No application changes, no schema migration, no re-grant. The audit log starts populating immediately.

Compliance Coverage Out of the Box

The same Strac Azure SQL MCP DLP control produces evidence mapped to every major compliance framework.

Framework
What Strac Azure SQL MCP DLP Satisfies
SOC 2
CC6.1 (logical access to data), CC6.6 (unauthorized data exposure), CC6.7 (restricted transmission of data to external systems), CC7.2 (monitoring for anomalies including AI query activity)
HIPAA
§164.312(a)(1) (access control), §164.312(b) (audit controls), §164.502(b) (minimum necessary), §164.528 (accounting of disclosures)
PCI DSS v4.0.1
Req. 3.3 (PAN masking), Req. 3.4 (render PAN unreadable), Req. 7 (least privilege), Req. 10 (log every access to cardholder data)
GDPR
Art. 5 (data minimization & purpose limitation), Art. 25 (data protection by design), Art. 30 (records of processing), Art. 32 (security of processing)

For the broader AI-data-governance program this sits inside, see AI DLP.

🌶️ Spicy FAQs for Azure SQL MCP Server

Why did Microsoft remove its own MSSQL MCP server?

In June 2026 Microsoft deleted the experimental MssqlMcp sample from its SQL-AI-samples repo in a pull request literally titled "Removed unsafe MCP sample," explaining it "continues to pop up for customers leading them down the wrong road." The sample defaulted to write access (the .NET version had no read-only mode), which made it easy to give an AI agent destructive rights over a database. Microsoft now points to the SQL MCP Server built on Data API Builder, which is RBAC-governed and excludes DDL. Forks of the removed sample still circulate, so the safe move is the DAB path plus a DLP layer that inspects the data itself.

Which Azure SQL MCP server should you use — and is it safe?

Use the SQL MCP Server on Data API Builder, not the removed sample or its forks. DAB governs access with per-entity, per-role RBAC, abstracts your schema, excludes DDL, and pulls secrets from Key Vault. Even then, RBAC controls which entities an agent can reach — it doesn't redact the regulated values inside the rows it returns. So scope tightly and put a DLP layer like Strac in front so the data itself is inspected, not just the access.

Is the Azure SQL MCP connector the same as the Azure SQL MCP server?

Yes — the same thing. The MCP specification says server; Claude and Cursor surface it as the Azure SQL connector. Both let an agent query your tables, and Strac's Azure SQL MCP connector redacts regulated columns at the tool-call boundary regardless of the label.

Is the Azure SQL MCP server safe to use with sensitive data?

Not by itself. The widely-copied sample defaulted to write, a privileged agent bypasses Always Encrypted and Dynamic Data Masking, and even the RBAC-governed DAB path returns plaintext rows for the entities an agent can read. For production use against regulated data you need an MCP-layer control like Strac Azure SQL MCP DLP that scopes table and column access, blocks writes and DDL, and redacts sensitive columns before any row reaches the model.

Does Strac protect data even if Dynamic Data Masking is bypassed?

Yes — that's a key point for SQL Server. Always Encrypted, Dynamic Data Masking, and Row-Level Security assume a constrained application principal; a broadly-privileged agent can return masked columns in cleartext. Strac inspects the actual rows returned at the MCP layer and redacts, masks, or tokenizes regulated values independent of the SQL-layer controls — so the protection holds even when the database-native masking is bypassed.

Can Strac stop an AI agent from writing to or altering my Azure SQL schema?

Yes. Strac inspects the operation before it executes. Writes (UPDATE, DELETE, INSERT), DDL (CreateTable, DropTable, ALTER), and risky stored procedures can be blocked outright, allowed only on specific tables, or routed for human approval — so even a write-enabled server can't let a misread prompt mutate production or change your schema.

What sensitive data types does Strac detect in Azure SQL query results?

PII (SSN, driver's license, passport, address, phone, email), PHI (clinical notes, MRN co-occurrence, ICD-10 codes adjacent to identifiers, lab values), PCI (full and partial card numbers via Luhn check), credentials (API keys, AWS / GCP / Azure access keys, OAuth tokens, JWTs, connection strings — 48+ patterns), and custom detectors trained on your internal classifications. Detection runs column-by-column across the returned rows, including text inside nvarchar(max) and JSON columns.

How long does Strac Azure SQL MCP DLP take to deploy?

Under 10 minutes for the first database. Connect Strac with a least-privilege SQL principal, paste the Strac MCP endpoint into your AI client's config, pick a policy template, done. No application changes, no schema migration, no re-grant.

The Bottom Line

The Azure SQL MCP server is fast becoming the way AI agents read — and sometimes write — your SQL Server data. Microsoft thought the risk was serious enough to delete its own sample and call it unsafe. The supported DAB path is a real improvement, but it governs access, not the plaintext PII inside the rows an agent is allowed to read — and your SQL-layer masking can be bypassed by a privileged agent. Running Azure SQL MCP in 2026 without an MCP-layer governance control isn't a question of if the first incident reaches your security team; it's when.

Strac Azure SQL MCP DLP gives you the control plane — see every query, scope every agent, block writes and DDL, protect every regulated column, prove every call — so your team can use Azure SQL with Claude, Cursor, ChatGPT, and any future AI client without making each one a separate security exception.

If you are running — or about to run — Azure SQL MCP in production, book a 30-minute demo. We'll walk through the architecture, the DAB-vs-sample decision, the masking-bypass risk, the policy templates, and a deployment plan for your specific database and AI clients.

For the broader MCP DLP control plane across every data surface, see the MCP DLP pillar. For more data-platform deep dives: Postgres MCP, Snowflake MCP, Databricks MCP, BigQuery MCP.

Why did Microsoft remove its own MSSQL MCP server?
Which Azure SQL MCP server should you use — and is it safe?
Is the Azure SQL MCP connector the same as the Azure SQL MCP server?
Is the Azure SQL MCP server safe to use with sensitive data?
Does Strac protect data even if Dynamic Data Masking is bypassed?
Discover & Protect Data on SaaS, Cloud, Generative AI
Strac provides end-to-end data loss prevention for all SaaS and Cloud apps. Integrate in under 10 minutes and experience the benefits of live DLP scanning, live redaction, and a fortified SaaS environment.
Users Most Likely To Recommend 2024 BadgeG2 High Performer America 2024 BadgeBest Relationship 2024 BadgeEasiest to Use 2024 Badge
Trusted by enterprises
Data Security + Compliance Automation

Latest articles

Browse all

Get Your Datasheet

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Close Icon