Skip to content

[Remote] Live tests for HTTP accidentally test stdio mode #3319

Description

Step that says it's testing HTTP transport:

- task: AzurePowershell@5
displayName: "Run tests (http) - az pwsh"
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
AZURE_MCP_COLLECT_TELEMETRY: 'false'
inputs:
azureSubscription: azure-sdk-tests-public
azurePowerShellVersion: 'LatestVersion'
scriptType: InlineScript
Inline: |
./eng/scripts/Test-Code.ps1 `
-TestType 'Live' `
-Path $(PathToTest) `
-TestResultsPath '$(Build.ArtifactStagingDirectory)/testResults'
exit $LastExitCode
pwsh: true
workingDirectory: $(Build.SourcesDirectory)

The step needs to assign a value to the MCP_TEST_TRANSPORT environment variable as per McpTestUtilities.CreateMcpClientAsync()

bool useHttp = string.Equals(
Environment.GetEnvironmentVariable("MCP_TEST_TRANSPORT"),
"http",
StringComparison.OrdinalIgnoreCase);

Stdio setup that prints "MCP client initialized successfully":

output?.WriteLine("MCP client initialized successfully");

http setup that prints "HTTP test client initialized at {serverUrl}":

output?.WriteLine($"HTTP test client initialized at {serverUrl}");

Proof that the http job is spitting out setup output from LiveServerFixture along the branch that uses stdio, i.e., MCP client initialized successfully:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6694418&view=logs&j=5159808d-2ee1-5ad5-3b4c-ac54c933eeca&t=ede6e3df-33c6-5265-3117-059cd58c238d&l=34

Metadata

Metadata

Labels

bugSomething isn't workingneeds-team-attentionWorkflow: This issue needs attention from Azure service team or MCP team.remote-mcpserver-Azure.McpAzure.Mcp.Server

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions