Skip to content

fix: hardcode transport.url port for MCP Registry validation#58

Merged
aliasunder merged 1 commit into
mainfrom
claude/fix-registry-transport-url
May 20, 2026
Merged

fix: hardcode transport.url port for MCP Registry validation#58
aliasunder merged 1 commit into
mainfrom
claude/fix-registry-transport-url

Conversation

@aliasunder
Copy link
Copy Markdown
Owner

Summary

mcp-publisher publish failed validation:

packages[0].transport.url (semantic)
invalid package transport URL: template variables in URL http://localhost:{PORT}/mcp reference undefined variables.
Available variables: [MCP_AUTH_TOKEN PUBLIC_URL MEMORY_DIR TZ LOG_LEVEL LOG_DIR LOG_RETENTION_DAYS PROTECTED_PATHS ORPHAN_EXCLUDE_FOLDERS SERVICE_DOCUMENTATION_URL -p -v -v]

The MCP Registry only allows a transport.url template variable to reference env-var names or argument names — not an argument's local variables. {PORT} existed only as the -p argument's local variable, so it's "undefined" for the URL.

Fix

  • transport.url: http://localhost:{PORT}/mcphttp://localhost:8000/mcp
  • -p runtime arg: {PORT}:8000 (with a PORT variable) → fixed 8000:8000

The container always listens on 8000 (Dockerfile ENV PORT=8000), so the hardcoded URL is correct. Hardcoding the -p mapping too keeps the published URL consistent with the port mapping (no override footgun). Host-port customization via the registry wasn't actually supportable anyway, since the URL can't follow a templated port.

This is registry-metadata only — no image rebuild/release needed (packages[0].version stays 0.15.4).

Validation

  • jq: valid; transport.url has no remaining {templates}
  • prettier clean

Generated by Claude Code

mcp-publisher rejected packages[0].transport.url: a template variable
in the URL may only reference env-var names or argument names, NOT an
argument's local variables. {PORT} existed only as the -p argument's
local variable, so the registry validator saw it as undefined.

Hardcoded the transport URL to http://localhost:8000/mcp and the -p
mapping to 8000:8000 (dropping the PORT variable). The container always
listens on 8000 (Dockerfile ENV), so this is correct — and hardcoding
both keeps the published URL consistent with the port mapping (no
override footgun). Host-port customization wasn't meaningfully
supported anyway, since the registry URL can't follow a templated port.
@aliasunder aliasunder merged commit 809e987 into main May 20, 2026
5 checks passed
@aliasunder aliasunder deleted the claude/fix-registry-transport-url branch May 20, 2026 18:56
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