-
Notifications
You must be signed in to change notification settings - Fork 301
Cherry picking server level description to MCP config and fix to allow boolean properties to be set by env vars #3092
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
Aniruddh25
wants to merge
3
commits into
release/1.7
Choose a base branch
from
dev/anmunde/cherryPick1.7
base: release/1.7
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.
+646
−23
Conversation
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
## Why make this change?
MCP clients and agents require high-level behavioral context for servers
via the `initialize` response's `instructions` field. DAB previously had
no mechanism to surface this configurable semantic guidance.
## What is this change?
Added optional `description` field to MCP runtime configuration that
populates the MCP protocol's `instructions` field:
**Configuration model**
- `McpRuntimeOptions` now accepts `description` parameter
- `McpRuntimeOptionsConverter` handles serialization/deserialization
**CLI integration**
- `dab configure --runtime.mcp.description "text"` command support
- Configuration generator validates and persists the value
- Fixed config persistence bug: Added DML tools options to condition
check to ensure MCP configuration updates are properly written to config
file
**MCP server response**
- **Stdio Server**: `HandleInitialize()` retrieves description from
`RuntimeConfig.Runtime.Mcp.Description` and conditionally includes
`instructions` in initialize response when non-empty
- **HTTP Server**: Updated server name to "SQL MCP Server"
- Both servers now use explicit `object` type instead of `var` for
better type clarity
**Testing**
- Added comprehensive unit tests in
`McpRuntimeOptionsSerializationTests` covering:
- Serialization/deserialization with description
- Edge cases: null, empty strings, whitespace, very long strings (5000+
characters)
- Special characters: quotes, newlines, tabs, unicode characters
- Backward compatibility with existing configurations without
description field
- Improved assertion order to validate JSON field presence before value
matching
- Consolidated CLI tests: removed duplicate
`TestAddDescriptionToMcpSettings` and renamed
`TestUpdateDescriptionForMcpSettings` to
`TestConfigureDescriptionForMcpSettings`
**Code quality fixes**
- Fixed build errors by removing nullable reference type annotations
(project has nullable disabled)
- Fixed IDE0090 code style error by using target-typed new expression
- Fixed whitespace formatting error by removing trailing whitespace
Example configuration:
```json
{
"runtime": {
"mcp": {
"enabled": true,
"description": "This MCP provides access to the Products database..."
}
}
}
```
## How was this tested?
- [x] Unit Tests
- 9 serialization/deserialization tests for MCP description field
- 2 CLI configuration tests for description option (consolidated from 3)
- All existing ConfigureOptionsTests pass (58 tests)
- [x] Build verification - all projects build successfully with no
errors or warnings
## Sample Request(s)
CLI usage:
```bash
dab configure --runtime.mcp.description "This MCP provides access to the Products database and should be used to answer product-related or inventory-related questions from the user."
```
MCP initialize response (when description configured - Stdio Server):
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2024-11-05",
"capabilities": { ... },
"serverInfo": {
"name": "SQL MCP Server",
"version": "1.0.0"
},
"instructions": "This MCP provides access to the Products database..."
}
}
```
**Note**: The HTTP server currently only updates the server name to "SQL
MCP Server". Instructions support will be added when the
ModelContextProtocol.AspNetCore library adds support for this field in
future versions.
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JerryNixon <1749983+JerryNixon@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
Co-authored-by: anushakolan <45540936+anushakolan@users.noreply.github.com>
Co-authored-by: Anusha Kolan <anushakolan10@gmail.com>
Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
#3054) … it uses the environment replacement and looks for a true false 1 or 0. ## Why make this change? Fixes #3053 Boolean values can't be set using environment variables. This allows that ## What is this change? Using custom JsonConverter for bools that if a string is detected it uses the string serialiser that uses the environment replacement rules. ## How was this tested? - [ ] Integration Tests - [x] Unit Tests --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jerry Nixon <1749983+JerryNixon@users.noreply.github.com> Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Contributor
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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
souvikghosh04
approved these changes
Jan 31, 2026
Contributor
souvikghosh04
left a comment
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.
LGTM.
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?
What is this change?
How was this tested?
PR Pipeline validation.