Skip to content

refactor(gateway): render MCP_SERVERS as name=url aliases - #236

Merged
edenreich merged 1 commit into
mainfrom
refactor/issue-234-20260924-2111
Sep 24, 2026
Merged

edenreich merged 1 commit into
mainfrom
refactor/issue-234-20260924-2111

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Summary

MCP_SERVERS is now rendered as name=url entries so the gateway namespaces tools as mcp_<name>_<tool> with stable, explicit aliases instead of host-derived ones.

  • assembleMCPServerURLs -> assembleMCPServerEntries: static spec.mcp.servers[] render as <name>=<url>, and MCPs found via spec.mcp.serviceDiscovery render as <metadata.name>=<status.url> (the scope addition raised in the issue thread - this is what shortens mcp_filesystem-service_inference-gateway_svc_cluster_local_create_directory to mcp_filesystem_create_directory). Dedupe on URL and sorting for determinism are unchanged.
  • Alias validation shared by both paths: must match ^[a-z0-9_-]+$, be unique across static and discovered servers, and not be the reserved alias tools. A name failing any rule is logged and that entry falls back to a bare URL, so the server keeps working with a host-derived alias rather than disappearing from the gateway config.
  • status.mcpServers keeps mirroring MCP_SERVERS, so it now shows name=url entries too.
  • CRD field docs (mcp.servers[].name, mcp.servers, mcp.serviceDiscovery, status.mcpServers), regenerated manifests, README and the two Gateway examples all state that the name becomes the tool namespace.

No CRD pattern was added to mcp.servers[].name: that would reject existing Gateways whose server names are valid today (uppercase, dots), so validation is runtime with a graceful fallback. Say the word if you would rather have it rejected at admission instead.

Verification

task fmt, task vet, task lint (0 issues), task test (all green). A new unit case covers invalid, reserved and duplicate names.

Downstream impact

inference-gateway/docs pages describing MCP_SERVERS / status.mcpServers need the name=url shape - [DOCS] ticket filed.

Closes #234

@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner September 24, 2026 21:18
@edenreich
edenreich merged commit 3bfb7ac into main Sep 24, 2026
1 check passed
@edenreich
edenreich deleted the refactor/issue-234-20260924-2111 branch September 24, 2026 21:28
inference-gateway-releaser Bot added a commit that referenced this pull request Sep 24, 2026
## [0.25.1](v0.25.0...v0.25.1) (2026-09-24)

### ♻️ Improvements

* **gateway:** render MCP_SERVERS as name=url aliases ([#236](#236)) ([3bfb7ac](3bfb7ac))

### 👷 CI

* **claude:** centralize claude.yml via reusable workflow ([#232](#232)) ([4d2a583](4d2a583))
* **deps:** bump github.com/onsi/ginkgo/v2 in the gomod group ([#218](#218)) ([5eb52ff](5eb52ff))
* **deps:** bump go.opentelemetry.io/otel/exporters/otlp/otlptrace ([#225](#225)) ([e681bae](e681bae))
* **deps:** bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc ([#227](#227)) ([5674492](5674492))
* **deps:** bump rancher/k3s from v1.36.4-k3s1 to v1.37.0-k3s1 in the docker group ([#228](#228)) ([343e738](343e738))
* **deps:** bump rancher/k3s in the docker group ([#219](#219)) ([50089f7](50089f7))
* **deps:** bump the gomod group with 3 updates ([#229](#229)) ([e016a01](e016a01))

### 📚 Documentation

* Document pre-commit hook and coverage command in AGENTS.md ([#224](#224)) ([aebbec0](aebbec0))

### 🔧 Miscellaneous

* **deps:** bump claude-code 2.1.245 -> 2.1.266 ([#220](#220)) ([09b15b8](09b15b8))
* **deps:** bump claude-code 2.1.266 -> 2.1.278 ([#230](#230)) ([114a61e](114a61e))
* **deps:** bump infer CLI v0.183.0 -> v0.192.0 ([#221](#221)) ([5186c52](5186c52))
* **deps:** bump infer CLI v0.192.0 -> v0.205.3 ([#231](#231)) ([099c939](099c939))
* **lint:** enforce Go import grouping and named imports ([#223](#223)) ([7ae0d6d](7ae0d6d))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.25.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Refactor MCP_SERVERS rendering to use server name as alias

1 participant