Skip to content

Server names containing "/" (all official-registry names) are not percent-encoded → registry Add returns HTTP 400 and server-detail UI 404s #598

Closed

Description

@algis-dumbris

Summary

Official MCP Registry server names are reverse-DNS identifiers that always contain a / (e.g. io.github.evidai/polymarket-guard). mcpproxy uses this name raw — un-percent-encoded — as (1) a URL path segment in the registry "add" API call, (2) a route segment in the web UI server-detail page, and (3) a filesystem path for the per-server log. Each breaks:

  1. Adding from a registry fails with HTTP 400.
  2. The server-detail page renders "404 Page Not Found".
  3. The per-server log file is written into an unintended nested directory.

The UI also displays the raw name instead of the registry's human-readable title.

Spec background

Per the official MCP Registry schema (2025-12-11), the server name is a reverse-DNS identifier — "Must contain exactly one forward slash separating namespace from server name" (^[a-zA-Z0-9.-]+/[a-zA-Z0-9._-]+$). Every official-registry name therefore contains a /. The Registry Aggregators guide states explicitly:

URL path parameters such as serverName … must be URL-encoded. For example, io.modelcontextprotocol/everything must be encoded as io.modelcontextprotocol%2Feverything.

There is also an optional title field that the schema says clients "MAY choose to use … for display purposes." So name is an identifier (not URL/path safe, not a label); title is the display string.

Refs: server.schema.json 2025-12-11; modelcontextprotocol.io/registry/registry-aggregators; modelcontextprotocol.io/registry/about

Symptom 1 — Add → HTTP 400

Clicking "Add to MCP" for any Official MCP Registry server issues (from the web UI, captured in http.log):

POST /api/v1/registries/Official MCP Registry/servers/io.github.evidai/polymarket-guard/add  → 400  (x3)

Both path params are interpolated raw: the registry name Official MCP Registry (spaces) and the server name io.github.evidai/polymarket-guard (slash). The unencoded / adds an extra path segment so the route can't match …/servers/{serverName}/add → 400. Because every official-registry name contains a /, this affects adding any of them.

Symptom 2 — server-detail UI → 404

Verified with a real browser (Playwright driving Chrome) against the three URL variants:

URL HTTP Rendered
/ui/servers/io.github.evidai/polymarket-guard (raw /) 200 "404 Page Not Found" (SPA router catch-all)
/ui/servers/everything-server (no /) 200 detail page renders (route matches)
/ui/servers/io.github.evidai%2Fpolymarket-guard (%2F) 200 route matches → detail page renders

The server (index.html) is served for all /ui/* paths (200), but the front-end router treats the unencoded / as an extra segment and falls through to the generic 404 page. Encoding the slash as %2F makes the route match. Fix: encodeURIComponent(name) when building detail links / routes (and decode on read).

Symptom 3 — filesystem

The per-server log for this server is written to:

~/Library/Logs/mcpproxy/server-io.github.evidai/polymarket-guard.log

i.e. the / in the name created a nested server-io.github.evidai/ directory rather than a single server-<name>.log file. The name should be sanitized/encoded when used as a filename key.

Expected

  • Percent-encode path parameters (both the registry name and the server name) in the registry add API call.
  • encodeURIComponent the server name in web-UI routes and links; decode when reading the route param.
  • Sanitize/encode the name when used as a filesystem key for logs.
  • Display the registry-provided title (fall back to name when absent) rather than rendering the raw identifier.

Environment

  • mcpproxy-go macOS app v0.37.0 (tray + web UI at 127.0.0.1:8080)
  • Source registry: "Official MCP Registry" (registry.modelcontextprotocol.io)
  • Example server: io.github.evidai/polymarket-guard

Repro

  1. In the web UI → Registries → Official MCP Registry, search any server and click "Add to MCP" → toast shows HTTP 400: bad request.
  2. With a server whose name contains / present, open …/ui/servers/<namespace>/<name> → "404 Page Not Found".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions