Skip to content

Add server start option to disable proxied tools - #3287

Open
Alan Zimmer (alzimmermsft) wants to merge 3 commits into
microsoft:mainfrom
alzimmermsft:AddStartOptionToDisableProxyTools
Open

Add server start option to disable proxied tools#3287
Alan Zimmer (alzimmermsft) wants to merge 3 commits into
microsoft:mainfrom
alzimmermsft:AddStartOptionToDisableProxyTools

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Add new server starting option disable-proxy-tools to disable tools loaded via registry.json.

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
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft 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 mcp - pullrequest - live to run Live Test Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added server-Azure.Mcp Azure.Mcp.Server server-Fabric.Mcp Microsoft Fabric MCP Server labels Aug 14, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a new azmcp server start boolean option, --disable-proxy-tools, to allow running the server without loading tools proxied from external MCP servers configured via registry.json.

Changes:

  • Added DisableProxyTools to ServerStartOptions and updated DI wiring so registry-backed discovery/tool loading can be skipped.
  • Updated Azure server command documentation and added changelog entries for both Azure and Fabric servers.
  • Updated core test harness defaults and option-parsing tests to include/recognize --disable-proxy-tools.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
servers/Fabric.Mcp.Server/changelog-entries/1786726837096.yaml Adds Fabric changelog entry documenting the new server start option.
servers/Azure.Mcp.Server/docs/azmcp-commands.md Documents --disable-proxy-tools for azmcp server start.
servers/Azure.Mcp.Server/changelog-entries/1786726829980.yaml Adds Azure changelog entry documenting the new server start option.
core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/CommandTestsBase.cs Adds --disable-proxy-tools to default server-start arguments used by tests.
core/Microsoft.Mcp.Core/src/Areas/Server/Options/ServerStartOptions.cs Introduces the new DisableProxyTools option in the shared server start options.
core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ServiceCollectionExtensions.cs Implements conditional discovery/tool-loading behavior when proxy tools are disabled.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/ServiceStartCommandTests.cs Extends boolean option parsing coverage to include --disable-proxy-tools.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 209 to 226
else if (serviceStartOptions.Mode == ModeTypes.All)
{
services.AddSingleton<IMcpDiscoveryStrategy, RegistryDiscoveryStrategy>();
if (!serviceStartOptions.DisableProxyTools)
{
services.AddSingleton<IMcpDiscoveryStrategy, RegistryDiscoveryStrategy>();
}
services.AddSingleton<IToolLoader>(sp =>
{
var loggerFactory = sp.GetRequiredService<ILoggerFactory>();
var toolLoaders = new List<IToolLoader>
var toolLoaders = new List<IToolLoader>();
if (!serviceStartOptions.DisableProxyTools)
{
sp.GetRequiredService<RegistryToolLoader>(),
sp.GetRequiredService<CommandFactoryToolLoader>(),
};
toolLoaders.Add(sp.GetRequiredService<RegistryToolLoader>());
}

toolLoaders.Add(sp.GetRequiredService<CommandFactoryToolLoader>());

return new CompositeToolLoader(toolLoaders, loggerFactory.CreateLogger<CompositeToolLoader>());
Comment thread servers/Azure.Mcp.Server/docs/azmcp-commands.md
@JasonYeMSFT

Copy link
Copy Markdown
Member

Can users disable such tools by disabling their corresponding namespaces?

@alzimmermsft

Copy link
Copy Markdown
Contributor Author

Can users disable such tools by disabling their corresponding namespaces?

Yes, but we only offer filtering on namespaces you want included, not excluded. But even if we offered namespace exclusion you still run into issues where if new tools are added you may either implicitly exclude them when using inclusion or implicitly include them when using exclusion. Offering this standalone flag is an explicit guarantee on correct exclusion of registry.json tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server-Azure.Mcp Azure.Mcp.Server server-Fabric.Mcp Microsoft Fabric MCP Server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants