Commit a2f779c
Adding MCP capability in DAB (#2868)
## Why make this change?
- The linked issue proposes integrating an MCP (Model Context Protocol)
server so AI/agent tooling (e.g., VS Code / Copilot–style agents) can
introspect the configured data model and perform safe, structured
operations against DAB-managed data sources.
- This enables richer developer tooling, lowers friction for exploratory
data access, and creates a foundation for future AI-assisted authoring
and governance scenarios.
## What is this change?
### Introduces an MCP service layer that exposes:
Schema / entity metadata derived from the existing DAB configuration
(tables, stored procedures, relationships, GraphQL entity projections).
Operation capabilities (read / create / update / delete) aligned with
DAB authorization rules.
A capability negotiation / handshake endpoint so MCP clients can
discover features.
MCP endpoint can be accessed with `/mcp`
Sample request to discover tools-
```
POST: http://localhost:5000/mcp
{
"jsonrpc": "2.0",
"id": "1",
"method": "tools/list"
}
```
## How was this tested?
The working of the MCP endpoint and the describe-entities tool is tested
manually in the local environment.
- Enable MCP in dab-config.json
`"mcp": {
"enabled": true,
"path": "/mcp",
"dml-tools": {
"describe-entities": true
}
}`
- The server was started locally and confirmed to be listening on
`http://localhost:5000`.
- Send a POST request to the MCP endpoint, `http://localhost:5000/mcp`
- Use the Sample Requests shared for the body of the request.
- The tools/list request successfully returned all registered tools,
confirming that the MCP server and tool registry were initialized
correctly.
- The tools/call request for describe-entities returned the expected
entity metadata.
## Sample Request(s)
1. Listing all tools available.
`{
"jsonrpc": "2.0",
"id": "1",
"method": "tools/list",
"params": {}
}`
2. Use the describe-entities tool
`{
"jsonrpc": "2.0",
"id": "1",
"method": "tools/call",
"params": {
"name": "describe-entities"
}
}`
---------
Co-authored-by: Jerry Nixon <[email protected]>
Co-authored-by: Rahul Nishant <[email protected]>
Co-authored-by: RubenCerna2079 <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Aniruddh Munde <[email protected]>
Co-authored-by: Ruben Cerna <[email protected]>
Co-authored-by: Anusha Kolan <[email protected]>1 parent 2834f70 commit a2f779c
106 files changed
Lines changed: 1970 additions & 127 deletions
File tree
- schemas
- src
- Azure.DataApiBuilder.Mcp
- BuiltInTools
- Core
- Model
- Cli.Tests
- Snapshots
- Cli
- Commands
- Config
- Converters
- ObjectModel
- Core
- Configurations
- Services
- Service.Tests
- Authentication/Helpers
- Authorization
- Caching
- Configuration
- HotReload
- Telemetry
- CosmosTests
- GraphQLBuilder
- Snapshots
- SqlTests
- GraphQLQueryTests
- UnitTests
- Service
- HealthCheck
- Model
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
242 | 303 | | |
243 | 304 | | |
244 | 305 | | |
245 | 306 | | |
246 | 307 | | |
247 | 308 | | |
248 | | - | |
| 309 | + | |
249 | 310 | | |
250 | 311 | | |
251 | 312 | | |
252 | 313 | | |
253 | 314 | | |
254 | 315 | | |
255 | 316 | | |
256 | | - | |
| 317 | + | |
257 | 318 | | |
258 | | - | |
| 319 | + | |
259 | 320 | | |
260 | 321 | | |
261 | | - | |
| 322 | + | |
262 | 323 | | |
263 | 324 | | |
264 | 325 | | |
| |||
278 | 339 | | |
279 | 340 | | |
280 | 341 | | |
281 | | - | |
| 342 | + | |
282 | 343 | | |
283 | 344 | | |
284 | 345 | | |
| |||
322 | 383 | | |
323 | 384 | | |
324 | 385 | | |
325 | | - | |
| 386 | + | |
326 | 387 | | |
327 | 388 | | |
328 | 389 | | |
| |||
338 | 399 | | |
339 | 400 | | |
340 | 401 | | |
341 | | - | |
| 402 | + | |
342 | 403 | | |
343 | | - | |
| 404 | + | |
344 | 405 | | |
345 | 406 | | |
346 | 407 | | |
| |||
382 | 443 | | |
383 | 444 | | |
384 | 445 | | |
385 | | - | |
| 446 | + | |
386 | 447 | | |
387 | 448 | | |
388 | 449 | | |
| |||
405 | 466 | | |
406 | 467 | | |
407 | 468 | | |
408 | | - | |
| 469 | + | |
409 | 470 | | |
410 | 471 | | |
411 | 472 | | |
412 | 473 | | |
413 | 474 | | |
414 | 475 | | |
415 | 476 | | |
416 | | - | |
| 477 | + | |
417 | 478 | | |
418 | 479 | | |
419 | 480 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 87 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
Lines changed: 83 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
0 commit comments