Skip to content
Merged
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
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,34 @@ a365 query-entra instance-scopes
a365 develop --list
```

### MCP Server Management

Manage Model Context Protocol (MCP) servers in Dataverse environments. The CLI automatically uses the production environment unless a configuration file is specified with `--config`.

```bash
# List Dataverse environments
a365 develop-mcp list-environments

# List MCP servers in a specific environment
a365 develop-mcp list-servers -e "Default-12345678-1234-1234-1234-123456789abc"

# Publish an MCP server
a365 develop-mcp publish -e "Default-12345678-1234-1234-1234-123456789abc" -s "msdyn_MyMcpServer"

# Unpublish an MCP server
a365 develop-mcp unpublish -e "Default-12345678-1234-1234-1234-123456789abc" -s "msdyn_MyMcpServer"

# Approve/block MCP servers (global operations, no environment needed)
a365 develop-mcp approve -s "msdyn_MyMcpServer"
a365 develop-mcp block -s "msdyn_MyMcpServer"

# All commands support dry-run for safe testing
a365 develop-mcp publish -e "myenv" -s "myserver" --dry-run

# Use verbose output for detailed logging
a365 develop-mcp list-environments --verbose
```

---

## Multiplatform Deployment Support
Expand Down Expand Up @@ -283,6 +311,9 @@ a365 setup --help
a365 create-instance --help
a365 deploy --help
a365 develop --help
a365 develop-mcp --help
a365 query-entra --help
a365 config --help

```

Expand Down
11 changes: 9 additions & 2 deletions scripts/cli/install-cli.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
# This script installs the Agent 365 CLI from a local NuGet package in the publish folder.
# Usage: Run this script from the root of the extracted package (where publish/ exists)

# Get the repository root directory (two levels up from scripts/cli/)
$repoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
$projectPath = Join-Path $repoRoot 'src\Microsoft.Agents.A365.DevTools.Cli\Microsoft.Agents.A365.DevTools.Cli.csproj'

# Verify the project file exists
if (-not (Test-Path $projectPath)) {
Write-Error "ERROR: Project file not found at $projectPath"
exit 1
}

