diff --git a/reference/mcp/configuration.md b/reference/mcp/configuration.md index aefb03ed..220101af 100644 --- a/reference/mcp/configuration.md +++ b/reference/mcp/configuration.md @@ -152,7 +152,7 @@ mcp: ```javascript // resources.js const DAILY_LIMIT = 100; -export class McpQuota extends tables.QuotaCounter { +class McpQuota extends tables.QuotaCounter { static async allowMcpCall({ identity, tool, user, profile, sessionId }) { const id = identity ?? 'unknown'; const existing = await McpQuota.get(id); @@ -164,6 +164,12 @@ export class McpQuota extends tables.QuotaCounter { return true; } } + +// Register the class so the quota hook can resolve it by name — WITHOUT +// module-exporting it, which would surface update_/delete_McpQuota MCP tools +// and a REST endpoint that let a permitted client reset its own counter. +// exportTypes gates each transport independently (see the HTTP API reference). +server.resources.set('McpQuota', McpQuota, { mcp: false, rest: false }); ``` ### `mcp..quota.resource`