Skip to content

Fix resolve for local agent build, it wasn't using auth so failed when an agent had MCP, Prompt, or Skill#440

Closed
josh-pritchard wants to merge 1 commit intoagentregistry-dev:mainfrom
josh-pritchard:josh/439
Closed

Fix resolve for local agent build, it wasn't using auth so failed when an agent had MCP, Prompt, or Skill#440
josh-pritchard wants to merge 1 commit intoagentregistry-dev:mainfrom
josh-pritchard:josh/439

Conversation

@josh-pritchard
Copy link
Copy Markdown
Collaborator

Description

Resolve #439

Change Type

/kind fix

Changelog

Fix resolve for local agent build, it wasn't using auth so failed when an agent had MCP, Prompt, or Skill

Additional Notes

Copy link
Copy Markdown
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

Fixes authenticated registry resolution during arctl agent run so registry-backed MCP servers (and prompts) can be fetched from registries that require auth.

Changes:

  • Inject the authenticated internal/client.Client into agent manifest resolution via agentutils.SetRegistryAPIClient.
  • Update MCP server resolution to use Client.GetServerVersion instead of an unauthenticated registry client.
  • Align registry server translation to accept the API’s apiv0.ServerJSON type directly.

Reviewed changes

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

File Description
pkg/cli/root.go Stores the authenticated API client in agent utils during CLI pre-run.
internal/cli/agent/utils/registry_translator.go Switches translation input type to apiv0.ServerJSON and simplifies mapping.
internal/cli/agent/utils/registry_resolver.go Uses the authenticated API client for resolving registry MCP servers and prompts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +104 to +109
apiClient := registryAPIClient
if apiClient == nil {
apiClient = client.NewClient(registryURL, "")
}

serverResp, err := apiClient.GetServerVersion(serverName, serverVersion)
Comment on lines 235 to 251
@@ -230,10 +245,9 @@ func ResolveManifestPrompts(manifest *models.AgentManifest, verbose bool) ([]com
i, ref.Name, promptName, promptVersion, registryURL)
}

apiClient, ok := clients[registryURL]
if !ok {
apiClient := registryAPIClient
if apiClient == nil {
apiClient = client.NewClient(registryURL, "")
clients[registryURL] = apiClient
}
Comment on lines +248 to 251
apiClient := registryAPIClient
if apiClient == nil {
apiClient = client.NewClient(registryURL, "")
clients[registryURL] = apiClient
}
@josh-pritchard
Copy link
Copy Markdown
Collaborator Author

This code is actually slated to be likely cleaned up with later refactor to remove imperative CLI. Merging this will enable some things i am doing but we don't need to be very critical.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

This pull request has been marked as stale due to no activity in the last 14 days. It will be closed in 3 days unless it is tagged "no stalebot" or other activity occurs.

@github-actions github-actions Bot added the stale label May 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

This pull request has been closed due to inactivity.

@github-actions github-actions Bot closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arctl agent run: registry-type MCP server resolution uses unauthenticated client

2 participants