$projectPath = Join-Path $PSScriptRoot 'Microsoft.Agents.A365.DevTools.Cli\Microsoft.Agents.A365.DevTools.Cli.csproj'
$outputDir = Join-Path $PSScriptRoot 'nupkg'
if (-not (Test-Path $outputDir)) {
New-Item -ItemType Directory -Path $outputDir | Out-Null
Expand All @@ -17,7 +24,7 @@ if ($LASTEXITCODE -ne 0) {
exit 1
}
Write-Host "Packing CLI tool to $outputDir (Release configuration)..."
dotnet pack $projectPath -c Release -o $outputDir --no-build
dotnet pack $projectPath -c Release -o $outputDir --no-build -p:IncludeSymbols=false -p:TreatWarningsAsErrors=false
if ($LASTEXITCODE -ne 0) {
Write-Error "ERROR: dotnet pack failed. Check output above for details."
exit 1
Expand Down
80 changes: 78 additions & 2 deletions src/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ Microsoft.Agents.A365.DevTools.Cli/
│ ├─ CreateInstanceCommand.cs # a365 create-instance (identity, licenses, enable-notifications)
│ ├─ DeployCommand.cs # a365 deploy
│ ├─ QueryEntraCommand.cs # a365 query-entra (blueprint-scopes, instance-scopes)
│ └─ DevelopCommand.cs # a365 develop
│ ├─ DevelopCommand.cs # a365 develop
│ └─ DevelopMcpCommand.cs # a365 develop-mcp (MCP server management)
├─ Services/ # Business logic services
│ ├─ ConfigService.cs # Configuration management
│ ├─ DeploymentService.cs # Multiplatform Azure deployment
Expand Down Expand Up @@ -98,6 +99,81 @@ The CLI provides a `config` command for managing configuration:
- `a365 config init -c <file>` — Imports and validates a config file, then writes it to the standard location.
- `a365 config display` — Prints the current configuration.

### MCP Server Management Command

The CLI provides a `develop-mcp` command for managing Model Context Protocol (MCP) servers in Dataverse environments. The command follows a **minimal configuration approach** - it defaults to the production environment and only requires additional configuration when needed.

**Configuration Approach:**
- **Default Environment**: Uses "prod" environment automatically
- **Optional Config File**: Use `--config/-c` to specify custom environment from a365.config.json
- **Production First**: Optimized for production workflows with minimal setup
- **KISS Principle**: Avoids over-engineering common use cases

**Environment Management:**
- `a365 develop-mcp list-environments` — List all available Dataverse environments for MCP server management

**Server Management:**
- `a365 develop-mcp list-servers -e <environment-id>` — List MCP servers in a specific Dataverse environment
- `a365 develop-mcp publish -e <environment-id> -s <server-name>` — Publish an MCP server to a Dataverse environment
- `a365 develop-mcp unpublish -e <environment-id> -s <server-name>` — Unpublish an MCP server from a Dataverse environment

**Server Approval (Global Operations):**
- `a365 develop-mcp approve -s <server-name>` — Approve an MCP server
- `a365 develop-mcp block -s <server-name>` — Block an MCP server

**Key Features:**
- **Azure CLI Style Parameters:** Uses named options (`--environment-id/-e`, `--server-name/-s`) for better UX
- **Dry Run Support:** All commands support `--dry-run` for safe testing
- **Optional Configuration:** Use `--config/-c` only when non-production environment is needed
- **Production Default:** Works out-of-the-box with prod environment, no config file required
- **Verbose Logging:** Use `--verbose` for detailed output and debugging
- **Interactive Prompts:** Missing required parameters prompt for user input
- **Comprehensive Logging:** Detailed logging for debugging and audit trails

**Configuration Options:**
- **No Config (Default)**: Uses production environment automatically
- **With Config File**: `--config path/to/a365.config.json` to specify custom environment
- **Verbose Output**: `--verbose` for detailed logging and debugging information

**Examples:**

```bash
# Default usage (production environment, no config needed)
a365 develop-mcp list-environments

# List servers in a specific environment
a365 develop-mcp list-servers -e "Default-12345678-1234-1234-1234-123456789abc"

# Publish a server with alias and display name
a365 develop-mcp publish \
--environment-id "Default-12345678-1234-1234-1234-123456789abc" \
--server-name "msdyn_MyMcpServer" \
--alias "my-server" \
--display-name "My Custom MCP Server"

# Quick unpublish with short aliases
a365 develop-mcp unpublish -e "Default-12345678-1234-1234-1234-123456789abc" -s "msdyn_MyMcpServer"

# Approve a server (global operation)
a365 develop-mcp approve --server-name "msdyn_MyMcpServer"

# Test commands safely with dry-run
a365 develop-mcp publish -e "myenv" -s "myserver" --dry-run

# Use custom environment from config file (internal developers)
a365 develop-mcp list-environments --config ./dev-config.json

# Verbose output for debugging
a365 develop-mcp list-servers -e "myenv" --verbose
```

**Architecture Notes:**
- Uses constructor injection pattern for environment configuration
- Agent365ToolingService receives environment parameter via dependency injection
- Program.cs detects --config option and extracts environment from config file
- Defaults to "prod" when no config file is specified
- Follows KISS principles to avoid over-engineering common scenarios

## Inheritable Permissions: Best Practice

Agent 365 CLI and the Agent 365 platform are designed to use inheritable permissions on agent blueprints. This means:
Expand Down Expand Up @@ -495,7 +571,7 @@ dotnet test
Use the convenient script:

```bash
# From developer/ directory
# From scripts/cli directory
.\install-cli.ps1
```

Expand Down
Loading
Loading