Skip to content

Add develop-mcp list-published-servers command - #504

Open
deepaligargms wants to merge 2 commits into
mainfrom
u/deepaligarg/addnewmgmttool
Open

deepaligargms wants to merge 2 commits into
mainfrom
u/deepaligarg/addnewmgmttool

Conversation

@deepaligargms

Copy link
Copy Markdown
Contributor

Add develop-mcp list-published-servers command

Merge gate: hold until the platform's GET /agents/dataverse/publishedMcpServers route is deployed to production. Until then the command gets a 404 and exits 1.

Summary

Adds a365 develop-mcp list-published-servers, which lists every MCP server published to tenant scope from the Dataverse environments the caller can access, with each server's approval status, in one call.

$ a365 develop-mcp list-published-servers
Starting list-published-servers operation...
Published MCP Servers:
======================
Contoso Sales
   Name: contoso-sales
   URL: https://agent365.svc.cloud.microsoft/agents/tenants/<tenant-id>/servers/contoso-sales
   Status: Approved
   Source Environment: Contoso Production
   Source Environment ID: <environment-id>
   Source Server Name: msdyn_ContosoSales
   Description: Sales pipeline tools
Listed 1 published MCP server(s)

Why

list-servers -e <env> shows one environment's Dataverse servers, not what is published to the tenant. To answer "what have I published, and is it approved?" you had to run it once per environment, and it still didn't show the tenant URL or approval status.

Behavior

  • There is no environment option; the platform limits results to environments the caller can access.
  • It uses the same scope as list-servers (AgentTools.ListMCPServers.All), so no new consent is needed.
  • Status is PendingApproval, Approved, or Blocked. Description is printed only when the server has one.
  • With no servers, it prints a message and exits 0. Any failure (sign-in, missing scope, platform error) logs the HTTP status and error body and exits 1. The platform call is all-or-nothing, so there are no partial results.
  • --dry-run makes no calls.

Testing

  • Full suite: 2315 passed, 12 skipped (already skipped before this change), 0 failed.
  • Command tests check every printed field in response order, the empty (exit 0) and failure (exit 1) paths, and dry-run. Model tests deserialize the route's exact JSON shape, including a null servers array.
  • Not yet run against a live tenant, because the route isn't deployed.

Notes for reviewers

  • Existing issue, not fixed here: list-servers exits 0 when its service call fails, which breaks the exit-code rule. Happy to fix it separately.
  • The Learn link #develop-mcp-list-published-servers in docs/commands/README.md lands at the top of the page until the Learn reference is updated.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 05:11
@deepaligargms
deepaligargms requested review from a team as code owners October 2, 2026 05:11
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The production endpoint is not deployed, and the new HTTP integration lacks service-level request and response tests.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds tenant-wide discovery of published MCP servers, including approval status and source environment.

Changes:

  • Adds the list-published-servers CLI command and platform API integration.
  • Introduces response models and command/model tests.
  • Updates command documentation and release notes.
File Description
CHANGELOG.md Adds the feature release note.
docs/​commands/​README.md Links the new command reference.
src/​DEVELOPER.md Documents usage for developers.
Commands/​DevelopMcpCommand.cs Registers and implements the command.
Models/​PublishedMcpServer.cs Defines published-server response models.
Models/​README.md Catalogs the new model.
Services/​Agent365ToolingService.cs Calls the published-servers endpoint.
Services/​IAgent365ToolingService.cs Exposes the new service operation.
Commands/​DevelopMcpCommandRegressionTests.cs Tests output, failure, empty, and dry-run paths.
Commands/​DevelopMcpCommandTests.cs Tests command registration and options.
Models/​PublishedMcpServersResponseTests.cs Tests response deserialization.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

}

/// <inheritdoc />
public async Task<PublishedMcpServersResponse?> ListPublishedServersAsync(CancellationToken cancellationToken = default)
Response is now { servers } with mcpServerName, status, sourceMcpServerName and
sourceEnvironmentId (MCP-Platform PR 3968 review).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 04:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The implemented model and output omit several fields promised by the documented command contract.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)

Comment on lines +411 to +414
logger.LogInformation("{McpServerName}", server.McpServerName ?? "Unknown");
logger.LogInformation(" Status: {Status}", server.Status ?? "Unknown");
logger.LogInformation(" Source MCP Server Name: {SourceMcpServerName}", server.SourceMcpServerName ?? "Unknown");
logger.LogInformation(" Source Environment ID: {SourceEnvironmentId}", server.SourceEnvironmentId ?? "Unknown");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants