SQL server MCP data privacy

Microsoft's SQL MCP Server is open source and self hosted, so data stays in infrastructure the client chooses, but query results can be cached and telemetry goes to Azure services unless the client routes it elsewhere. This page sets out what the docs state and what the reviewer must still confirm.

On this page

Does SQL MCP Server keep SQL data privacy in the client's control?

A security reviewer approving an AI agent that reads SQL Server or Azure SQL needs to know whether data leaves the client's control. Microsoft's SQL MCP Server, built on Data API builder, is self hosted, so the database, the dab-config.json file and the logs stay wherever the client runs the server, whether locally, in a container or in Azure. Privacy therefore depends on four choices the client makes: the host, the logging destination, the cache settings and the model provider behind the MCP client. No edition split applies. The server is open source under an MIT license with a Microsoft Corporation copyright notice, it is included in Data API builder from version 1.7, and Microsoft's overview recommends the latest 2.0 release for current capabilities and bug fixes.

Because the server is self hosted, the reviewer's first task is to document the hosting location and confirm that the database, configuration file and any container file logs sit inside approved boundaries. Confirm which Data API builder version is deployed and whether it matches the release Microsoft currently recommends, since fixes ship in newer releases. Then confirm the logging destination. The overview says the server emits logs and telemetry to Azure Log Analytics, Application Insights and local container file logs, so each destination needs its own retention, access and region review. Also confirm whether the caching settings in the configuration sit within the data classification approved for the agent.

The reviewer should not assume that self hosting settles the question for the model side. Microsoft's documentation says the server works with any MCP compatible client, including local LLMs served through Ollama, which keeps model traffic inside the client's network. A hosted model service is a different case. The Microsoft documentation does not state a data retention period for model providers, so ask the client or model vendor for their written retention and training terms, and record the answer before approval. Treat a cloud model as a separate data processor with its own review.

Data privacy controls by deployment option

This table compares each data privacy control in Microsoft's SQL MCP Server by its source: built into the server, set by the client, or provided by a component outside the server. Read each row against your hosting choice, because local, container and Azure runs place logs, cache and the model in different locations. The main takeaway is that Microsoft's documentation states no retention period for model providers, so that question must go to the MCP client and model service you choose.

ControlBuilt inConfigurable by the clientNeeds an outside component
Data stays in client infrastructureServer is self hosted, so the database, config file and logs stay where the client hosts themClient picks local, container or Azure hostingHosting platform and database owned by the client
Agent sees only exposed entitiesAgents work through the abstraction layer and reach only entities and fields the current role may accessClient lists tables, views or procedures and their permissions in dab-config.jsonNone needed for this control
describe_entities reads config, not the databaseReturns entity and field names and descriptions from in-memory configuration without querying the databaseClient controls the entity names and descriptions written into configNone needed for this control
read_records cachingResults are cached automatically, so query results can sit in cacheLevel 1 and level 2 caching can be set per entityConfirm where cached results sit in your hosting design
Logs to Azure Log Analytics and Application InsightsServer emits logs and telemetry to these Azure servicesConfirm which sinks are enabled and who can query themLog Analytics and Application Insights workspaces, if used
Local container file logsServer writes file logs when run in a containerConfirm the log location and retention on the container hostContainer host log storage and retention tooling
OpenTelemetry tracing of MCP tool callsMCP tool calls are traced with OpenTelemetryConfirm which trace destination receives the dataOpenTelemetry collector or tracing backend, if used
Local model through OllamaWorks with local LLMs served through Ollama, which keeps model traffic inside the client networkClient chooses the model and where Ollama runsOllama host and the local model files
Model provider retention (not stated by Microsoft)Not stated by Microsoft in its documentation for this serverSet by the MCP client and model service the client choosesModel provider and MCP client terms, to be obtained in writing

What an agent can see in SQL data

The first question for any reviewer is what the agent is able to see at all. According to the Microsoft Learn overview, agents never interact directly with the database. They work through the Data API builder abstraction layer, which exposes only the entities and fields that the current role may access. Anything not granted to that role is not part of the agent's view, so the role definitions in dab-config.json are the first thing to review, before any question of sign-in or logging.

The describe_entities tool is the one most teams misread. Per the overview, it returns entity and field names and descriptions from the in-memory configuration and does not query the database. Schema metadata therefore reaches the client without a database read and without any row data. Reviewers should still treat those names and descriptions as sensitive when they reveal business structure, and should write descriptions in the config with that in mind. Confirm with the vendor how descriptions appear to the model before assuming they are harmless.

