Added changes to set McpServerOptions.Instructions in HTTPS/SSE mode.#3423
Open
anushakolan wants to merge 3 commits intomainfrom
Open
Added changes to set McpServerOptions.Instructions in HTTPS/SSE mode.#3423anushakolan wants to merge 3 commits intomainfrom
anushakolan wants to merge 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns MCP HTTP/SSE initialization behavior with the stdio transport by propagating runtime.mcp.description into the MCP initialize response’s instructions field, and adds a regression test to prevent regressions.
Changes:
- Pass
runtime.mcp.descriptioninto MCP server configuration during DI setup. - Set MCP server options (
ServerInstructions) so HTTP/SSE initialize includesinstructions. - Add an MSSQL integration test that calls MCP
initializeand assertsresult.instructionsis present (with helper logic to parse JSON vs SSE responses).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Azure.DataApiBuilder.Mcp/Core/McpServiceCollectionExtensions.cs | Passes runtime MCP description into MCP server configuration during service registration. |
| src/Azure.DataApiBuilder.Mcp/Core/McpServerConfiguration.cs | Adds an instructions parameter and wires it to MCP server options used by HTTP/SSE initialize. |
| src/Service.Tests/Configuration/ConfigurationTests.cs | Adds a regression test + helper to invoke MCP initialize and validate returned instructions. |
Aniruddh25
requested changes
Apr 10, 2026
Collaborator
Aniruddh25
left a comment
There was a problem hiding this comment.
minimize test duplication.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
Closes #3283
runtime.mcp.descriptionwas configured, but MCP HTTP/SSE initialize did not return it asinstructions. This made the engine behavior inconsistent with expected MCP initialization output.Related discussion: #3282
What is this change?
Wired runtime MCP description into MCP server options for HTTP/SSE initialization:
runtime.mcp.description->ServerInstructionssrc/Azure.DataApiBuilder.Mcp/Core/McpServiceCollectionExtensions.cssrc/Azure.DataApiBuilder.Mcp/Core/McpServerConfiguration.csAdded/updated regression coverage for initialize response instructions:
src/Service.Tests/Configuration/ConfigurationTests.csTestMcpInitializeIncludesInstructionsFromRuntimeDescriptionHow the bug was simulated:
initialize;result.instructionswas missing.How it was verified after fix:
initializeagain, and confirmedresult.instructionsis present.How was this tested?
Ran:
dotnet test src/Service.Tests/Azure.DataApiBuilder.Service.Tests.csproj --filter "FullyQualifiedName~ConfigurationTests.TestMcpInitializeIncludesInstructionsFromRuntimeDescription" -v minimalSample Request(s)
MCP initialize request (HTTP):
Expected response snippet after fix:
{ "result": { "instructions": "Use SQL tools to query the database." } }