Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,5 @@
/src/carbon/ @itiinani

/src/amlfs/ @Aman-Jain-14 @amajai @mawhite @brpanask @tibanyas

/src/azext_mcp/ @ReaNAiveD
8 changes: 8 additions & 0 deletions src/mcp-server/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:

Release History
===============

1.0.0b1
++++++
* Initial release.
5 changes: 5 additions & 0 deletions src/mcp-server/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Microsoft Azure CLI 'mcp' Extension
==========================================

This package is for the 'mcp' extension.
i.e. 'az mcp'
28 changes: 28 additions & 0 deletions src/mcp-server/azext_mcp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader

from azext_mcp._help import helps # pylint: disable=unused-import


class McpCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
mcp_custom = CliCommandType(operations_tmpl='azext_mcp.custom#{}')
super(McpCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=mcp_custom)

def load_command_table(self, args):
from azext_mcp.commands import load_command_table
load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
from azext_mcp._params import load_arguments
load_arguments(self, command)


COMMAND_LOADER_CLS = McpCommandsLoader
18 changes: 18 additions & 0 deletions src/mcp-server/azext_mcp/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from knack.help_files import helps # pylint: disable=unused-import


helps['mcp'] = """
type: group
short-summary: CLI as local MCP servers.
"""

helps['mcp up'] = """
type: command
short-summary: local MCP server up.
"""
20 changes: 20 additions & 0 deletions src/mcp-server/azext_mcp/_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long

from knack.arguments import CLIArgumentType


def load_arguments(self, _):

with self.argument_context('mcp') as c:
pass

with self.argument_context('mcp up') as c:
# c.argument('port', required=False, default=8080, type=int, help='MCP server port.')
c.argument('disable_elicit', action='store_true',
help='Disable elicit confirmation for destructive commands. '
'Use with caution as it may lead to unintended actions.')
pass
4 changes: 4 additions & 0 deletions src/mcp-server/azext_mcp/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.57.0"
}
Loading
Loading