Skip to content

[MCP] Resources capability: resources/list, read, templates/list (https:// + harper://) #616

Closed

Description

@kylebernhardy

Scope. Implement the MCP resources/ capability: resources/list, resources/read, resources/templates/list. App-exported resources use their canonical https://host:port/<path> URIs (resolved in-process via Resources.getMatch(url), no outbound HTTP); synthetic resources use the harper:// scheme (harper://schema/{db}/{table}, harper://openapi, harper://about, harper://operations).

Design reference. Sections "URI schemes: https:// (default for app) and harper:// (synthetic only)" and "MCP resources/ capability" in #465.

Acceptance criteria

  • resources/list enumerates resources the authenticated user can access (RBAC-filtered against the role permission walk used in [MCP] Tool registry + class-level introspection + RBAC-aware tools/list filtering #615).
  • resources/read for an https://... URI dispatches through Resources.getMatch(url) in-process; never makes an outbound HTTP request.
  • harper://schema/{db}/{table} reads Table.attributes, filters by the user's attribute_permissions.
  • harper://openapi returns the existing generateJsonApi() output (resources/openApi.ts), RBAC-filtered.
  • harper://about returns server version, profile, enabled features.
  • harper://operations (operations profile only) returns the user-filtered operations catalog with JSON Schemas.
  • resources/templates/list advertises both URI templates (the https://... template and harper://schema/{database}/{table}).
  • Server advertises resources.listChanged: true in initialize capabilities. subscribe is NOT advertised in v1.
  • Unit + integration tests cover both URI schemes and RBAC filtering.

Out of scope. resources/subscribe (v2). Schema-change notifications (resources/list_changed) ship in #619.

Stacks on. #614 (transport).

Branch & PR conventions

Smoke test

curl -sS -X POST http://localhost:9925/mcp ... \
  -d '{"jsonrpc":"2.0","id":3,"method":"resources/read","params":{"uri":"harper://schema/shop/product"}}'
# Expected: contents[0] with mimeType application/json and a JSON body containing
# attributes, primaryKey, relationships, with attribute_permissions applied.

Tracking. Part of #465. Sub-issue #4 of 11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpModel Context Protocol (MCP) server: protocol, profiles, stdio CLIarea:rest-apiREST API, resources, routingenhancementNew feature or requestfeature:mcp-v1Rollout of native MCP server v1 (HarperFast/harper#465). Removed when v1 closes.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions