What happened?
Context
I'm building an NPM package that exposes multiple enterprise SQL Server databases through a single MCP (Model Context Protocol) server using Data API Builder (DAB). The goal is to allow AI agents like GitHub Copilot to query hundreds of tables across multiple databases dynamically without manually mapping each table.
I'm using:
- DAB 2.0.9 with multi-source configuration
- autoentities pattern (
%.%) to discover all tables in all schemas at runtime
- MCP stdio mode to expose database entities as MCP tools
The Bug
When using multi-source configuration with multiple child configs containing autoentities, DAB successfully starts and loads all entities during initialization, but the MCP describe_entities tool returns NoEntitiesConfigured error.
What Works ✅
- Single database with
autoentities + MCP works perfectly
- Each child config tested individually returns hundreds of entities via
describe_entities
- Multi-source with parent + 1 child works
dab validate shows entities are discovered correctly for all configs
What Fails ❌
- Multi-source with parent + 2 or more children:
describe_entities returns no entities
- The error message:
"No entities are configured in the runtime configuration."
- This happens despite DAB logging "Successfully completed runtime initialization"
Steps to Reproduce
1. Create parent config (dab-config.json):
{
"data-source": {
"database-type": "mssql",
"connection-string": "@env('DATABASE1_CONNSTRING')"
},
"data-source-files": [
"databases/database1/dab-config.json",
"databases/database2/dab-config.json",
"databases/database3/dab-config.json"
],
"runtime": {
"rest": { "enabled": false },
"graphql": { "enabled": false },
"mcp": {
"enabled": true,
"dml-tools": {
"describe-entities": true,
"read-records": true,
"aggregate-records": true
}
},
"host": { "mode": "production" }
},
"entities": {}
}
2. Create child config (databases/database1/dab-config.json):
{
"$schema": "https://github.com/Azure/data-api-builder/releases/latest/download/dab.draft.schema.json",
"data-source": {
"database-type": "mssql",
"connection-string": "@env('DATABASE1_CONNSTRING')"
},
"autoentities": {
"db1": {
"patterns": {
"include": ["%.%"],
"exclude": [],
"name": "db1_{schema}_{object}"
},
"template": {
"rest": { "enabled": false },
"graphql": { "enabled": false },
"mcp": { "dml-tools": true }
},
"permissions": [
{ "role": "anonymous", "actions": [{ "action": "read" }] }
]
}
}
}
3. Start DAB:
dab start --mcp-stdio --config dab-config.json --verbose
Output:
info: Azure.DataApiBuilder.Service.Startup[0]
Successfully completed runtime initialization.
4. Send MCP initialize request:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}
Response: ✅ Success
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true},"logging":{}},"serverInfo":{"name":"SQL MCP Server","version":"2.0.9"}}}
5. Call describe_entities:
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"describe_entities","arguments":{"nameOnly":true}}}
Response: ❌ Error
{
"toolName": "describe_entities",
"status": "error",
"error": {
"type": "NoEntitiesConfigured",
"message": "No entities are configured in the runtime configuration."
}
}
Expected Behavior
describe_entities should return all entities discovered from child configs via autoentities, with prefixes like:
db1_schema_table
db2_schema_table
db3_schema_table
Actual Behavior
NoEntitiesConfigured error is returned, despite:
- All configs loading successfully
- Entities being discovered during validation (
dab validate shows hundreds of entities)
- Startup completing without errors
Analysis
The bug appears to be in DAB's config merging logic for multi-source mode. When merging parent + multiple children:
- autoentities successfully discover entities in each child config
- DAB starts and reports successful initialization
- But the merged runtime configuration exposed to MCP contains no entities
- MCP's
describe_entities tool sees an empty entity list
Single child works because no complex merging is needed. Multiple children fail because autoentities from children don't propagate to the merged runtime configuration that MCP queries.
Environment
- DAB Version: 2.0.9
- Database: SQL Server 2022 (RTM-CU13-GDR)
- OS: Windows
- Node.js: v25.6.0
- MCP Inspector: v0.22.0
Workaround
Run separate DAB instances per database instead of using multi-source, and configure multiple MCP servers in the consumer.
Impact
This prevents using DAB's multi-source feature with autoentities in MCP mode, requiring manual entity mapping or separate server instances per database.
Version
2.0.9
What database are you using?
Azure SQL
What hosting model are you using?
No response
Which API approach are you accessing DAB through?
No response
Relevant log output
info: Azure.DataApiBuilder.Service.Startup[0]
Successfully completed runtime initialization.
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true},"logging":{}},"serverInfo":{"name":"SQL MCP Server","version":"2.0.9"}}}
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"describe_entities","arguments":{"nameOnly":true}}}
{"jsonrpc":"2.0","id":2,"result":{"content":[{"Type":"text","text":"{\r\n \u0022toolName\u0022: \u0022describe_entities\u0022,\r\n \u0022status\u0022: \u0022error\u0022,\r\n \u0022error\u0022: {\r\n \u0022type\u0022: \u0022NoEntitiesConfigured\u0022,\r\n \u0022message\u0022: \u0022No entities are configured in the runtime configuration.\u0022\r\n }\r\n}","type":"text"}],"isError":true}}
Code of Conduct
What happened?
Context
I'm building an NPM package that exposes multiple enterprise SQL Server databases through a single MCP (Model Context Protocol) server using Data API Builder (DAB). The goal is to allow AI agents like GitHub Copilot to query hundreds of tables across multiple databases dynamically without manually mapping each table.
I'm using:
%.%) to discover all tables in all schemas at runtimeThe Bug
When using multi-source configuration with multiple child configs containing
autoentities, DAB successfully starts and loads all entities during initialization, but the MCPdescribe_entitiestool returnsNoEntitiesConfigurederror.What Works ✅
autoentities+ MCP works perfectlydescribe_entitiesdab validateshows entities are discovered correctly for all configsWhat Fails ❌
describe_entitiesreturns no entities"No entities are configured in the runtime configuration."Steps to Reproduce
1. Create parent config (
dab-config.json):{ "data-source": { "database-type": "mssql", "connection-string": "@env('DATABASE1_CONNSTRING')" }, "data-source-files": [ "databases/database1/dab-config.json", "databases/database2/dab-config.json", "databases/database3/dab-config.json" ], "runtime": { "rest": { "enabled": false }, "graphql": { "enabled": false }, "mcp": { "enabled": true, "dml-tools": { "describe-entities": true, "read-records": true, "aggregate-records": true } }, "host": { "mode": "production" } }, "entities": {} }2. Create child config (
databases/database1/dab-config.json):{ "$schema": "https://github.com/Azure/data-api-builder/releases/latest/download/dab.draft.schema.json", "data-source": { "database-type": "mssql", "connection-string": "@env('DATABASE1_CONNSTRING')" }, "autoentities": { "db1": { "patterns": { "include": ["%.%"], "exclude": [], "name": "db1_{schema}_{object}" }, "template": { "rest": { "enabled": false }, "graphql": { "enabled": false }, "mcp": { "dml-tools": true } }, "permissions": [ { "role": "anonymous", "actions": [{ "action": "read" }] } ] } } }3. Start DAB:
Output:
4. Send MCP initialize request:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}Response: ✅ Success
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true},"logging":{}},"serverInfo":{"name":"SQL MCP Server","version":"2.0.9"}}}5. Call describe_entities:
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"describe_entities","arguments":{"nameOnly":true}}}Response: ❌ Error
{ "toolName": "describe_entities", "status": "error", "error": { "type": "NoEntitiesConfigured", "message": "No entities are configured in the runtime configuration." } }Expected Behavior
describe_entitiesshould return all entities discovered from child configs viaautoentities, with prefixes like:db1_schema_tabledb2_schema_tabledb3_schema_tableActual Behavior
NoEntitiesConfigurederror is returned, despite:dab validateshows hundreds of entities)Analysis
The bug appears to be in DAB's config merging logic for multi-source mode. When merging parent + multiple children:
describe_entitiestool sees an empty entity listSingle child works because no complex merging is needed. Multiple children fail because autoentities from children don't propagate to the merged runtime configuration that MCP queries.
Environment
Workaround
Run separate DAB instances per database instead of using multi-source, and configure multiple MCP servers in the consumer.
Impact
This prevents using DAB's multi-source feature with autoentities in MCP mode, requiring manual entity mapping or separate server instances per database.
Version
2.0.9
What database are you using?
Azure SQL
What hosting model are you using?
No response
Which API approach are you accessing DAB through?
No response
Relevant log output
Code of Conduct