Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
2898076
Just before logging
Aug 27, 2025
17e9728
Rearrange
Aug 28, 2025
6e1abe5
git should be ignored
Aug 28, 2025
26b40c1
Testing GQL Schema
Aug 28, 2025
a017772
broken but nice
Aug 28, 2025
e81dbeb
basic working
Aug 28, 2025
a1f3d75
Just before we format the schema
Aug 28, 2025
b4a4447
Working with LIST
Aug 28, 2025
123f5ca
PRE
Aug 28, 2025
ad64ad0
Working again
Aug 29, 2025
8d015c0
Updated health
Aug 29, 2025
db72d87
JSON based Dynamic tools configuration based
souvikghosh04 Sep 3, 2025
3948822
Tweaking tooling adding tests
Sep 8, 2025
04b19f9
Updated mege
Sep 8, 2025
66bba27
Revert "Updated mege"
souvikghosh04 Sep 9, 2025
ba6909f
Revert "Merge branch 'jerry-mcp-core' of https://github.com/Azure/dat…
souvikghosh04 Sep 9, 2025
ddca78b
DAB MCP Runtime (#2866)
souvikghosh04 Sep 9, 2025
5e06a6e
Delete dab_aci_deploy.ps1
souvikghosh04 Sep 9, 2025
6ef8a3a
Delete dab_aca_deploy.ps1
souvikghosh04 Sep 9, 2025
55e3e61
Backmerge
souvikghosh04 Sep 9, 2025
4cb06b0
Merge branch 'main' into jerry-mcp-core
RubenCerna2079 Sep 10, 2025
d63d999
Added mechanism to implement tools and configure them in generic way
souvikghosh04 Sep 10, 2025
deac452
Merge branch 'jerry-mcp-core' of https://github.com/Azure/data-api-bu…
souvikghosh04 Sep 10, 2025
046d04a
Auto registration of tools and refactoring
souvikghosh04 Sep 11, 2025
0796e32
Refactored unwanted files and logic
souvikghosh04 Sep 11, 2025
78baf4a
Refactoring and removed gitignore, installcredprovider.ps1
souvikghosh04 Sep 15, 2025
2362084
Refactoring file structures
souvikghosh04 Sep 15, 2025
c212bdd
Refactoring- files structures, unwanted changes
souvikghosh04 Sep 15, 2025
540a025
Fix test formatting errors
RubenCerna2079 Sep 11, 2025
07e5945
Fix formatting for tests part 2
RubenCerna2079 Sep 11, 2025
00916ed
Fix ConfigValidationUnitTests
RubenCerna2079 Sep 12, 2025
ae99b9a
Fix RuntimeConfigValidator tests
RubenCerna2079 Sep 17, 2025
78809e4
Backmerge, removed health check and schema logic due to errors
souvikghosh04 Sep 17, 2025
f093688
Merge branch 'jerry-mcp-core' of https://github.com/Azure/data-api-bu…
souvikghosh04 Sep 17, 2025
be77230
Add MCP Runtime serialization/deserialization and fix tests related t…
RubenCerna2079 Sep 19, 2025
9a70ac3
Fix MCP runtime config
souvikghosh04 Sep 19, 2025
68a7119
Revert "Add MCP Runtime serialization/deserialization and fix tests r…
souvikghosh04 Sep 19, 2025
89777bf
Fixed MCP runtime configs
souvikghosh04 Sep 19, 2025
6f3b494
Backmerge and fixes on MCP runtime config
souvikghosh04 Sep 19, 2025
590ddd9
Merge branch 'main' into jerry-mcp-core
souvikghosh04 Sep 19, 2025
c757d8e
PR reviews and fixes
souvikghosh04 Sep 19, 2025
416b5e4
Merge branch 'jerry-mcp-core' of https://github.com/Azure/data-api-bu…
souvikghosh04 Sep 19, 2025
9c7c95b
Fix CLI commands
RubenCerna2079 Sep 19, 2025
8985d5e
Fix formatting error
RubenCerna2079 Sep 19, 2025
395f765
[MCP] Clean up for Cli and Cli.Tests packages (#2879)
anushakolan Sep 22, 2025
fd5926f
rename -record to -entity
souvikghosh04 Sep 22, 2025
54ef980
Addressed some review comments
souvikghosh04 Sep 22, 2025
b139945
Update execute-entity and rest to -record
souvikghosh04 Sep 23, 2025
b71c382
set default true for all and write to JSON if user modified
souvikghosh04 Sep 23, 2025
2423646
rename execute-record to execute-entity
souvikghosh04 Sep 23, 2025
3f0cdd7
review comments- nits, null checks
souvikghosh04 Sep 24, 2025
4f18f6e
Update src/Azure.DataApiBuilder.Mcp/Core/McpServerConfiguration.cs
souvikghosh04 Sep 24, 2025
f71232a
use DEFAULT_PATH constant for mcp endpoint
souvikghosh04 Sep 24, 2025
95ff107
Merge branch 'jerry-mcp-core' of https://github.com/Azure/data-api-bu…
souvikghosh04 Sep 24, 2025
629d3fb
Fixed unit tests
souvikghosh04 Sep 24, 2025
b3040ad
fix formatting
souvikghosh04 Sep 24, 2025
b623589
Fix the incorrectly changed log messages
Aniruddh25 Sep 24, 2025
64b1371
Remove nullable Path property
Aniruddh25 Sep 24, 2025
f0e6e85
Apply suggestions from code review
Aniruddh25 Sep 24, 2025
3b893c8
Keeping the parameters UpperCases to align with other RuntimeOptions …
Aniruddh25 Sep 25, 2025
2eacd64
Draft PR: Service Tests Fix (#2884)
RubenCerna2079 Sep 25, 2025
a29485c
Fix mssql snapshot
RubenCerna2079 Sep 25, 2025
8080c83
Addressed review comments. mostly nits
souvikghosh04 Sep 25, 2025
b4d7bd6
Fix failing test by reverting to original version
souvikghosh04 Sep 25, 2025
fd9d163
Fix formatting errors
souvikghosh04 Sep 25, 2025
44a59f5
fixed the summary
souvikghosh04 Sep 25, 2025
96d8f8f
fix formatting
souvikghosh04 Sep 25, 2025
7c483c0
Fix comments from copilot
RubenCerna2079 Sep 25, 2025
354522f
Address comments
RubenCerna2079 Sep 25, 2025
973afab
Delete dead code
RubenCerna2079 Sep 25, 2025
e585c0c
Delete more dead code
RubenCerna2079 Sep 25, 2025
06201d8
Use IsMcpEnabled to determine whether to add mcp server or not
Aniruddh25 Sep 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 75 additions & 14 deletions schemas/dab.draft.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@
"type": "object",
"properties": {
"max-page-size": {
"type": ["integer", "null"],
"type": [ "integer", "null" ],
"description": "Defines the maximum number of records that can be returned in a single page of results. If set to null, the default value is 100,000.",
"default": 100000,
"minimum": 1
},
"default-page-size": {
"type": ["integer", "null"],
"type": [ "integer", "null" ],
"description": "Sets the default number of records returned in a single response. When this limit is reached, a continuation token is provided to retrieve the next page. If set to null, the default value is 100.",
"default": 100,
"minimum": 1
Expand Down Expand Up @@ -214,7 +214,7 @@
"description": "Allow enabling/disabling GraphQL requests for all entities."
},
"depth-limit": {
"type": ["integer", "null"],
"type": [ "integer", "null" ],
"description": "Maximum allowed depth of a GraphQL query.",
"default": null
},
Expand All @@ -239,26 +239,87 @@
}
}
},
"mcp": {
"type": "object",
"description": "Global MCP endpoint configuration",
"additionalProperties": false,
"properties": {
"path": {
"default": "/mcp",
"type": "string"
},
"enabled": {
"type": "boolean",
"description": "Allow enabling/disabling MCP requests for all entities.",
"default": true
},
"dml-tools": {
"oneOf": [
{
"type": "boolean",
"description": "Enable/disable all DML tools with default settings."
},
{
"type": "object",
"description": "Individual DML tools configuration",
"additionalProperties": false,
"properties": {
"describe-entities": {
"type": "boolean",
"description": "Enable/disable the describe-entities tool.",
"default": false
},
"create-record": {
"type": "boolean",
"description": "Enable/disable the create-record tool.",
"default": false
},
"read-records": {
"type": "boolean",
"description": "Enable/disable the read-records tool.",
"default": false
},
"update-record": {
"type": "boolean",
"description": "Enable/disable the update-record tool.",
"default": false
},
"delete-record": {
"type": "boolean",
"description": "Enable/disable the delete-record tool.",
"default": false
},
"execute-entity": {
"type": "boolean",
"description": "Enable/disable the execute-entity tool.",
"default": false
}
}
}
]
}
}
},
"host": {
"type": "object",
"description": "Global hosting configuration",
"additionalProperties": false,
"properties": {
"max-response-size-mb": {
"type": ["integer", "null"],
"type": [ "integer", "null" ],
"description": "Specifies the maximum size, in megabytes, of the database response allowed in a single result. If set to null, the default value is 158 MB.",
"default": 158,
"minimum": 1,
"maximum": 158
},
"mode": {
"description": "Set if running in Development or Production mode",
"type": ["string", "null"],
"type": [ "string", "null" ],
"default": "production",
"enum": ["production", "development"]
"enum": [ "production", "development" ]
},
"cors": {
"type": ["object", "null"],
"type": [ "object", "null" ],
"description": "Configure CORS",
"additionalProperties": false,
"properties": {
Expand All @@ -278,7 +339,7 @@
}
},
"authentication": {
"type": ["object", "null"],
"type": [ "object", "null" ],
"additionalProperties": false,
"properties": {
"provider": {
Expand Down Expand Up @@ -322,7 +383,7 @@
"type": "string"
}
},
"required": ["audience", "issuer"]
"required": [ "audience", "issuer" ]
}
},
"allOf": [
Expand All @@ -338,9 +399,9 @@
]
}
},
"required": ["provider"]
"required": [ "provider" ]
},
"then": { "required": ["jwt"] },
"then": { "required": [ "jwt" ] },
"else": { "properties": { "jwt": false } }
}
]
Expand Down Expand Up @@ -382,7 +443,7 @@
"default": true
}
},
"required": ["connection-string"]
"required": [ "connection-string" ]
},
"open-telemetry": {
"type": "object",
Expand All @@ -405,15 +466,15 @@
"type": "string",
"description": "Open Telemetry protocol",
"default": "grpc",
"enum": ["grpc", "httpprotobuf"]
"enum": [ "grpc", "httpprotobuf" ]
},
"enabled": {
"type": "boolean",
"description": "Allow enabling/disabling Open Telemetry.",
"default": true
}
},
"required": ["endpoint"]
"required": [ "endpoint" ]
},
"azure-log-analytics": {
"type": "object",
Expand Down
22 changes: 22 additions & 0 deletions src/Azure.DataApiBuilder.Mcp/Azure.DataApiBuilder.Mcp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ModelContextProtocol" />
<PackageReference Include="ModelContextProtocol.AspNetCore" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Core\Azure.DataApiBuilder.Core.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="CustomTools\" />
</ItemGroup>

</Project>
87 changes: 87 additions & 0 deletions src/Azure.DataApiBuilder.Mcp/BuiltInTools/CreateRecordTool.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Text.Json;
using Azure.DataApiBuilder.Mcp.Model;
using ModelContextProtocol.Protocol;
using static Azure.DataApiBuilder.Mcp.Model.McpEnums;

namespace Azure.DataApiBuilder.Mcp.BuiltInTools
{
public class CreateRecordTool : IMcpTool
{
public ToolType ToolType { get; } = ToolType.BuiltIn;

public Tool GetToolMetadata()
{
return new Tool
{
Name = "create-record",
Description = "Creates a new record in the specified entity.",
InputSchema = JsonSerializer.Deserialize<JsonElement>(
@"{
""type"": ""object"",
""properties"": {
""entity"": {
""type"": ""string"",
""description"": ""The name of the entity""
},
""data"": {
""type"": ""object"",
""description"": ""The data for the new record""
}
},
""required"": [""entity"", ""data""]
}"
)
};
}

public Task<CallToolResult> ExecuteAsync(
JsonDocument? arguments,
IServiceProvider serviceProvider,
CancellationToken cancellationToken = default)
{
if (arguments == null)
{
return Task.FromResult(new CallToolResult
{
Content = [new TextContentBlock { Type = "text", Text = "Error: No arguments provided" }]
});
}

try
{
// Extract arguments
JsonElement root = arguments.RootElement;

if (!root.TryGetProperty("entity", out JsonElement entityElement) ||
!root.TryGetProperty("data", out JsonElement dataElement))
{
return Task.FromResult(new CallToolResult
{
Content = [new TextContentBlock { Type = "text", Text = "Error: Missing required arguments 'entity' or 'data'" }]
});
}

string entityName = entityElement.GetString() ?? string.Empty;

// TODO: Implement actual create logic using DAB's internal services
// For now, return a placeholder response
string result = $"Would create record in entity '{entityName}' with data: {dataElement.GetRawText()}";

return Task.FromResult(new CallToolResult
{
Content = [new TextContentBlock { Type = "text", Text = result }]
});
}
catch (Exception ex)
{
return Task.FromResult(new CallToolResult
{
Content = [new TextContentBlock { Type = "text", Text = $"Error: {ex.Message}" }]
});
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Text.Json;
using Azure.DataApiBuilder.Config.ObjectModel;
using Azure.DataApiBuilder.Core.Configurations;
using Azure.DataApiBuilder.Mcp.Model;
using Microsoft.Extensions.DependencyInjection;
using ModelContextProtocol.Protocol;
using static Azure.DataApiBuilder.Mcp.Model.McpEnums;

namespace Azure.DataApiBuilder.Mcp.BuiltInTools
{
public class DescribeEntitiesTool : IMcpTool
{
public ToolType ToolType { get; } = ToolType.BuiltIn;

public Tool GetToolMetadata()
{
return new Tool
{
Name = "describe-entities",
Description = "Lists and describes all entities in the database."
};
}

public Task<CallToolResult> ExecuteAsync(
JsonDocument? arguments,
IServiceProvider serviceProvider,
CancellationToken cancellationToken = default)
{
try
{
// Get the runtime config provider
RuntimeConfigProvider? runtimeConfigProvider = serviceProvider.GetService<RuntimeConfigProvider>();
if (runtimeConfigProvider == null || !runtimeConfigProvider.TryGetConfig(out RuntimeConfig? runtimeConfig))
{
return Task.FromResult(new CallToolResult
{
Content = [new TextContentBlock { Type = "text", Text = "Error: Runtime configuration not available." }]
});
}

// Extract entity information from the runtime config
Dictionary<string, object> entities = new();

if (runtimeConfig.Entities != null)
{
foreach (KeyValuePair<string, Entity> entity in runtimeConfig.Entities)
{
entities[entity.Key] = new
{
source = entity.Value.Source,
permissions = entity.Value.Permissions?.Select(p => new
{
role = p.Role,
actions = p.Actions
})
};
}
}

string entitiesJson = JsonSerializer.Serialize(entities, new JsonSerializerOptions
{
WriteIndented = true,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
});

return Task.FromResult(new CallToolResult
{
Content = [new TextContentBlock { Type = "application/json", Text = entitiesJson }]
});
}
catch (Exception ex)
{
return Task.FromResult(new CallToolResult
{
Content = [new TextContentBlock { Type = "text", Text = $"Error: {ex.Message}" }]
});
}
}
}
}
Loading
Loading