-- Additive MCP storage. Apply through the existing project database workflow. -- No access token, refresh token or OAuth client secret is stored here. BEGIN; CREATE TABLE IF NOT EXISTS workbench.mcp_query_contexts ( context_handle text PRIMARY KEY, project_id uuid NOT NULL, subject text NOT NULL, client_id text NOT NULL, document jsonb NOT NULL, expires_at timestamptz NOT NULL, revoked_at timestamptz, created_at timestamptz NOT NULL DEFAULT now() ); CREATE INDEX IF NOT EXISTS mcp_query_context_owner ON workbench.mcp_query_contexts (project_id,subject,client_id); CREATE INDEX IF NOT EXISTS mcp_query_context_expiry ON workbench.mcp_query_contexts (project_id,expires_at); CREATE TABLE IF NOT EXISTS workbench.mcp_query_receipts ( project_id uuid NOT NULL, scope_key text NOT NULL, call_id text NOT NULL, parameters jsonb NOT NULL, result jsonb NOT NULL, created_at timestamptz NOT NULL DEFAULT now(), PRIMARY KEY (project_id,scope_key,call_id) ); COMMIT;