Skip to content

Hosted MCP returns an empty 200 instead of an error when a memory read is denied #10735

Closed

Description

@mdmohsin7

Summary

When the memory authorization check denies a hosted-MCP memory read, the handler returns an empty result set with a 200 instead of surfacing an error. The client sees "you have no memories" rather than "this key is not authorized", which is the failure mode most likely to make a user believe their data was deleted.

Where

backend/routers/mcp_sse.py:866 (and the same shape at line 1094 for the vector-search path):

if memory_list_results.read_decision == MemoryReadDecision.USE_MEMORY:
    return {"memories": memory_list_results.memories}
if not mcp_legacy_read_authorized(memory_list_results):
    return {"memories": []}

Why it matters

The two denial reasons that reach this branch are missing_rollout_state and missing_app_key_scope_grant (see #10734 for the grant-seeding gap). Both are server-side authorization states the user cannot see or act on. An empty 200 is indistinguishable from a genuinely empty account, so:

  • the user has no signal that anything is wrong and nothing to report,
  • support cannot distinguish it from "user has no memories yet" without a per-account Firestore trace,
  • it silently contradicts the memories list screen, which shows the same user's memories fine.

Observed on real accounts: MCP keys created without scopes have no grant, so every memory read through them returns empty while the account has thousands of memories in the legacy store.

Proposed fix

Return an explicit error (or at minimum an MCP-level error payload carrying reason) instead of {"memories": []} when the denial is an authorization state rather than an actual empty result. Distinguishing "denied" from "empty" is the whole ask here.

Activity

  1. added
    bug
    on Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions