Skip to main content
Glama

Azure MCP Server

Official
MIT License
1,161
  • Linux
  • Apple
BaseCosmosCommand.cs1.32 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; using AzureMcp.Core.Commands; using AzureMcp.Core.Commands.Subscription; using AzureMcp.Cosmos.Options; using Microsoft.Azure.Cosmos; namespace AzureMcp.Cosmos.Commands; public abstract class BaseCosmosCommand< [DynamicallyAccessedMembers(TrimAnnotations.CommandAnnotations)] TOptions> : SubscriptionCommand<TOptions> where TOptions : BaseCosmosOptions, new() { protected readonly Option<string> _accountOption = CosmosOptionDefinitions.Account; protected override void RegisterOptions(Command command) { base.RegisterOptions(command); command.AddOption(_accountOption); } protected override TOptions BindOptions(ParseResult parseResult) { var options = base.BindOptions(parseResult); options.Account = parseResult.GetValueForOption(_accountOption); return options; } protected override string GetErrorMessage(Exception ex) => ex switch { CosmosException cosmosEx => cosmosEx.Message, _ => base.GetErrorMessage(ex) }; protected override int GetStatusCode(Exception ex) => ex switch { CosmosException cosmosEx => (int)cosmosEx.StatusCode, _ => base.GetStatusCode(ex) }; }

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