barrel_server_mcp_resources (barrel_server v1.0.1)

View Source

The MCP resource templates: barrel://db/{db} (database info), barrel://db/{db}/doc/{id} (a document body), and barrel://db/{db}/live/{sub} (the materialized snapshot of a live query, see barrel_server_mcp_live).

Resource read handlers are arity 1 in the framework: no auth context reaches them, so the db and doc templates expose reads to ANY authenticated MCP caller by URI. Deployments that hand out capability tokens should set {barrel_server, mcp, #{resources => live_only}}, which registers only the live template: live URIs carry a 16-byte random sub id, so possession of the URI is the capability.

Summary

Functions

db_resource(_)

doc_resource(_)

live_resource(_)

register_all()

unregister_all()