From 59a48c8d2278b2f2d3014b3f5ae52e26ab1a7fdd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Oct 2026 08:52:34 +0000 Subject: [PATCH 1/2] Initial plan From 66fc3e0f0ca7c2d6696ef90cdcf1f1aeb2c34546 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Oct 2026 08:56:33 +0000 Subject: [PATCH 2/2] Populate OpenAPI info description Co-authored-by: souvikghosh04 <210500244+souvikghosh04@users.noreply.github.com> --- .../Services/OpenAPI/OpenApiDocumentor.cs | 3 +- .../UnitTests/OpenApiDocumentorUnitTests.cs | 30 ++++++++++++++++--- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/Core/Services/OpenAPI/OpenApiDocumentor.cs b/src/Core/Services/OpenAPI/OpenApiDocumentor.cs index fb4c382a71..a567095672 100644 --- a/src/Core/Services/OpenAPI/OpenApiDocumentor.cs +++ b/src/Core/Services/OpenAPI/OpenApiDocumentor.cs @@ -230,7 +230,8 @@ private OpenApiDocument BuildOpenApiDocument(RuntimeConfig runtimeConfig, string Info = new OpenApiInfo { Version = ProductInfo.GetProductVersion(), - Title = title + Title = title, + Description = runtimeConfig.Runtime?.Mcp?.Description }, Servers = new List { diff --git a/src/Service.Tests/UnitTests/OpenApiDocumentorUnitTests.cs b/src/Service.Tests/UnitTests/OpenApiDocumentorUnitTests.cs index d855af2724..1ff39779a4 100644 --- a/src/Service.Tests/UnitTests/OpenApiDocumentorUnitTests.cs +++ b/src/Service.Tests/UnitTests/OpenApiDocumentorUnitTests.cs @@ -77,6 +77,22 @@ public void CreateDocument_TableEntity_GeneratesExpectedPathsAndSchemas() Assert.IsTrue(schemas.TryGetProperty("Book_NoPK", out _)); } + [TestMethod] + public void CreateDocument_McpDescription_PopulatesInfoDescription() + { + const string description = "This server provides access to the company database."; + OpenApiDocumentor documentor = CreateDocumentor( + new Dictionary { [ENTITY_NAME] = CreateTableEntity(restEnabled: true) }, + CreateBookMetadata(), + mcpDescription: description); + + documentor.CreateDocument(); + + Assert.IsTrue(documentor.TryGetDocument(out string? document)); + using JsonDocument doc = JsonDocument.Parse(document!); + Assert.AreEqual(description, doc.RootElement.GetProperty("info").GetProperty("description").GetString()); + } + [TestMethod] public void CreateDocument_CalledTwiceWithoutOverride_Throws() { @@ -451,7 +467,8 @@ private static OpenApiDocumentor CreateDocumentor( IEnumerable? columnNames = null, bool restEnabledGlobally = true, bool requestBodyStrict = true, - string? baseRoute = null) + string? baseRoute = null, + string? mcpDescription = null) { Mock mockMetadataProvider = new(); mockMetadataProvider.Setup(x => x.EntityToDatabaseObject).Returns(dbObjects); @@ -480,7 +497,7 @@ private static OpenApiDocumentor CreateDocumentor( Mock mockFactory = new(); mockFactory.Setup(x => x.GetMetadataProvider(It.IsAny())).Returns(mockMetadataProvider.Object); - RuntimeConfig config = CreateConfig(entities, restEnabledGlobally, requestBodyStrict, baseRoute); + RuntimeConfig config = CreateConfig(entities, restEnabledGlobally, requestBodyStrict, baseRoute, mcpDescription); RuntimeConfigProvider configProvider = TestHelper.GenerateInMemoryRuntimeConfigProvider(config); return new OpenApiDocumentor( @@ -490,7 +507,12 @@ private static OpenApiDocumentor CreateDocumentor( logger: NullLogger.Instance); } - private static RuntimeConfig CreateConfig(Dictionary entities, bool restEnabledGlobally, bool requestBodyStrict = true, string? baseRoute = null) + private static RuntimeConfig CreateConfig( + Dictionary entities, + bool restEnabledGlobally, + bool requestBodyStrict = true, + string? baseRoute = null, + string? mcpDescription = null) { return new RuntimeConfig( Schema: "test-schema", @@ -498,7 +520,7 @@ private static RuntimeConfig CreateConfig(Dictionary entities, b Runtime: new( Rest: new(Enabled: restEnabledGlobally, RequestBodyStrict: requestBodyStrict), GraphQL: new(), - Mcp: null, + Mcp: mcpDescription is null ? null : new(Description: mcpDescription), Host: new(Cors: null, Authentication: null, Mode: HostMode.Development), BaseRoute: baseRoute), Entities: new(entities));