Skip to content

[Request]: declarative MCP route handler #573

Closed

Description

@jimhoyd

Problem or use case

Evidence comes from a first-party hosted URLCode service (private repository) built on core 0.5.9. It had to hand-write the code named below. Serving MCP over HTTP took a 232-line trusted function of hand-written JSON-RPC (initialize, tools/list, tools/call, error codes, request-id handling), and it got details wrong (JSON-RPC id used as the request id). Core already ships an MCP server for authoring, so the protocol code exists.

Proposed behavior and alternatives

A handler that declares tools as named routes/functions with input schemas (reusing request.body.schema), leaving JSON-RPC framing, capability negotiation, errors and logging to the host.

Activity

  1. added
    enhancement
    ai-first
    needs-decision
    on Sep 23, 2026
  2. jimhoyd commented on Sep 24, 2026

    @jimhoyd
    CollaboratorAuthor

    Triage decision: add this as an optional MCP extension, not a core handler. The extension owns JSON-RPC framing, protocol/version negotiation, request IDs, input schemas, and host-owned error behavior; project declarations name only bounded tools/routes. It must preserve core’s dependency boundary, keep operator configuration outside route YAML, and provide focused interoperability/fixture coverage. Leave open for extension design and implementation; removing needs-decision.

  3. removed
    needs-decision
    on Sep 24, 2026
  4. jimhoyd commented on Sep 24, 2026

    @jimhoyd
    CollaboratorAuthor

    Implemented in PR #625: a new optional operator-installed extension, @jimhoyd/urlcode-mcp, per the triage decision — JSON-RPC 2.0 framing, protocol version negotiation, exact request-id round-tripping (the specific bug this issue's evidence reported), and initialize/ping/tools/list/tools/call all owned by the extension; project YAML declares only bounded tools with an input schema, reusing core's request.body.schema validator rather than a second implementation.

    Scoped down from full MCP spec/transport parity to keep the PR safe and reviewable — a minimal, correct core plus focused interoperability tests. Deferred and filed as follow-ups:

    See PR #625 for the full design record.

  5. jimhoyd commented on Sep 24, 2026

    @jimhoyd
    CollaboratorAuthor

    Implemented in #625: new operator-installed @jimhoyd/urlcode-mcp extension package (declarative MCP tool server, JSON-RPC 2.0), following the forms/store extension conventions rather than a core route handler. SSE/streaming transport, session resumption, batching, resources/prompts, outputSchema, pagination and promotion to init --with/signed bundles were deliberately deferred and tracked separately in #626 and #629.

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

    ai-firstenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions