Add an MCP full-access permission that runs every action without local confirmation
CI / verify (push) Canceled after 0s

With full access the installation grants every capability, destructive and
conditionally confirmed actions (queue retry/remove with source deletion,
history clear, app restart, ...) run without the local dialog, and the new
mhu_files_grant tool can add or widen directory grants. Narrowing or removing
grants and changing permissions stay local. Enabling full access in the
settings asks for local confirmation once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SucukdeluxeandClaude Opus 5.5 committed 2026-10-21 23:02:18 +02:00
1 parent 432c0e01b8
commit 08f375621a
6 files changed
+42 -13

No files matched your search

+4 -2
View File
@@ -98,6 +98,7 @@ const definitions = [
{ transferId: id, offset: integer(0, 32 * 1024 ** 3), length: integer(1, 1024 * 1024) }, ['transferId', 'offset']],
['files_transfer_close', 'Close an owned temporary transfer handle without modifying its source file.', 'files', { transferId: id }, ['transferId']],
['files_delete', 'Delete a specifically selected file inside a writable grant.', 'files.write', file, ['rootId', 'relativePath'], true],
['files_grant', 'Grant or widen access to an absolute local directory. Requires full access; narrowing or removing a grant stays local.', 'full_access', { path: text(), readOnly: boolean, allowTransfer: boolean }, ['path']],
['cloud_status', 'Read CloudDrop log synchronization state.', 'read', {}, []],
['cloud_configure', 'Enable or disable CloudDrop log sync with the saved or supplied key.', 'settings', { enabled: boolean, apiKey: text(200) }, ['enabled']],
['cloud_backfill', 'Queue missing entries from the current local upload log.', 'control', {}, []],
@@ -131,7 +132,8 @@ function createMcpToolAdapter({ handlers, authorizeConfirmation, sanitize, audit
const tool = byName.get(name);
if (!tool || typeof handlers[name] !== 'function') throw new McpAccessError('TOOL_UNAVAILABLE');
const allowed = () => getCapabilities ? getCapabilities() : context?.scopes;
const permitted = () => Array.isArray(allowed()) && tool.requiredScopes.every(scope => allowed().includes(scope));
const fullAccess = () => Array.isArray(allowed()) && allowed().includes('full_access');
const permitted = () => Array.isArray(allowed()) && (fullAccess() || tool.requiredScopes.every(scope => allowed().includes(scope)));
if (!permitted()) throw new McpAccessError('SCOPE_DENIED');
validateInput(args, tool.inputSchema);
if (context.signal?.aborted || !Number.isFinite(context.deadline) || context.deadline <= Date.now()) throw new McpAccessError('REQUEST_EXPIRED');
@@ -150,7 +152,7 @@ function createMcpToolAdapter({ handlers, authorizeConfirmation, sanitize, audit
const startedAt = Date.now();
if (context.signal?.aborted || Date.now() >= context.deadline) throw new McpAccessError('REQUEST_EXPIRED');
if (!permitted()) throw new McpAccessError('SCOPE_DENIED');
if ((tool.destructive || requiresConfirmation(name, args)) && (!authorizeConfirmation || !await authorizeConfirmation({ tool: name, digest, args, context }))) throw new McpAccessError('CONFIRMATION_REQUIRED');
if (!fullAccess() && (tool.destructive || requiresConfirmation(name, args)) && (!authorizeConfirmation || !await authorizeConfirmation({ tool: name, digest, args, context }))) throw new McpAccessError('CONFIRMATION_REQUIRED');
if (context.signal?.aborted || Date.now() >= context.deadline) throw new McpAccessError('REQUEST_EXPIRED');
if (!permitted()) throw new McpAccessError('SCOPE_DENIED');
audit({ tool: name, event: 'started', requestId: context.requestId, durationMs: 0 });