Row data takes a different path. Results returned by read_records go to the MCP client, and from there to whatever model the client uses. The server does not decide where those results travel after they leave it. Before approving a deployment, confirm which MCP client and model service will receive query results, and whether the model provider's terms cover that data. Read SQL MCP Server overview for the entity model, then map each exposed table to the client and model that will receive its rows.

Where query results and logs travel

The flow starts at the MCP client, which sends tool calls to SQL MCP Server in infrastructure the client chooses. The server reads from the SQL database, and read_records results can sit in an in-memory cache configured per entity. Logs and telemetry leave the server two ways: OpenTelemetry traces reach Azure Log Analytics and Application Insights, while container file logs stay on the host. Model requests from the client go to whichever model provider it uses, and that provider's retention terms apply. The separate branch at the bottom shows a local Ollama model, which keeps model traffic inside the client network. Check which destinations your policy allows and who can read each store.

Query results, cache, logs and model traffic in a self-hosted SQL MCP Server setup.

How caching and telemetry affect what gets stored

A SQL MCP Server deployment can keep data in more places than the database itself: a result cache, log sinks and trace data. Each one is a separate store with its own access controls and retention, so a privacy review has to walk through them one at a time.

Automatic caching of read results

Per Microsoft Learn, results from the read_records tool are cached automatically. That means rows an agent reads can persist in server memory after the request completes, outside the database's own access path. Reviewers should confirm which entities return sensitive columns and whether those reads can be served from cache to a different caller. Ask Microsoft or your own testing how cache entries are keyed to roles.

Read the overview

Level 1 and level 2 cache settings

Caching can be configured per entity at level 1 and level 2, so cache behavior is set in the same configuration file that defines exposed objects. A privacy review should list every entity with caching enabled, record the cache level for each, and confirm the settings match the data classification. An entity holding personal or payment data should be reviewed separately from reference tables before any cache setting is approved.

Logs to Azure monitoring services

The server emits logs and telemetry to Azure Log Analytics and Application Insights. Whatever lands in those workspaces inherits their access model, retention settings and any region or residency choices made for them. Reviewers should confirm which workspace receives the data, who holds read access, and whether query text or parameter values can appear in the records. Confirm the retention period configured on each workspace, since the Microsoft documentation reviewed here does not set one for these logs.

Local container file logs

When the server runs in a container, it also writes logs to files inside that container. These files sit on storage the client controls, so they stay within the infrastructure the team chooses. The risk is that files persist, get copied into images or volumes, or are collected by a host log shipper nobody reviewed. Teams should decide where the files are written, how long they are kept, and who can read the volume that holds them.

OpenTelemetry tracing of tool calls

The server traces MCP tool calls with OpenTelemetry, which records what an agent asked for and when. Trace attributes can carry request details, so a trace pipeline can hold data that never appeared in a query result. Reviewers should identify which exporter receives the traces, which attributes are recorded, and whether a collector in the pipeline strips or hashes values before storage.

Sensitive fields in logs and cache

The main check is whether sensitive fields show up in any of these stores. Map each exposed entity's fields to a data classification, then test a sample query through the server and search the cache, logs and traces for the returned values. Where a field must never leave the database, remove it from the entity definition rather than relying on downstream filtering. Record the result as evidence for the review.

How the answer changes by hosting and model choice

Running the server locally through the Data API builder command line, with the stdio transport, keeps the MCP connection on the same machine as the MCP client. Microsoft describes the server as self hosted and says it can run locally, so the client decides where the database connection, the dab-config.json file and the local logs live. Stdio is intended for local or CLI use, so this option does not put an MCP endpoint on the network.

  • Database traffic: The server connects to the database from the workstation, so the reviewer must confirm which network path and which database host the machine can reach.
  • Config file: dab-config.json sits on the workstation, so its permissions and any stored credentials are controlled by whoever owns that device.
  • Logs and telemetry: Local file logs stay on the device, but any Azure Log Analytics or Application Insights destination configured in the server sends data out of it.
  • Model traffic: Query results returned to the MCP client go to whichever model service the client uses, which can be a cloud provider or a local model.

Confirm with the MCP client whether it stores transcripts or tool results, and whether it is permitted on managed devices.

Order of work before approving SQL data for agent access

This sequence settles where the server and its data sit, what the agent can see, how long cached results and logs persist, and where model traffic goes, so the approval rests on documented facts rather than assumptions. Each step produces a written decision that the next step depends on.

  1. Confirm the hosting boundary first

    The platform or security lead records where the SQL MCP Server will run: a local machine, a container, or Azure. Microsoft describes the server as self hosted, so the database connection, the dab-config.json file and the server logs stay in whatever infrastructure the client chooses. Confirm which network the database sits on, who can reach the server process, and whether the MCP client runs inside the same boundary. The step is done when the hosting location, the network path to the database, and the list of people with administrative access to the host are written down and approved.

  2. Decide which entities and fields agents can see

    The data owner and security reviewer choose which tables, views and stored procedures the configuration exposes, and which fields on each entity the current role may read. The agent works through the Data API builder abstraction layer and sees only what the configured role allows, so the exposure list is the main privacy control. Review each entity for sensitive columns such as personal identifiers, payment details, credentials or free-text notes, and decide whether those fields are left out entirely. Note that the describe_entities tool returns entity and field names and descriptions from configuration, so even field names may be visible to the client. Done means a reviewed allowlist of entities and fields, with excluded sensitive columns recorded and a named owner for each entity.

  3. Set the cache policy for each entity

    Microsoft's documentation says read_records results are cached automatically, and level 1 and level 2 caching can be set per entity. Decide for each exposed entity whether query results may sit in cache at all, and if so for how long and at which level. Entities holding personal or regulated data are the first candidates for caching disabled or tightly limited. Ask the platform team to confirm the cache location and whether it is in memory or persisted, and who can read it on the host. The step closes when each entity has a recorded cache setting that the data owner has signed off on, and the team can state which results may persist after a request ends.

  4. Choose log and telemetry destinations and retention

    The server emits logs and telemetry to Azure Log Analytics, Application Insights and local container file logs, and traces MCP tool calls with OpenTelemetry. Decide which of these destinations the organization will use, and confirm who owns each one and how long each keeps data under its own settings. Retention periods are set in the destination service, not in the MCP server, so the reviewer should confirm them there and not assume a default. Check whether the traces carry query text or returned values, since that determines what the logs can expose. The step is complete when each destination has a named owner, a documented retention setting and an access list.

  5. Confirm the MCP client and model provider terms

    The server works with any MCP compatible client, including local LLMs served through Ollama, which keeps model traffic inside the client's network. If the team uses a hosted model or a third-party client, the query results the agent receives may be sent to that provider. Microsoft's documentation does not state a retention period for model providers, so request the data retention, training use and sub-processor terms in writing from the client and model vendor. Record whether the model runs locally or remotely. The step is done when the team holds the written terms for each client and model service in use and has confirmed whether returned rows leave the network.

  6. Test that logs hold no forbidden row data

    Run a controlled test against a non-production copy of the data that includes marker values in the sensitive columns the policy forbids. Then check every destination from the previous steps, including the cache, local file logs, and the telemetry service, for those markers. A reviewer should inspect the trace content directly rather than rely on a summary. Repeat the check after any change to the configuration or the logging settings. The step closes when the test shows no forbidden values in logs or telemetry, the results are filed with the approval record, and the owner has agreed to rerun the test after configuration changes.

Questions reviewers ask about SQL MCP Server data privacy

Does Microsoft state a data retention period for model providers?

No. The Microsoft documentation for SQL MCP Server does not state a data retention period for model providers. Retention depends on the MCP client and the model service your organization chooses, so the server itself does not settle that question. Before approval, ask the client vendor and the model provider for their written retention terms, whether prompts and tool results are used for training, and whether zero data retention or a comparable option is available on your plan. Record the answers next to the SQL MCP Server review so the approval covers the whole chain, from the agent to the model.

Does the SQL MCP Server send our data to Microsoft?

Microsoft Learn describes SQL MCP Server as self hosted, so the database, the configuration file and the logs stay in infrastructure you choose, such as a local machine, a container or Azure. The overview does list telemetry destinations: Azure Log Analytics, Application Insights and local container file logs, with MCP tool calls traced through OpenTelemetry. Confirm in your own environment which of those destinations are enabled, what fields the traces carry, and who can read them. Whatever the client sends to its model provider is governed separately from the server.

What changes if the query result cache is turned off?

Results from read_records can be cached automatically, and Microsoft Learn says level 1 and level 2 caching can be configured per entity. With caching on, query results can sit in memory or in the cache layer after the agent has used them, which extends the period during which that data is held. Turning caching off or limiting it to specific entities reduces how long results persist on the server, at the cost of more database reads. Test each setting on the entities that hold sensitive fields, and check the cache configuration in the file before the server is approved for production use.

Can a local model keep agent traffic inside our network?

Yes, in principle. Microsoft Learn says SQL MCP Server works with any MCP compatible client, including local LLMs served through Ollama, and that this keeps model traffic inside the client's network. The database, the server and the model can then all run on infrastructure you control. The limit is that the claim covers only the path between the agent and the model. Confirm that the MCP client does not send prompts, tool results or telemetry to an external service, and check the client's own settings and network egress rules. Test the setup by blocking outbound traffic and confirming the agent still works.

What does an outside review cost, and what drives the effort?

DeployOpen does not publish a price list, and a quote follows from a written scope. The main cost drivers are the scope of the review (one agent or several, read-only or write-enabled entities), where the server is hosted (local, container or Azure), how many entities and fields are exposed, and how logging and telemetry are designed and reviewed. Most engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts. Ask for the quote to list what is one-time (the review, fixes and retest) and what recurs (retainers, upgrades and continuous testing), and to name the environments and client tools covered.

Can our security team complete this review without outside help?

Yes, if your team has the skills and time. The Microsoft documentation gives you the configuration file, the entity and permission model, the caching options, the telemetry destinations and the local model option, so an internal team can map each of those to its own controls. The work that usually takes the most effort is testing: confirming what a role can actually see, checking that logs contain what you need and nothing you should not store, and proving the cache settings hold under load. DeployOpen can do that testing as a fixed-scope engagement, and it prepares the evidence that compliance teams ask for, but it does not issue audit reports or attestations.

Which parts of this review does Microsoft's documentation not answer?

Microsoft's documentation covers only Microsoft's official SQL MCP Server. It does not name or vouch for community MCP servers for SQL Server, so any community server needs its own review. The documentation also does not state retention periods for model providers, and it does not describe how a particular client stores prompts or conversation history. Those gaps belong in your vendor questionnaire. Ask the client vendor, the model service and your Microsoft account team to confirm each point in writing, and keep the answers with your approval record.

Gaps the docs leave open for data privacy

The first decision is to treat four questions as open until a party confirms them in writing. Microsoft's documentation for SQL MCP Server does not state a data retention period for model providers. Retention depends on the MCP client and the model service the organization picks, so a reviewer should ask the client vendor and the model host for their written retention terms, including whether prompts and query results are used for training or kept for abuse monitoring. The documentation also does not spell out the exact content of telemetry fields sent to Azure Log Analytics, Application Insights or local container file logs, beyond stating that MCP tool calls are traced with OpenTelemetry. Ask Microsoft for a field-level schema, and confirm whether any row values, parameter values or identifiers appear in traces. Cache eviction is another gap: the docs say read_records results are cached and that level 1 and level 2 caching can be set per entity, but they do not describe how long entries live, when they are evicted, or whether they are cleared when a role's permissions change. Confirm these against the version you run, since the overview recommends the latest 2.0 release.

Community SQL MCP servers fall outside Microsoft's coverage entirely. The documentation covers only Microsoft's official server and does not name or vouch for community alternatives, so any data handling claim for those servers has to come from their own maintainers. If staff are running one, treat it as an unreviewed data path and require the maintainer's documentation on logging, caching and outbound calls before approval, or block it at the client.

Close each gap with the same three steps. First, obtain written confirmation from the relevant party: the model provider for retention, Microsoft for telemetry schema and cache behavior, and the community maintainer if one is in use. Second, review your own configuration, since the server is self hosted: check the dab-config.json cache settings per entity, the log destinations in your container or Azure setup, and who can read the Log Analytics workspace. Third, run a test with non-production data that contains realistic but fictitious records, then inspect the logs, the cache and the model provider's dashboard for anything that should not be there. Record the results so the approval rests on evidence rather than on assumptions.

How DeployOpen helps teams review SQL MCP Server data privacy

DeployOpen plans, implements and tests self-hosted platforms inside the client's own infrastructure, and runs AI agent rollout security reviews. For SQL MCP Server data privacy, we help security and compliance teams map where query results, logs, telemetry and cached data sit, then test whether the deployment matches what the team approved.

How we scope

  • Engagements are fixed-scope, with the systems, data paths and questions agreed in writing before work starts.
  • We confirm which hosting option, client and database the review covers, such as local, a container or Azure.
  • The written scope lists which log sinks, caching settings and model endpoints are in or out of the review.

How we build

  • We deploy the server in your infrastructure with the configuration file and role settings your team approves.
  • We configure level 1 and level 2 caching per entity so cached query results follow your retention rules.
  • We test whether the configured log destinations, OpenTelemetry traces and local file logs hold only the data you expect.

How we hand over

  • You receive a findings report that maps each data flow to its location, with fixes and a retest.
  • Documentation covers the data privacy controls, the logging and cache settings, and the model option chosen for review.
  • Evidence is organized so your security, privacy and compliance teams can review it without relying on our summary alone.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, for example after a server version change.
  • We can retest after configuration changes, such as a new entity, a new Ollama endpoint or a different log sink.
  • Confirm with your vendors and auditors which retention and certification statements apply to the model service you use.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.