# MCP permissions & safety MCP uses the same Read-only and Read/write API-key permissions as REST. Each tool operation is checked before it runs. ## Read and write boundaries Read-only keys can inspect sites, buckets, files, functions, databases, migration status, and secret metadata. They cannot create, update, apply, or delete resources. Use write approvals for mutating tools. Inspect current state before a change and verify the affected resource afterward. ## Live file writes `write_file` replaces the complete file and can affect an attached Site immediately. - `/web/*` changes hosted content. - `/api/*.ts` starts function deployment. - `/cron/*.ts` starts scheduled-handler deployment. There is no Site-level draft or deploy tool. Inspect the returned deployment status and verify the hosted URL or runtime before claiming success. Deleting function or cron source also removes or pauses its deployed runtime. ## Secrets `list_secrets` returns names and metadata, never values. There is no `get_secret` tool. Do not place secrets in tool arguments other than the value field of an explicitly approved `set_secret` call. ## Database migrations Cloud-first agents can use `list_database_migrations`, `get_database_migration`, and `apply_database_migration`. List and get expose successful migration resources; get includes exact SQL when it was recorded. Apply accepts one filename and SQL body with `confirm: true`; it does not require previous local files or a preflight token. The MCP confirmation binds the exact SQL. A Read-only key can inspect migrations but cannot apply them. ## Recovery When an underlying REST call fails, MCP reports a protocol-level tool error and preserves the REST generic code, message, and structured recovery metadata from `error.details`. Preserve fields such as `retryable`, `nextAction`, `migrationName`, and lease expiry. Re-read state after an ambiguous failure instead of assuming a write did or did not happen. Account database tools use the same permission boundaries as their REST routes. Generic SQL queries can mutate data and require a Read/write key. Browser tools require approval for SQL and every mutation, including export reconciliation and deletion challenges. Export tools also enforce the REST admin rules. MCP migration apply requires `confirm: true`; browser approval binds the exact single migration or ordered prefix. Deletion requires the current expiring `confirmationCode` and rejects attached databases. Save each creation `idempotencyKey` with its account and target. Preserve it on retries, including unknown provider outcomes. Do not follow mutation redirects, automatically replay ambiguous writes, or allocate replacement databases as recovery. Inspect receipts, metadata or export state first. Attachment tools report `DATABASE_ATTACHMENTS_DISABLED` while production activation is held. If SQL executed but the browser result was omitted for size, do not repeat the mutation. Use a separate bounded read to inspect its effects. Legacy browser database tools recheck current account membership at execution, including after waiting for approval. Unreadable mutation responses retain unknown-outcome and original creation-key context; a tool error does not prove no write occurred.