Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Conversation

xiangyan99
Copy link
Member

@xiangyan99 xiangyan99 commented Aug 7, 2025

What does this PR do?

[Provide a clear, concise description of the changes]

Add the support for secret hint, will have a separate PR to update its value for all tools.

Part of #744.

[Any additional context, screenshots, or information that helps reviewers]

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
    • Spelling check passes: .\eng\common\spelling\Invoke-Cspell.ps1
  • For MCP tool changes:
    • Updated README.md documentation
    • Updated command list in /docs/azmcp-commands.md
    • Updated test prompts in /e2eTests/e2eTestPrompts.md
    • For new or modified tool descriptions, ran the eng/tools/ToolDescriptionConfidenceScore tool and obtained a result >= 0.4
  • 👉 For Community (non-Azure team member) PRs:
    • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
    • Manual tests run: added comment /azp run azure - mcp to run Live Test Pipeline

/// The default is <see langword="false"/>.
/// </para>
/// </remarks>
public bool Secret { get; init; } = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiangyan99 xiangyan99 marked this pull request as ready for review August 7, 2025 17:47
@Copilot Copilot AI review requested due to automatic review settings August 7, 2025 17:47
@xiangyan99 xiangyan99 requested a review from a team as a code owner August 7, 2025 17:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the Secret property to the ToolMetadata class, enabling MCP tools to indicate when they handle or return sensitive information like credentials or API keys.

  • Adds a new Secret boolean property to ToolMetadata with comprehensive documentation
  • Updates the new command documentation template to include the Secret property
  • Adds comprehensive unit tests covering the new functionality

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
core/src/AzureMcp.Core/Commands/ToolMetadata.cs Adds the new Secret property with detailed XML documentation
core/tests/AzureMcp.Core.UnitTests/Commands/ToolMetadataTests.cs Adds comprehensive unit tests for ToolMetadata including the new Secret property
docs/new-command.md Updates the command template to include the Secret property configuration
CHANGELOG.md Documents the new feature addition

Copy link
Member

@anuchandy anuchandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty Xiang! minor comment on doc.

/// </para>
/// <para>
/// This property helps MCP clients understand whether special handling or masking
/// may be required for the tool's inputs or outputs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property helps MCP clients understand whether special handling or masking may be required for the tool's inputs or outputs.

Regarding this documentation, my understanding is that we cannot return this flag to the "MCP client", since only flags or properties defined in the ModelContextProtocol.Protocol.ToolAnnotations type (that maps to the spec that Jon linked) will be sent over the channel (stdio or wire) to the "MCP client" by the MCP SDK. If so, we may want to adjust the documentation. My understanding is that such additional flags could help us internally filter the visibility of tools (e.g., service start --disable-secrets-tools).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. We cannot add the hints into the response yet. Now we use it as the source of truth of the traits of the tools.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have background info on this change? Like what is the plan, why are we doing this? What are next steps etc? It would be good to include that info in PRs so we know why we are looking it. Thanks

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, updated the description of the PR.

It is for #744 @jongio

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me why we are adding a hint that isn't supported by the spec. Can you elaborate on the plan please?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before these hints are incorporated into the MCP spec, we will rely solely on the code as the source of truth for the tools' traits and may auto-generate documentation from it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed with Josh:

We add it for a command line switch and for doc generation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jongio please let me know if you have concerns.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure these are going to be added to the spec? It would be great to provide follow up / links to those proposals/discussions so we can link back to it for history sake on this issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, we use this metadata only to filter tools. If modelcontextprotocol/modelcontextprotocol#711 is approved, we may update the tag to "sensitive."

@jongio
Copy link
Member

jongio commented Aug 25, 2025

Sorry for the inconvenience, but we have moved the Azure MCP Server source code to https://github.com/microsoft/mcp. This change allows us to build any Microsoft MCP server with the same engineering system and allows us to brand any MCP server with either Azure or Microsoft branding. This repo change means that you need to move this PR to that new repo. Please do so and then add a link here to that new PR. We'll close this PR now and we look forward to seeing this over on the new repo.

@jongio jongio closed this Aug 25, 2025
@github-project-automation github-project-automation bot moved this from Untriaged to Done in Azure MCP Server (OLD) Aug 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants