Skip to content

fix the issue when configuring remote MCP servers, hint for naming#380

Merged
peterj merged 4 commits intomainfrom
peterj/fixforremotemcp
Mar 20, 2026
Merged

fix the issue when configuring remote MCP servers, hint for naming#380
peterj merged 4 commits intomainfrom
peterj/fixforremotemcp

Conversation

@peterj
Copy link
Copy Markdown
Contributor

@peterj peterj commented Mar 18, 2026

Description

fix the issue when configuring remote MCP servers (use the mcp instead of sse as it tries to do a tls handshake), add a hint for incorrect naming of remote servers + extract the actual errors, instead of showing the JSON.

e.g.:

# Before
Error: failed to publish to registry: unexpected status: 400 Bad Request, {"title":"Bad Request","status":400,"detail":"Failed to create server","errors":[{"message":"remote URL https://servereverything.dev/mcp does not match namespace org/servereverything.dev: invalid namespace format: namespace must use reverse-DNS notation (e.g., \"dev.servereverything\" for servereverything.dev)"}]}

# After

Error: failed to publish to registry: 400 Bad Request: remote URL https://servereverything.dev/mcp does not match namespace org/servereverything.dev: invalid namespace format: namespace must use reverse-DNS notation (e.g., "dev.servereverything" for servereverything.dev)

Change Type

/kind fix

Changelog

fix configuring/running remote MCP servers

Copilot AI review requested due to automatic review settings March 18, 2026 22:37
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

This PR improves remote MCP server handling in the local agent-gateway configuration and makes CLI/API client errors more human-readable by extracting meaningful messages from Huma-style JSON error responses.

Changes:

  • Switch local agent-gateway config generation for remote MCP servers from sse targets to mcp targets (to avoid incorrect TLS-handshake behavior).
  • Add reverse-DNS “hint” messaging when remote URL hostnames don’t match an invalid/non-reverse-DNS namespace.
  • Extract and display server-provided API error messages (instead of dumping raw JSON) and enhance HTTP status parsing.

Reviewed changes

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

Show a summary per file
File Description
internal/registry/validators/validators.go Improves namespace/remote URL mismatch errors with a reverse-DNS hint helper.
internal/registry/platforms/local/deployment_adapter_local_platform.go Builds remote MCP target URLs and emits mcp targets for remote servers.
internal/registry/platforms/local/deployment_adapter_local_platform_test.go Adds unit tests for remote MCP URL building behavior.
internal/client/client.go Extracts human-readable API error messages and broadens HTTP status detection.
internal/client/client_test.go Adds tests for API error extraction and HTTP status parsing.

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

@peterj peterj force-pushed the peterj/fixforremotemcp branch from 8e9b978 to 0c47464 Compare March 19, 2026 16:46
@peterj peterj requested review from inFocus7 and timflannagan March 19, 2026 18:51
Copy link
Copy Markdown
Collaborator

@inFocus7 inFocus7 left a comment

Choose a reason for hiding this comment

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

haven't verified locally but the changes code-wise lgtm, left a comment, but that's about it

@peterj peterj force-pushed the peterj/fixforremotemcp branch from 1b0eb2c to cdbf811 Compare March 20, 2026 00:23
@peterj peterj added this pull request to the merge queue Mar 20, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 20, 2026
peterj added 4 commits March 20, 2026 14:09
…xtract actual errors)

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
@peterj peterj force-pushed the peterj/fixforremotemcp branch from 1cf420d to 2a5a8b2 Compare March 20, 2026 21:12
@peterj peterj enabled auto-merge March 20, 2026 21:12
@peterj peterj added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit 6858b81 Mar 20, 2026
8 checks passed
@peterj peterj deleted the peterj/fixforremotemcp branch March 20, 2026 21:44
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.

3 participants