Skip to content

fix: expose nacos mcp protocol and endpoint in imported config - #351

Merged
learnerjohn merged 2 commits into
higress-group:mainfrom
wzlee:fix/nacos-mcp-protocol-and-endpoint
Oct 19, 2026
Merged

learnerjohn merged 2 commits into
higress-group:mainfrom
wzlee:fix/nacos-mcp-protocol-and-endpoint

Conversation

@wzlee

@wzlee wzlee commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

📝 Description

Nacos-imported MCP products previously omitted normalized protocol, domain, and path fields, causing HiMarket to fall back to stdio and hide the remote connection address.

This PR:

  • maps Nacos frontProtocol/protocol values to HiMarket MCP protocol types;
  • resolves client-facing endpoints using Nacos semantics: REST-to-MCP uses frontend endpoints, while native MCP prefers frontend endpoints and falls back to backend endpoints;
  • preserves HTTP/HTTPS, normalizes endpoint paths, and prevents duplicate /sse suffixes;
  • replaces reflection-based endpoint parsing with typed McpEndpointInfo access;
  • adds regression coverage for endpoint selection, HTTPS, SSE path normalization, stdio fallback, and raw connection config.

🔗 Related Issues

No linked issue.

✅ Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change
  • Documentation update
  • Refactoring
  • Performance improvement
  • Test improvement

🧪 Testing

  • Targeted Nacos MCP tests pass (14 tests)
  • Full Maven test suite passes
  • Backend Spotless checks pass
  • Verified a clean merge with the latest main and reran the full Maven test suite

📋 Checklist

  • Code quality checks passed (./scripts/code-check.sh backend)
  • Code is self-reviewed
  • No breaking changes
  • Relevant tests added or updated

📊 Test Coverage

Added regression tests covering Nacos frontend/backend endpoint selection, HTTPS preservation, SSE path normalization, stdio fallback, and raw endpoint URL generation.

📚 Additional Notes

The original contributor commit still requires DCO sign-off before the PR can be merged.

wzlee and others added 2 commits October 10, 2026 14:00
Nacos-imported MCP products were serialized without protocol, domains or
path, so the portal fell back to stdio and rendered no connection address.

- read frontProtocol first, then protocol, and map the nacos values
  (mcp-sse, mcp-streamable) onto McpProtocolType
- fill mcpServerConfig.domains and path from the first backend endpoint
- replace the reflection-based endpoint parsing with typed access to
  McpEndpointInfo

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: zhaoh <yanyan.zh@alibaba-inc.com>
@learnerjohn
learnerjohn self-requested a review October 19, 2026 03:01
@learnerjohn
learnerjohn merged commit e069327 into higress-group:main Oct 19, 2026
12 of 15 checks passed
@wzlee
wzlee deleted the fix/nacos-mcp-protocol-and-endpoint branch October 30, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants