Skip to content

[Request]: allow additional Origins on an mcp mount #717

Closed

Description

@jimhoyd

Problem or use case

The mcp extension (0.6.1, #676/#685) admits a present Origin only when it exactly equals the site's --origin. urlcode-ai's single container serves several hostnames through one load balancer (api.urlcode.ai, which is --origin, plus urlcode.ai and mcp.urlcode.ai), and the documented MCP endpoint is https://urlcode.ai/mcp. A browser MCP client on the documented endpoint's own origin now gets 403. Our previous hand-written server allowed a configured list.

Not a problem for us today, since no browser client exists, but it rules out any browser client on an alias hostname.

Proposed behavior and alternatives

  • An optional per-server allowedOrigins list in the extension config. The canonical --origin is always allowed, and a missing Origin is still admitted.
  • Alternative: a core-level list of additional site origins that same-origin checks (mcp, forms, store) all honor.

Activity

  1. added
    enhancement
    needs-decision
    extension
    on Sep 25, 2026
  2. jimhoyd commented on Sep 25, 2026

    @jimhoyd
    CollaboratorAuthor

    Decision (owner, 2026-09-25): one site-wide list of additional origins, set by the operator.

    • It is configured where the canonical --origin is configured today (a serve/deployment option), not in route or extension YAML. AGENTS.md: no provider infrastructure settings in route YAML.
    • Core validates the entries (absolute https: origins, or http://localhost in dev; no paths or wildcards; bounded count) and exposes them to extensions next to origin through the generic extension context. Core does not learn any extension name.
    • Every same-origin check honours the list: mcp (mcp.ts ~515), forms, store, auth and admin. A missing Origin keeps its current per-extension treatment. The canonical origin stays the one used for generated absolute URLs.
    • Tests: an alias origin is admitted by each extension's check, an unlisted origin is still refused, and invalid entries are refused at startup. Document it on the deployment/operations page and in each extension's README section on origin checks.

    Removing needs-decision.


    Generated by Claude Code

  3. removed
    needs-decision
    on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementextension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions