Skip to content

Add MCP server management commands to Agent 365 CLI#6

Merged
sellakumaran merged 2 commits intomainfrom
users/sellak/developMcp
Nov 14, 2025
Merged

Add MCP server management commands to Agent 365 CLI#6
sellakumaran merged 2 commits intomainfrom
users/sellak/developMcp

Conversation

@sellakumaran
Copy link
Contributor

@sellakumaran sellakumaran commented Nov 14, 2025

Introduced the develop-mcp command for managing MCP servers in Dataverse environments. Added subcommands for listing environments and servers, publishing, unpublishing, approving, and blocking MCP servers. All commands support --dry-run and --config options.

Updated README.md and DEVELOPER.md with examples and usage details for the new commands. Refactored the CLI codebase to include a new DevelopMcpCommand class and models for environments and servers. Implemented Agent365ToolingService for API interactions with detailed logging and error handling.

Enhanced configuration and logging in install-cli.ps1. Added regression and unit tests to ensure Azure CLI-style parameters, dry-run functionality, and consistent option patterns. Introduced JsonDeserializationHelper for handling double-serialized JSON responses. Updated constants and utilities for streamlined configuration.

Improved developer experience with better error handling and documentation. Ensured compliance with Azure CLI patterns and added comprehensive logging for debugging and audit trails.

Agent 365 CLI installed successfully. Run 'a365 --help' to verify installation.
a365 develop-mcp -?
[19:22:01 INF] ==========================================================
[19:22:01 INF] Agent 365 CLI - Command: develop-mcp
[19:22:01 INF] Version: 1.0.2-preview+24a2d481bd
[19:22:01 INF] Started at: 11/13/2025 19:22:01
[19:22:01 INF] ==========================================================
[19:22:01 INF]
Description:
Manage MCP servers in Dataverse environments

Usage:
Microsoft.Agents.A365.DevTools.Cli develop-mcp [command] [options]

Options:
-c, --config Configuration file path [default: a365.config.json]
-v, --verbose Enable verbose logging
-?, -h, --help Show help and usage information

Commands:
list-environments List all Dataverse environments available for MCP server management
list-servers List MCP servers in a specific Dataverse environment
publish Publish an MCP server to a Dataverse environment
unpublish Unpublish an MCP server from a Dataverse environment
approve Approve an MCP server
block Block an MCP server

Introduced the `develop-mcp` command for managing MCP servers in
Dataverse environments. Added subcommands for listing environments
and servers, publishing, unpublishing, approving, and blocking MCP
servers. All commands support `--dry-run` and `--config` options.

Updated `README.md` and `DEVELOPER.md` with examples and usage
details for the new commands. Refactored the CLI codebase to include
a new `DevelopMcpCommand` class and models for environments and
servers. Implemented `Agent365ToolingService` for API interactions
with detailed logging and error handling.

Enhanced configuration and logging in `install-cli.ps1`. Added
regression and unit tests to ensure Azure CLI-style parameters,
dry-run functionality, and consistent option patterns. Introduced
`JsonDeserializationHelper` for handling double-serialized JSON
responses. Updated constants and utilities for streamlined
configuration.

Improved developer experience with better error handling and
documentation. Ensured compliance with Azure CLI patterns and added
comprehensive logging for debugging and audit trails.
Copilot AI review requested due to automatic review settings November 14, 2025 03:21
@sellakumaran sellakumaran requested a review from a team as a code owner November 14, 2025 03:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces comprehensive MCP (Model Context Protocol) server management capabilities to the Agent 365 CLI. The implementation adds a new develop-mcp command with six subcommands for managing MCP servers in Dataverse environments, following Azure CLI patterns with named options, dry-run support, and interactive prompts.

Key Changes:

  • Added DevelopMcpCommand with subcommands: list-environments, list-servers, publish, unpublish, approve, and block
  • Implemented Agent365ToolingService for API interactions with authentication, logging, and error handling
  • Created model classes for Dataverse environments and MCP servers with JSON serialization support

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 32 comments.

Show a summary per file
File Description
DevelopMcpCommandTests.cs Comprehensive unit tests validating command structure, options, aliases, and Azure CLI compliance
DevelopMcpCommandRegressionTests.cs Regression tests ensuring dry-run functionality, parameter acceptance, and service integration
IAgent365ToolingService.cs Service interface defining methods for environment/server listing, publishing, unpublishing, approving, and blocking
Agent365ToolingService.cs Full service implementation with HTTP communication, authentication, double-serialization handling, and detailed logging
JsonDeserializationHelper.cs Helper utility for handling both normal and double-serialized JSON responses from APIs
PublishMcpServerRequest.cs Request model for publishing MCP servers with alias and display name
PublishMcpServerResponse.cs Response model with status, message, and success indicator
DataverseMcpServer.cs MCP server model with properties, validation, and response wrapper class
DataverseEnvironment.cs Dataverse environment model with properties, validation, and response wrapper class
DevelopMcpCommand.cs Main command implementation with six subcommands, interactive prompts, dry-run support, and comprehensive logging
Program.cs Service registration and command integration into CLI root command
McpConstants.cs Cleanup of unused MCP server base URL helper method
DEVELOPER.md Developer documentation with command usage, examples, and key features
README.md User-facing documentation with MCP server management examples
install-cli.ps1 Enhanced installation script with improved path handling and build configuration

mengyimicro
mengyimicro previously approved these changes Nov 14, 2025
Enhanced `a365 develop-mcp` commands with a `--verbose` option for detailed logging and improved input validation via a new `InputValidator` class. Simplified configuration handling by making `--config` optional and defaulting to production.

Refactored `Agent365ToolingService` to use constructor-injected environments and adjusted logging levels for better debugging. Improved error handling for API responses and JSON deserialization.

Updated documentation to reflect new features and architecture principles. Added tests for `--verbose` and ensured compliance with the MIT License. General code cleanup for consistency and maintainability.
@sellakumaran sellakumaran merged commit 2d5699b into main Nov 14, 2025
2 checks passed
sellakumaran added a commit that referenced this pull request Feb 27, 2026
* Add MCP server management commands to Agent 365 CLI

Introduced the `develop-mcp` command for managing MCP servers in
Dataverse environments. Added subcommands for listing environments
and servers, publishing, unpublishing, approving, and blocking MCP
servers. All commands support `--dry-run` and `--config` options.

Updated `README.md` and `DEVELOPER.md` with examples and usage
details for the new commands. Refactored the CLI codebase to include
a new `DevelopMcpCommand` class and models for environments and
servers. Implemented `Agent365ToolingService` for API interactions
with detailed logging and error handling.

Enhanced configuration and logging in `install-cli.ps1`. Added
regression and unit tests to ensure Azure CLI-style parameters,
dry-run functionality, and consistent option patterns. Introduced
`JsonDeserializationHelper` for handling double-serialized JSON
responses. Updated constants and utilities for streamlined
configuration.

Improved developer experience with better error handling and
documentation. Ensured compliance with Azure CLI patterns and added
comprehensive logging for debugging and audit trails.

* Add verbose logging, input validation, and refactoring

Enhanced `a365 develop-mcp` commands with a `--verbose` option for detailed logging and improved input validation via a new `InputValidator` class. Simplified configuration handling by making `--config` optional and defaulting to production.

Refactored `Agent365ToolingService` to use constructor-injected environments and adjusted logging levels for better debugging. Improved error handling for API responses and JSON deserialization.

Updated documentation to reflect new features and architecture principles. Added tests for `--verbose` and ensured compliance with the MIT License. General code cleanup for consistency and maintainability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants