Add server start option to disable proxied tools - #3287
Add server start option to disable proxied tools#3287Alan Zimmer (alzimmermsft) wants to merge 3 commits into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
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
DisableProxyToolstoServerStartOptionsand 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.
| 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>()); |
|
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 |
What does this PR do?
Add new server starting option
disable-proxy-toolsto disable tools loaded viaregistry.json.GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline