-
Notifications
You must be signed in to change notification settings - Fork 299
Add server-level description field to MCP runtime configuration #3016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
11
commits into
main
Choose a base branch
from
copilot/add-server-level-description
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e24dbf1
Initial plan
Copilot dd623b5
Add description field to MCP runtime configuration
Copilot 839c081
Add description serialization support to MCP converter
Copilot fa008ee
Address code review feedback - improve error handling and simplify re…
Copilot 9acfb7f
Fix null reference warning in McpRuntimeOptionsConverter
Copilot 3042ef8
Update src/Azure.DataApiBuilder.Mcp/Core/McpStdioServer.cs
JerryNixon 73aa356
Add comprehensive unit tests for MCP description serialization and ed…
Copilot 21beebb
Update server name to 'SQL MCP Server' and improve test assertion order
Copilot 466192f
Merge branch 'main' into copilot/add-server-level-description
anushakolan c6c45f0
Replace var with explicit object type for result and response variables
Copilot b162ad4
Update MCP HTTP server configuration to use SQL MCP Server name and p…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -926,6 +926,63 @@ public void TestFailureWhenAddingSetSessionContextToMySQLDatabase() | |
| Assert.IsFalse(isSuccess); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Tests that running "dab configure --runtime.mcp.description {value}" on a config with various values results | ||
| /// in runtime config update. Takes in updated value for mcp.description and | ||
| /// validates whether the runtime config reflects those updated values | ||
| /// </summary> | ||
| [DataTestMethod] | ||
| [DataRow("This MCP provides access to the Products database and should be used to answer product-related or inventory-related questions from the user.", DisplayName = "Set MCP description.")] | ||
| [DataRow("Use this server for customer data queries.", DisplayName = "Set MCP description with short text.")] | ||
| public void TestUpdateDescriptionForMcpSettings(string descriptionValue) | ||
| { | ||
| // Arrange -> all the setup which includes creating options. | ||
| SetupFileSystemWithInitialConfig(INITIAL_CONFIG); | ||
|
|
||
| // Act: Attempts to update mcp.description value | ||
| ConfigureOptions options = new( | ||
| runtimeMcpDescription: descriptionValue, | ||
| config: TEST_RUNTIME_CONFIG_FILE | ||
| ); | ||
| bool isSuccess = TryConfigureSettings(options, _runtimeConfigLoader!, _fileSystem!); | ||
|
|
||
| // Assert: Validate the Description is updated | ||
| Assert.IsTrue(isSuccess); | ||
| string updatedConfig = _fileSystem!.File.ReadAllText(TEST_RUNTIME_CONFIG_FILE); | ||
| Assert.IsTrue(RuntimeConfigLoader.TryParseConfig(updatedConfig, out RuntimeConfig? runtimeConfig)); | ||
| Assert.IsNotNull(runtimeConfig.Runtime?.Mcp?.Description); | ||
| Assert.AreEqual(descriptionValue, runtimeConfig.Runtime.Mcp.Description); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Tests that the MCP description can be added to a config that doesn't already have one | ||
| /// </summary> | ||
| [TestMethod] | ||
| public void TestAddDescriptionToMcpSettings() | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TestAddDescriptionToMcpSettings is exactly same as TestUpdateDescriptionForMcpSettings, can be removed. The test TestUpdateDescriptionForMcpSettings can be renamed to TestConfigureDescriptionForMcpSettings. |
||
| { | ||
| // Arrange | ||
| SetupFileSystemWithInitialConfig(INITIAL_CONFIG); | ||
|
|
||
| // Initial config should not have a description | ||
| Assert.IsTrue(RuntimeConfigLoader.TryParseConfig(INITIAL_CONFIG, out RuntimeConfig? config)); | ||
| Assert.IsNull(config.Runtime?.Mcp?.Description); | ||
|
|
||
| // Act: Add description | ||
| string descriptionValue = "This is a test description for MCP server."; | ||
| ConfigureOptions options = new( | ||
| runtimeMcpDescription: descriptionValue, | ||
| config: TEST_RUNTIME_CONFIG_FILE | ||
| ); | ||
| bool isSuccess = TryConfigureSettings(options, _runtimeConfigLoader!, _fileSystem!); | ||
|
|
||
| // Assert: Validate the Description is added | ||
| Assert.IsTrue(isSuccess); | ||
| string updatedConfig = _fileSystem!.File.ReadAllText(TEST_RUNTIME_CONFIG_FILE); | ||
| Assert.IsTrue(RuntimeConfigLoader.TryParseConfig(updatedConfig, out RuntimeConfig? runtimeConfig)); | ||
| Assert.IsNotNull(runtimeConfig.Runtime?.Mcp?.Description); | ||
| Assert.AreEqual(descriptionValue, runtimeConfig.Runtime.Mcp.Description); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Sets up the mock file system with an initial configuration file. | ||
| /// This method adds a config file to the mock file system and verifies its existence. | ||
|
|
||
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot, Even though HandleInitialize of the McpStdioServer class has been modified to include the description. We need similar changes to the Mcp Http Server that provides the tool registry in McpServerConfiguration.
Also, please dont update PR description. Retain the original PR description that described this complete change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated MCP HTTP server configuration in
McpServerConfiguration.cs:ConfigureMcpServerto acceptRuntimeConfigparameterThe HTTP server now receives the runtime config but can't set instructions yet as the library doesn't expose this property on
McpServerOptions. The description is ready to be wired when library support is available.Original PR description has been retained as requested. Commit: b162ad4