/ Directory / Playground / Azure Data API Builder (MCP)
● Official Azure 🔑 Needs your key

Azure Data API Builder (MCP)

by Azure · Azure/data-api-builder

Microsoft's official open-source tool that turns Azure SQL, Cosmos DB, Postgres, or MySQL into REST + GraphQL + MCP endpoints — config file, no code.

Data API Builder (DAB) is the Azure-supported way to put your relational or NoSQL store behind well-known protocols, including MCP. You write a JSON config that lists entities, relationships, and policies; DAB starts a process that exposes them as REST, GraphQL, and (since 2026) MCP tools. It supports Azure SQL, SQL Server, Cosmos DB (NoSQL + PostgreSQL), Postgres, MySQL, and Azure Data Lake. Auth via Static Web Apps, Easy Auth, or JWT.

Why use it

Key features

Live Demo

What it looks like in practice

azure-data-api-builder-mcp.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "azure-data-api-builder-mcp": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "${PWD}/dab-config.json:/App/dab-config.json:ro",
        "-e",
        "DAB_ENVIRONMENT=Production",
        "mcr.microsoft.com/azure-databases/data-api-builder:latest",
        "--ConfigFileName",
        "/App/dab-config.json"
      ]
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "azure-data-api-builder-mcp": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "${PWD}/dab-config.json:/App/dab-config.json:ro",
        "-e",
        "DAB_ENVIRONMENT=Production",
        "mcr.microsoft.com/azure-databases/data-api-builder:latest",
        "--ConfigFileName",
        "/App/dab-config.json"
      ]
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "azure-data-api-builder-mcp": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "${PWD}/dab-config.json:/App/dab-config.json:ro",
        "-e",
        "DAB_ENVIRONMENT=Production",
        "mcr.microsoft.com/azure-databases/data-api-builder:latest",
        "--ConfigFileName",
        "/App/dab-config.json"
      ]
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "azure-data-api-builder-mcp": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "${PWD}/dab-config.json:/App/dab-config.json:ro",
        "-e",
        "DAB_ENVIRONMENT=Production",
        "mcr.microsoft.com/azure-databases/data-api-builder:latest",
        "--ConfigFileName",
        "/App/dab-config.json"
      ]
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "azure-data-api-builder-mcp",
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "${PWD}/dab-config.json:/App/dab-config.json:ro",
        "-e",
        "DAB_ENVIRONMENT=Production",
        "mcr.microsoft.com/azure-databases/data-api-builder:latest",
        "--ConfigFileName",
        "/App/dab-config.json"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "azure-data-api-builder-mcp": {
      "command": {
        "path": "docker",
        "args": [
          "run",
          "--rm",
          "-i",
          "-v",
          "${PWD}/dab-config.json:/App/dab-config.json:ro",
          "-e",
          "DAB_ENVIRONMENT=Production",
          "mcr.microsoft.com/azure-databases/data-api-builder:latest",
          "--ConfigFileName",
          "/App/dab-config.json"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add azure-data-api-builder-mcp -- docker run --rm -i -v ${PWD}/dab-config.json:/App/dab-config.json:ro -e DAB_ENVIRONMENT=Production mcr.microsoft.com/azure-databases/data-api-builder:latest --ConfigFileName /App/dab-config.json

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use Azure Data API Builder (MCP)

Expose an Azure SQL database to Claude with role-based access

👤 Azure-shop teams; analysts who need to query, not just dump ⏱ ~30 min intermediate

When to use: You have an internal Azure SQL DB and want the AI agent to read it with strict per-table permissions, not god-mode admin.

Prerequisites
  • Azure SQL connection string — From Azure Portal → SQL DB → Connection strings
  • Docker installed locally — Docker Desktop or any OCI runtime
Flow
  1. Generate dab-config.json
    Create a DAB config that exposes the Customers and Orders tables read-only over MCP. Connect to my Azure SQL via env var DAB_CONN.✓ Copied
    → dab-config.json written with both entities and actions: ["read"]
  2. Run locally
    Spin up DAB locally via Docker on port 5000 and verify the MCP endpoint responds.✓ Copied
    → GET /api/Customers returns rows; MCP tool list shows entities
  3. Hook into Claude
    Add the local DAB MCP to my Claude config and ask: 'Top 10 customers by orders in 2026.'✓ Copied
    → Claude returns the result by composing read calls

Outcome: Claude can query the database within strict, configured boundaries, not via direct SQL.

Pitfalls
  • Azure SQL firewall blocks the local Docker IP — Allow your IP in Azure Portal → SQL Server → Networking, or run DAB inside Azure

Wrap Cosmos DB NoSQL behind a GraphQL+MCP layer

👤 Teams already on Cosmos who want LLM access without a custom API ⏱ ~40 min advanced

When to use: You have a Cosmos NoSQL container and need read/write access from Claude with field-level policies.

Prerequisites
  • Cosmos DB account + container — From Azure Portal — note the connection string and database/container names
Flow
  1. Configure entity
    Add an entity for Cosmos container products with a JSON schema mapped from the actual docs. Allow read+update; require role 'editor' for updates.✓ Copied
    → Updated dab-config.json with permissions block
  2. Set Easy Auth
    Add a JWT auth provider config with the issuer of my Entra tenant.✓ Copied
    → Authentication block added; DAB enforces it
  3. Verify policies
    Try a write as anonymous (should fail), then with editor token (should succeed).✓ Copied
    → 401 then 200 — proves policies enforced

Outcome: A safe Cosmos surface for Claude — reads open, writes gated.

Pitfalls
  • Cosmos schema is dynamic but DAB requires GraphQL types — Provide a GraphQL schema file; DAB falls back to REST if you don't

Expose a stored procedure as an MCP tool

👤 DBAs with hardened business logic in TSQL ⏱ ~25 min advanced

When to use: Existing stored procedures encode business rules and you'd rather expose those to Claude than direct table access.

Flow
  1. Define the entity
    In dab-config, add entity GetSalesByRegion of type stored-procedure pointing to dbo.usp_GetSalesByRegion. Map parameters to MCP tool inputs.✓ Copied
    → Stored proc shows up as a callable MCP tool
  2. Test
    Call GetSalesByRegion for region='APAC', period='2026Q1'.✓ Copied
    → Result rows returned

Outcome: Business logic stays in the DB, AI just calls it.

Pitfalls
  • Stored proc returns multiple result sets — DAB returns the first; refactor to a single set or split into multiple procs

Combinations

Pair with other MCPs for X10 leverage

azure-data-api-builder-mcp + filesystem

Persist dab-config.json and the generated GraphQL schema in your repo

Save dab-config.json and schema.graphql under /db/dab/.✓ Copied
azure-data-api-builder-mcp + github

Open a PR when DAB config changes

Diff against main; if changed, open PR titled 'DAB config update'.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
list_entities (none) Discover what's exposed free
<entity>.read filter?, top?, select?, orderby? Standard read; replace <entity> 1 DB query per call
<entity>.create fields object Only when permissions allow create 1 DB insert
<storedproc> configured params Encapsulated business logic 1 DB call

Cost & Limits

What this costs to run

API quota
Bound by your Azure DB tier
Tokens per call
100–2000 depending on rows returned
Monetary
DAB is free; you pay your DB cost. Local Docker has zero added cost.
Tip
Use top + select to keep result sets bounded so token costs stay predictable

Security

Permissions, secrets, blast radius

Minimum scopes: DB read role (e.g. db_datareader for read-only)
Credential storage: Connection string via env var or Azure Managed Identity (preferred in Azure)
Data egress: Stays within Azure if you deploy DAB in Azure
Never grant: db_owner DDL rights

Troubleshooting

Common errors and fixes

Login failed for user

Check connection string — DAB needs a SQL or Entra account that exists; firewall allows the host

Verify: Run `sqlcmd` from the same host with the same creds
Entity not found in MCP tool list

Restart DAB after editing dab-config.json — config is loaded once at startup

Verify: Check container logs for 'Entity X registered'
GraphQL types missing for Cosmos

Provide schema.graphql alongside dab-config.json or set GraphQL.Mode = REST-only

Alternatives

Azure Data API Builder (MCP) vs others

AlternativeWhen to use it insteadTradeoff
HasuraYou want a more polished GraphQL surface and don't need MCP yetHasura is broader but heavier; DAB is Azure-aligned and lighter
Direct Postgres MCP / Postgres MCP serverYou're not on Azure and just want raw Postgres accessPostgres MCP is simpler; DAB enforces per-entity/per-row policy

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills