Add MCP server management commands to Agent 365 CLI#6
Merged
sellakumaran merged 2 commits intomainfrom Nov 14, 2025
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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
DevelopMcpCommandwith subcommands: list-environments, list-servers, publish, unpublish, approve, and block - Implemented
Agent365ToolingServicefor 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 |
src/Microsoft.Agents.A365.DevTools.Cli/Models/PublishMcpServerRequest.cs
Show resolved
Hide resolved
src/Microsoft.Agents.A365.DevTools.Cli/Commands/DevelopMcpCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Agents.A365.DevTools.Cli/Commands/DevelopMcpCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Agents.A365.DevTools.Cli/Commands/DevelopMcpCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Agents.A365.DevTools.Cli/Services/Agent365ToolingService.cs
Show resolved
Hide resolved
src/Microsoft.Agents.A365.DevTools.Cli/Services/Agent365ToolingService.cs
Show resolved
Hide resolved
src/Microsoft.Agents.A365.DevTools.Cli/Services/Agent365ToolingService.cs
Show resolved
Hide resolved
src/Microsoft.Agents.A365.DevTools.Cli/Services/Agent365ToolingService.cs
Show resolved
Hide resolved
src/Microsoft.Agents.A365.DevTools.Cli/Services/Helpers/JsonDeserializationHelper.cs
Outdated
Show resolved
Hide resolved
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.
mengyimicro
approved these changes
Nov 14, 2025
tmlsousa
approved these changes
Nov 14, 2025
tmlsousa
approved these changes
Nov 14, 2025
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduced the
develop-mcpcommand 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-runand--configoptions.Updated
README.mdandDEVELOPER.mdwith examples and usage details for the new commands. Refactored the CLI codebase to include a newDevelopMcpCommandclass and models for environments and servers. ImplementedAgent365ToolingServicefor 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. IntroducedJsonDeserializationHelperfor 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