Can SQL MCP Server limit what an AI agent reads and changes?
Yes, the server supports limits on the data surface built in through roles, entity permissions and tool toggles. No separate paid edition is documented in the facts available for this page, so the real work is designing the configuration: which objects the agent can reach, which operations each role may perform and which tools stay switched on. Sign-in is outside the scope of this page and is covered in the sibling pages on OAuth and enterprise setup and on data privacy. The open-source server is self hosted and carries an MIT license with a Microsoft Corporation copyright notice, so your organization decides where it runs and, through its dab-config.json file, exactly what it exposes.
The configuration file defines the database connection and lists each table, view or stored procedure the server exposes, along with the permissions on each object. Every tool respects role-based access control and entity permissions, and an agent's role decides which entities, operations and fields it sees and whether row-level policies apply. Tool availability is controlled at two levels: a tool disabled under runtime.mcp.dml-tools is hidden from list_tools and cannot be invoked, while an entity can set mcp.dml-tools to false to exclude its tools. A tool is available only when it is enabled globally and the entity allows it. Review the custom-tool setting on stored procedures with particular care, because setting it to true registers the procedure as a named MCP tool and widens what agents can call.
Before rollout, confirm the exact tool set on the DAB version you will run, since the DML tools page lists seven tools for DAB 2.0 and later, while aggregate_records is not available in DAB 1.7.x. Start with read-only entities, disable delete_record and update_record globally unless a use case needs them, and test each role against a non-production database. Also add clear field names and descriptions to entity metadata, because agents see only entity names and may guess column names when that metadata is missing. Ask your Microsoft or partner contact to confirm current behavior in the SQL MCP Server documentation before you write the policy.
Data surface controls by version and option
This table compares the data surface controls in DAB 1.7.x and DAB 2.0 and later, with a status for each. Read the status column first: built in means the control applies without extra setup, needs configuration means you must set it in dab-config.json before it limits anything, and not available means that version lacks it. The main takeaway is that DAB 2.0 enables all seven DML tools by default, so access stays broad until you narrow it.
| Control | DAB 1.7.x | DAB 2.0 and later | Status |
|---|---|---|---|
| Role-based access | Confirm enforcement in your version's documentation | Every DML tool checks the agent's role before running | Built in |
| Entity permissions | Confirm in your version's documentation | Set per entity in the config file; they control operations and fields the agent sees | Needs configuration |
| Row-level policies | Confirm in your version's documentation | Apply through the agent's role and decide which rows the agent can see | Needs configuration |
| Per-tool toggles at runtime | Confirm in your version's documentation | Set under runtime.mcp.dml-tools; disabled tools are hidden and cannot be invoked | Needs configuration |
| Per-entity DML tool exclusion | Confirm in your version's documentation | Setting mcp dml-tools to false on an entity removes its tools from that entity | Needs configuration |
| Custom stored procedure tools | Confirm in your version's documentation | Setting custom-tool to true publishes a procedure as a named tool, widening agent reach | Needs configuration |
| aggregate_records tool | Not available; agents must read all matching rows to count or aggregate | Enabled by default as one of the seven DML tools | Not available on 1.7.x |
| Schema changes | Not supported; the server is built for DML only | Not supported; the tools do not change table or view structure | Not available |
How roles, entities and tool toggles stack
The dab-config.json file is where access is decided. It defines the database connection, lists which tables, views or stored procedures the server exposes, and sets permissions on each object. Anything not listed in that file is not reachable through the server, so the first review step is to read the entity list line by line and confirm that every entry is needed for the agent's job. Ask the team that owns the configuration to explain each exposed object and the operations it allows, and keep that file under change control like any other access policy.
Every DML tool respects role-based access control, entity permissions and policies. The agent's role determines which entities it can see, which operations it can perform and which fields it receives, and it determines whether row-level policies apply to its queries. Reviewers should test this with the actual role the agent will use, not an administrator role, and confirm that a restricted role gets back only the fields and rows it should. Field-level exclusions matter here because an agent that cannot see a column cannot return it in a result.
A tool is available only when it is enabled globally under runtime.mcp.dml-tools and the entity allows DML tools. An entity can set mcp.dml-tools to false to exclude it, but per-tool toggles exist only at the global runtime level, so a team cannot switch off, for example, delete_record for one table while leaving it on for another. Because the server is built around DML rather than DDL, schema changes such as creating or altering tables are not an agent capability. Confirm this on the version in use, since the DML tools page and the overview describe the scope, and keep schema work with administrators outside the agent path.
Which tools carry the most risk
SQL MCP Server exposes DML tools that an agent can call against the entities you define in dab-config.json. The tools differ in how much damage a single call can do, so the controls that matter most are the global toggles under runtime.mcp.dml-tools, the per-entity dml-tools setting, and the role permissions that decide what each tool can reach.
Delete record and data loss
The delete_record tool removes rows from an entity the agent's role can reach, and a single call can remove data that is hard to restore without a backup. Microsoft's documentation gives preventing data loss as the reason to disable it at runtime, so a reader should confirm first whether any team needs deletes through an agent at all. Check that the runtime setting under runtime.mcp.dml-tools is switched off for delete-record, and confirm the tool is absent from list_tools in a test client.
DML tools docsCreate and update writes
The create_record and update_record tools change data in place, so an agent can alter rows it was never meant to touch if a role grants write access too broadly. Review each writable entity and ask whether the agent needs to insert or modify it, then set mcp dml-tools to false on entities that are read-only for agents. For reporting use cases, disabling create-record at runtime keeps the server in read-only mode for those clients.
Execute entity and custom stored procedures
The execute_entity tool runs stored procedures, and setting custom-tool to true on a stored procedure entity registers that procedure as a named MCP tool. Microsoft's overview says this widens what agents can call, so each registered procedure needs its own review of what it changes. Confirm which procedures carry custom-tool set to true, and set mcp dml-tools to false on any entity or procedure that does not need to be callable by an agent.
SQL MCP overviewAggregate records and version dependence
The aggregate_records tool is listed for DAB 2.0 and later and is not available in DAB 1.7.x. On 1.7.x, an agent that needs a count or total has to read every matching row, which can expose more data to the model than the question requires. Confirm the DAB version in use before relying on aggregation for scoping, and use the 2.0 line for current capabilities as Microsoft recommends.
Read records and sensitive columns
The read_records tool returns rows and fields from every entity the role can see, so it is the main path for exposing personal, financial or credential data to an agent. Microsoft states that the role decides which entities, operations and fields are visible and whether row-level policies apply. Review the field lists and policies for each role, exclude sensitive columns from the entity definition, and test read results with the exact role the agent will use.
How the answer changes by situation
A reporting agent needs to answer questions, not change data. The safest starting point is a configuration where only read tools are reachable and the exposed objects are shaped for reporting. Because the DML tools are all enabled by default in DAB 2.0 and later, the write tools must be turned off on purpose.
- Disable write tools globally: Set the write tools to disabled under
runtime.mcp.dml-tools. A disabled tool is hidden from list_tools and cannot be invoked. - Expose reporting views: Map views or narrow entities in
dab-config.jsoninstead of base transactional tables, so the agent sees a curated shape. - Review execute_entity: Stored procedures run through this tool. Confirm that every exposed procedure only reads before leaving it enabled.
- Use DAB 2.0 for counts: aggregate_records is available in 2.0 and later, so reporting questions can be answered without pulling every matching row.
Confirm by connecting a test client and checking that list_tools shows only the read tools you intended.
Some operations teams need an agent that creates or updates records. In that case, writes should be a deliberate grant to named entities, not a side effect of a global switch. The DML tools respect entity permissions, policies and the agent's role, so the role design carries most of the control.
- Enable writes per entity: Keep the global toggles on only where needed, then set the entity's DML tools flag to false on any entity that should stay read-only.
- Scope fields and rows by role: The agent's role decides which fields it sees, which operations it may use and whether row-level policies apply. Create a role per team and test each one.
- Turn off delete_record unless required: Microsoft's guidance cites disabling delete-record to prevent data loss. Keep it off for most operational agents.
- Review custom-tool on procedures: Setting custom-tool to true registers a stored procedure as a named MCP tool, which widens what agents can call.
Confirm that a least-privilege test role receives an error on every write outside its permissions before any team gets write access.
SQL MCP Server is included in Data API builder starting in version 1.7, but Microsoft's overview recommends the latest 2.0 release for current capabilities and bug fixes. Teams still on 1.7.x should treat the version as a control in its own right, because the tool set and the cost of answering questions both change.
- No aggregate_records: This tool is not available in 1.7.x, so agents must read all matching rows to count or aggregate. That increases the rows returned and the data the agent sees.
- Confirm the tool list: The DML tools page lists seven tools for 2.0 and later. Check the tools your binary actually reports before writing permission rules against them.
- Narrow the exposed surface: Because counting pulls full result sets, limit entities and fields more tightly on 1.7.x than on 2.0.
- Plan the upgrade: Test the same dab-config.json on 2.0 in a non-production environment and review the permission results before moving production traffic.
Confirm the exact version in each running environment, since a server may be upgraded in one place and not another.
When tables hold personal, health or financial fields, the agent should never be able to see columns its role does not need. The DML tools enforce entity permissions and policies, but the configuration and the agent's behavior both matter. Agents see entity names and may guess column names when field metadata and descriptions are missing, so explicit exposure rules are the main control.
- List fields explicitly: Expose only the columns each role needs. Do not depend on the agent declining to ask for sensitive fields.
- Confirm row-level policies: Check that the policy applies for each agent role, since the role decides whether row-level policies apply.
- Write precise metadata: Complete field descriptions reduce guessing, and guessing against sensitive names is a form of probing that should be tested.
- Keep sensitive procedures out: Leave custom-tool off for any procedure that touches regulated data, and register only reviewed procedures.
Have your compliance and privacy owners review the configuration and run the sensitive-data role through its test cases, since this server does not make your regulatory obligations shift to Microsoft.
Microsoft describes SQL MCP Server as self hosted, and it can also run locally through the DAB command line. The client controls where it runs, so an on-premises or air-gapped deployment is a hosting decision you make and must document. The server supports two transports, streamable HTTP for standard hosting and stdio for local or CLI use.
- Choose the transport: Use stdio for local or CLI use and streamable HTTP for standard hosting. Confirm which transport your MCP client supports.
- Keep the path inside the boundary: Confirm that the server, the database connection and the MCP client all sit inside the network boundary with no outbound dependency your policy forbids.
- Stage packages and tooling offline: Confirm how DAB, its dependencies and any schema tools reach the environment without internet access. Microsoft suggests the MSSQL extension for Visual Studio Code for schema changes during local development, which needs its own review.
- Check protocol support: The server implements MCP protocol version 2025-06-18, so verify that every client in the environment speaks that version.
Confirm that the full setup runs with outbound network access blocked, and review the server's logging and telemetry behavior against Microsoft's current documentation before approval.
Order of work before production
This sequence takes the SQL MCP Server from an open question about which data an agent should touch to a configuration that a security reviewer can test and approve. Each step narrows the data surface and produces evidence you can check before the next one starts.
Inventory every object the agent could reach
The data owner and the database administrator list each table, view and stored procedure that the agent might need, along with the business reason for each. Anything that is not on the list stays out of dab-config.json. The step is done when the list is signed off by the data owner and matches the entities you plan to define in the configuration file. Confirm that the list excludes tables holding credentials, personal data or financial records unless a named owner has approved them.
Define read-only roles before anything else
Start with a role that has read permissions only on the approved entities, and bind the agent's identity to that role. Check that the entity permissions for create, update and delete are absent, not just unused. Review whether row-level policies and field restrictions apply to sensitive columns, because the agent's role decides which fields it sees. The step is complete when a test session under that role can read the approved entities and receives an error for every write attempt.
Add write roles only for named entities
Grant create, update or delete permissions only on specific entities that a named owner has justified in writing. Keep write roles separate from the read-only role so that a reviewer can see exactly which objects accept changes. Confirm that each write-enabled entity has a documented reason, a known set of permitted operations and a field list. The step is done when a permission review shows no write access on any entity without a recorded owner and purpose.
Disable DML tools the use case does not need
Turn off the tools that the agent does not need at the global runtime level, under runtime.mcp.dml-tools, and set mcp dml-tools to false on entities that should never be reached through MCP. Remember that a tool is available only when it is enabled globally and the entity allows it, so check both layers. For a read-only reporting agent, delete and create tools are usually the first to disable. Verify the result by listing the tools the client receives, since disabled tools are hidden from list_tools and cannot be invoked.
Review every custom-tool stored procedure
Find each stored procedure where custom-tool is set to true, since that setting registers the procedure as a named MCP tool and widens what agents can call. For each one, the database owner reviews what the procedure writes, which parameters it accepts and whether it runs under a privilege the agent role should not hold. Remove the custom-tool setting from any procedure without a documented purpose. The step is complete when the review record lists every registered procedure, its owner and its decision.
Test prompt injection and over-fetch before approval
Run a test session, ideally in a non-production copy of the database, with prompts that try to make the agent read tables outside its role, change records it should only read, or return far more rows than the task needs. Include a case where a retrieved record contains instructions aimed at the agent. Record which calls succeed, which fail and whether the returned fields match the role. Because agents may guess column names when metadata and descriptions are missing, also check that entity descriptions are accurate. Approval should wait until every failed case is fixed and retested.
Decision path for each entity
A tool call starts at the server and first meets the global runtime toggle under runtime.mcp.dml-tools. A tool disabled there is hidden from list_tools and cannot be invoked. Next, the entity's own mcp.dml-tools setting decides whether that tool is available for this object at all. Only then are the agent's role, entity permissions and row-level policies applied, deciding which operations, fields and rows it sees. A request that passes every check runs as T-SQL; anything else is refused.
Each check must pass in order before the server generates and runs T-SQL.
What a security reviewer asks to see
This table lists the artifacts a reviewer should request from the team running SQL MCP Server, what each one proves about the data surface, and where it comes from in the configuration file or runtime. Use it as a request list before approving a rollout, and treat any item the team cannot produce as an open finding.
| Evidence item | What it proves | Where it comes from |
|---|---|---|
| Exposed entity list | Which tables, views and stored procedures the agent can reach at all | Entities section of the dab-config.json file, compared against the database schema |
| Role permission matrix | Which operations, fields and row policies each agent role receives | Permissions and policies defined per entity in dab-config.json, with the role each agent uses |
| Runtime tool toggles | Which of the seven DML tools are globally enabled, and which are hidden from list_tools | The runtime.mcp.dml-tools setting in dab-config.json and the list_tools response from a running server |
| Entity dml-tools settings | Whether any entity excludes DML tools or re-enables them against the global setting | The mcp dml-tools value on each entity in dab-config.json |
| Custom-tool procedure list | Which stored procedures are registered as named MCP tools, and so callable by agents | Entities with custom-tool set to true in dab-config.json, reviewed against the procedure's own logic |
| DAB version | Whether aggregate_records exists, and whether the build is current with Microsoft's recommended 2.0 release | Version reported by the Data API builder binary or container image in use, compared against the Microsoft Learn overview |
| Database account privileges | What the connection can change, regardless of what the config allows | Permissions granted to the SQL login or Entra identity in the database, checked with the database's own role and grant queries |
| Retest results | Whether the agent still stays inside the approved surface after config or version changes | A dated test run against the live endpoint, covering denied writes, hidden tools and blocked entities, with results recorded |
Questions buyers ask before approving SQL MCP Server
Does SQL MCP Server need a paid Microsoft edition or license?
The Microsoft documentation supplied for this page describes no paid tier, so the server should be treated as free to obtain until Microsoft confirms otherwise. The source is open source under the MIT license with a Microsoft Corporation copyright notice. Your real cost comes from the infrastructure you host it on, the database licenses you already run, and any Azure services such as Azure Container Apps or Azure App Service. Ask Microsoft in writing whether any current release or hosting option carries a charge, and ask your Azure account team which hosting costs apply to your subscription.
Can an AI agent change the database schema through SQL MCP Server?
No. Microsoft states that the server does not support schema changes through its tools and is built around data manipulation (DML), not data definition (DDL). Agents can create, read, update and delete records, and they can run stored procedures that you expose, but they cannot alter tables or other schema objects through the server. For schema work during local development, Microsoft points to the MSSQL extension for Visual Studio Code, which is a separate process owned by your engineers. Still, a stored procedure that performs DDL inside the database would be a write path you control, so review what each procedure does before exposing it.
What makes the effort of a SQL MCP Server rollout grow or shrink?
Effort rises with the number of entities you expose, the number of write paths (create, update and delete tools on each entity), and the number of stored procedures registered as named tools. Each object needs its own permissions and field list, and each stored procedure needs a review of what it changes. Effort falls when you start with a small set of read-only views, keep write tools disabled until a review passes, and document field descriptions so agents do not guess column names. Ask any vendor or partner for a quote that lists each entity, each enabled tool, each procedure and the test cases for each, since those items set the scope.
Can our own team set up SQL MCP Server without outside help?
A team with SQL Server and configuration experience can set up a read-only pilot on its own, using a single entity with read access and the global DML tool settings turned down to the tools it needs. Write access is where a second reviewer adds value. Before enabling create, update, delete or custom procedure tools, have someone other than the author check the entity permissions, role mappings and row-level policies, and test that an agent role cannot see or change data it should not. Confirm the exact behavior in your environment with a test database, since the server's permission model depends on your roles and policies.
How should we keep the SQL MCP Server configuration file secure over time?
Treat the dab-config.json file as a security control. Store it in version control, require review for every change to entities, permissions, runtime.mcp.dml-tools settings and custom-tool flags, and deploy it only from the reviewed branch. Keep connection secrets out of the file and in your secret store. After each change, rerun a set of tests that checks which tools appear in list_tools, that disabled tools cannot be invoked, and that each role sees only its permitted entities and fields. Record the server version you tested, and retest when you upgrade, since Microsoft recommends the latest 2.0 release for current capabilities and bug fixes.
What does a DeployOpen security review of SQL MCP Server cover?
DeployOpen runs AI agent rollout security reviews. For SQL MCP Server, that means testing the data surface: which entities and stored procedures an agent role can reach, whether disabled tools stay hidden and uninvokable, whether row-level policies and field permissions hold, and how prompt injection could push an agent toward a risky write. The review also checks the configuration file, the custom-tool settings and how credentials are handled. The output is a findings report with fixes and a retest. The scope, deliverables and timeline are agreed in writing before work starts, and DeployOpen does not publish a price list, so a quote follows from that written scope.
How DeployOpen reviews the SQL MCP Server data surface
DeployOpen reviews the SQL MCP Server data surface as part of a fixed-scope engagement, starting from the agreed written scope. We test what an agent can read and change in your SQL Server or Azure SQL environment, then deliver findings, fixes and a retest.
How we scope
- Inventory every entity in dab-config.json and record which tables, views and stored procedures are exposed.
- Map each agent role to its entity permissions, operations and fields, and flag any role that is broader than its use case.
- Confirm the Data API builder version in use, since aggregate_records is not available in DAB 1.7.x.
- Agree in writing which runtime tool toggles, entity-level exclusions and custom-tool registrations are in scope.
How we build
- Test the server against the seven DML tools, checking whether delete and update paths respect entity permissions and row-level policies.
- Review every stored procedure exposed with custom-tool enabled, and confirm it cannot change data beyond its intended purpose.
- Check that field metadata and descriptions are complete, so agents do not guess column names and return unreliable results.
- Run prompt injection and over-permission tests against the agent to see whether it can reach objects outside its role.
How we hand over
- Deliver a findings report that ranks each exposed tool and entity by risk, with the configuration line that causes it.
- Provide suggested dab-config.json changes, such as disabling tools globally or excluding entities, with reasons for each.
- Document the configuration baseline so your security and platform teams can review it and repeat the checks.
- Retest after fixes are applied and record the results in the same report format as the original review.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer when your agent configuration changes.
- Re-review the data surface after Data API builder upgrades or new entities, stored procedures or roles are added.
- Prepare evidence for your security questionnaires and compliance reviews, while independent auditors issue any formal assessment.
- Confirm with your team which environments, hosts and identity settings are covered before the engagement starts.

