Repository navigation
[MCP] Resources capability: resources/list, read, templates/list (https:// + harper://) #616
Copy link
Copy link
Closed
Labels
area:mcpModel Context Protocol (MCP) server: protocol, profiles, stdio CLIModel Context Protocol (MCP) server: protocol, profiles, stdio CLIarea:rest-apiREST API, resources, routingREST API, resources, routingenhancementNew feature or requestNew feature or requestfeature:mcp-v1Rollout of native MCP server v1 (HarperFast/harper#465). Removed when v1 closes.Rollout of native MCP server v1 (HarperFast/harper#465). Removed when v1 closes.
Milestone
Description
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/listenumerates 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/readfor anhttps://...URI dispatches throughResources.getMatch(url)in-process; never makes an outbound HTTP request. -
harper://schema/{db}/{table}readsTable.attributes, filters by the user'sattribute_permissions. -
harper://openapireturns the existinggenerateJsonApi()output (resources/openApi.ts), RBAC-filtered. -
harper://aboutreturns server version, profile, enabled features. -
harper://operations(operations profile only) returns the user-filtered operations catalog with JSON Schemas. -
resources/templates/listadvertises both URI templates (thehttps://...template andharper://schema/{database}/{table}). - Server advertises
resources.listChanged: trueininitializecapabilities.subscribeis 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
- Branch:
feat/mcp-resources - PR base:
main(after [MCP] Streamable HTTP transport: session, lifecycle, Origin, contentTypes reuse #614 merges; can be parallel with [MCP] Tool registry + class-level introspection + RBAC-aware tools/list filtering #615). - Closes this issue; references Expose Operations (API) through an MCP Wrapper #465.
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.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:mcpModel Context Protocol (MCP) server: protocol, profiles, stdio CLIModel Context Protocol (MCP) server: protocol, profiles, stdio CLIarea:rest-apiREST API, resources, routingREST API, resources, routingenhancementNew feature or requestNew feature or requestfeature:mcp-v1Rollout of native MCP server v1 (HarperFast/harper#465). Removed when v1 closes.Rollout of native MCP server v1 (HarperFast/harper#465). Removed when v1 closes.
Type
Fields
Priority
None yet
Activity
test(mcp): integration test uses resources/list as unknown-method probe
chore(mcp): address review feedback on toolRegistry
feat(mcp): resources capability — list, read, templates/list (#616)
test(mcp): use definitely-unknown method as the -32601 probe
feat(mcp): resources capability — list, read, templates/list (#616)
test(mcp): use definitely-unknown method as the -32601 probe