Skip to main content
Glama

Azure MCP Server

Official
MIT License
1,161
  • Linux
  • Apple
NpxTests.cs2.33 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics; using AzureMcp.Tests.Client.Helpers; using Xunit; namespace AzureMcp.Core.LiveTests; public class NpxTests : IClassFixture<LiveTestSettingsFixture> { private readonly LiveTestSettings _settings; public NpxTests(LiveTestSettingsFixture fixture) { _settings = fixture.Settings; if (string.IsNullOrEmpty(_settings.TestPackage)) { Assert.Skip("Can only test packages "); } } [Fact] public async Task Help_command_should_return_help() { var outputLines = await RunCommand("--help"); var concatenatedOutput = string.Join(Environment.NewLine, outputLines.Output); Assert.NotEmpty(concatenatedOutput); Assert.Contains("azmcp [command] [options]", concatenatedOutput); } private async Task<(string[] Output, string[] Error, int ExitCode)> RunCommand(params string[] arguments) { var shell = OperatingSystem.IsWindows() ? "cmd.exe" : "/bin/sh"; var shellArgument = OperatingSystem.IsWindows() ? "/c" : "-c"; // Construct the npx command var npxCommand = $"npx -y {_settings.TestPackage} {string.Join(" ", arguments)}"; var processStartInfo = new ProcessStartInfo { FileName = shell, ArgumentList = { shellArgument, npxCommand }, RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false, CreateNoWindow = true }; using var process = new Process { StartInfo = processStartInfo }; process.Start(); var output = new List<string>(); process.OutputDataReceived += (sender, e) => { if (e.Data != null) { output.Add(e.Data); } }; process.BeginOutputReadLine(); var error = new List<string>(); process.ErrorDataReceived += (sender, e) => { if (e.Data != null) { error.Add(e.Data); } }; process.BeginErrorReadLine(); await process.WaitForExitAsync(); return (output.ToArray(), error.ToArray(), process.ExitCode); } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Azure/azure-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server