Add user_config to Azure MCP Bundle#2618
Conversation
Signed-off-by: Tom Plant <tom.plant@devicie.com>
|
Thank you for your contribution @pl4nty! We will review the pull request and get back to you soon. |
Turns out 0.3 does support user_config Signed-off-by: Tom Plant <tom.plant@devicie.com>
There was a problem hiding this comment.
Pull request overview
Adds user_config support to the Azure MCP bundle manifest so MCP clients (e.g., Claude Desktop) can configure server startup options and environment-based settings via a UI rather than requiring manual process configuration.
Changes:
- Adds an MCPB manifest
$schemareference. - Updates the bundle
mcp_config.args/mcp_config.envto be driven by${user_config.*}placeholders. - Introduces a
user_configschema with authentication, telemetry, and server-mode settings.
Invoking Livetests
Copilot submitted PRs are not trustworthy by default. Users with write access to the repo need to validate the contents of this PR before leaving a comment with the text /azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.
| "type": "string", | ||
| "title": "Entra Tenant ID", | ||
| "description": "Entra tenant ID. Use this to authenticate against a specific tenant. Example: 00000000-0000-0000-0000-000000000000", | ||
| "default": "" |
There was a problem hiding this comment.
While implementing microsoft/fabric-rti-mcp#172, I noticed Claude Desktop only substitutes string variables if a value is provided. This can cause server issues like trying to parse a guid from raw ${user_config.azure_tenant_id}, so I've set default values
| "type": "boolean", | ||
| "title": "Collect Telemetry", | ||
| "description": "Whether to allow Azure MCP Server to collect anonymous usage telemetry. Set to false to opt out.", | ||
| "default": true |
There was a problem hiding this comment.
Booleans in Claude Desktop are non-nullable and currently default to false
Signed-off-by: Tom Plant <tom.plant@devicie.com>
jongio
left a comment
There was a problem hiding this comment.
This adds a useful user_config surface for MCP clients. A few things to address before merge:
-
The
platform_overrides.win32section still has"args": []and noenvblock. Depending on how the mcpb runtime handles overrides (merge vs replace), Windows users may not receive the new args or env vars from user_config. Should the win32 override be updated to mirror the main mcp_config, or does the runtime inherit unset fields from the parent? -
The boolean env vars (
AZURE_MCP_COLLECT_TELEMETRY,AZURE_MCP_COLLECT_TELEMETRY_MICROSOFT) havedefault: truein user_config. You mentioned Claude Desktop defaults booleans to false. If the client ignores the manifest default and uses false, telemetry would be disabled for all bundle users by default. This contradicts the server's built-in behavior (telemetry on unless explicitly opted out). Can you confirm which default wins at runtime? -
The
sensitive: trueadditions look correct and address the credential storage concern.
| "--debug", | ||
| "${user_config.debug}", | ||
| "--read-only", | ||
| "${user_config.read_only}", |
There was a problem hiding this comment.
When user_config.debug is false (the default), this expands to --debug false. System.CommandLine parses it fine, but it means every launch always includes --debug false --read-only false --dangerously-disable-elicitation false which is noisy. Not blocking, but if mcpb supports conditional arg inclusion (only add when true), that'd be cleaner.
| "AZURE_MCP_COLLECT_TELEMETRY_MICROSOFT": "${user_config.azure_mcp_collect_telemetry_microsoft}", | ||
| "AZURE_MCP_ONLY_USE_BROKER_CREDENTIAL": "${user_config.azure_mcp_only_use_broker_credential}", | ||
| "AZURE_MCP_ENABLE_OTLP_EXPORTER": "${user_config.azure_mcp_enable_otlp_exporter}", | ||
| "APPLICATIONINSIGHTS_CONNECTION_STRING": "${user_config.applicationinsights_connection_string}" |
There was a problem hiding this comment.
The server reads AZURE_MCP_COLLECT_TELEMETRY at ServiceStartCommand.cs:967-969. Empty/whitespace is treated as true (telemetry enabled). So empty string defaults for string env vars are safe and won't override existing user env in a harmful way.
But boolean-typed user_config values always resolve to a concrete true/false string. If a user previously set AZURE_MCP_COLLECT_TELEMETRY=false in their shell profile and the bundle sets it to true (from the manifest default), their opt-out is silently overridden. Worth documenting this behavior in the description fields, something like 'Overrides any existing environment variable when configured.'
What does this PR do?
Add user_config to Azure MCP Bundle, so users can configure settings in clients like Claude Desktop. Some settings were excluded because bundles only support stdio.
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